FFMPEG Bug
-
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 ??
- The topic ‘FFMPEG Bug’ is closed to new replies.