• Resolved bavoko.tools

    (@bavokoservices)


    Hi there, I just now downloaded your plugin to use the “gif to mp4” convert functionality. After not finding the option, I took a look into the settings and noticed that the plugin can’t find ffmpeg or avconv. A quick look into the location of the file and it turns out the default folder of “/usr/local/bin” was wrong and I changed it to “/usr/bin”. However it still didn’t work, even though it worked flawlessly in SSH/CLI. So I took a look at your code, debugged some outputs and noticed that you have an escaping error. You are missing the last quote for the output file url. Right now it’s this:

    $cmd = escapeshellcmd($test_path.'/'.$options['video_app'].' -i "'.plugin_dir_path(__FILE__).'images/sample-video-h264.mp4" -vframes 1 -f mjpeg "'.$uploads['path'].'/ffmpeg_exists_test.jpg').'" 2>&1';

    However as you can see only the first quote of the output file url is actually submitted to the escaping function. The last quote is appended after that with the output redirect. This results in the first quote being escaped with a slash, while the last quote remains normal, and thus the file URL turning invalid. The plugin will then say that FFMPEG is not installed. So it should be like this:

    $cmd = escapeshellcmd($test_path.'/'.$options['video_app'].' -i "'.plugin_dir_path(__FILE__).'images/sample-video-h264.mp4" -vframes 1 -f mjpeg "'.$uploads['path'].'/ffmpeg_exists_test.jpg"').' 2>&1';

    If anyone else has that problem: Try changing above line in “/video-embed-thumbnail-generator.php”, line 1140.

    While I’m on it I also noticed that the fallback for that function (where the path is ommited), has a similar problem. Same file, line 1153. This time the command is missing the output file quotes all together and has no space between the output format (“-f mjpeg”) and the output file URL after that. It will thus never work correctly, as the file is appended to the format instead of being supplied as the output file path.

    $cmd = escapeshellcmd($test_path.'/'.$options['video_app'].' -i "'.plugin_dir_path(__FILE__).'images/sample-video-h264.mp4" -vframes 1 -f mjpeg'.$uploads['path'].'/ffmpeg_exists_test.jpg');

    Please fix ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    Thanks for your careful debugging. That’s a new change from last week’s first update in 18 months and it looks like I didn’t test it enough.

    Plugin Author Kyle Gilman

    (@kylegilman)

    I don’t see that missing space in line 1153 though. Did you get the plugin directly from the WordPress plugin directory?

    Plugin Author Kyle Gilman

    (@kylegilman)

    I just released version 4.6.27 which incorporates the fix that you posted here. Thanks again for your help.

    Thread Starter bavoko.tools

    (@bavokoservices)

    I downloaded it normally from the backend repo, but it’s gone now so all good ??

    Awesome plugin though! And great support! I’ll leave a review ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘FFMPEG Bug’ is closed to new replies.