Difference in ffmpeg command execution time
Hi, On trying to create video using ffmpeg as per command below, it takes much more time (around 6 minutes) on AWS lambda and EC2 instances where as it takes just 2 minutes on my local mac. I understand run time differs on CPU, but I am not able to figure out what needs to be done in order to get it run within 5 minutes on lambda. Or it could be due to differences in or missing libraries. Could someone please point me in right direction? Command: ffmpeg -safe 0 -f concat -i /tmp/config.txt -i /tmp/audio.mp3 -y -pix_fmt yuv444p -shortest /tmp/out_ffff.mp4 Attached are the logs of both the machines. -- Thanks, Vivek
2017-02-24 8:08 GMT+01:00 Vivek Jain <vivek.jain@mindtickle.com>:
ffmpeg -safe 0 -f concat -i /tmp/config.txt -i /tmp/audio.mp3 -y -pix_fmt yuv444p -shortest /tmp/out_ffff.mp4
Missing time and / or benchmark option. Please also try with -threads 1 and different values for -threads. Carl Eugen
Hi Carl, I tried with benchmark options and varying no of threads but I could not find differences in execution time on EC2 instance. They all took almost ~6 minutes. Command: ffmpeg -safe 0 -f concat -i /tmp/config.txt -i /tmp/audio.mp3 -y -pix_fmt yuv444p -shortest -threads $THREADS -benchmark /tmp/out_ffff.mp4 Also, I observe there is a point where the command gets stuck for a considerable time (log line below). I have a feeling there is something here... frame= 3826 fps= 84 q=28.0 size= 2700kB time=00:02:30.68 bitrate= 146.8kbits/s dup=3824 drop=0 speed= 3.3x (threads = 12) frame= 3826 fps= 85 q=28.0 size= 2708kB time=00:02:31.28 bitrate= 146.7kbits/s dup=3824 drop=0 speed=3.37x (threads = 1) frame= 3826 fps= 83 q=28.0 size= 2717kB time=00:02:31.08 bitrate= 147.3kbits/s dup=3824 drop=0 speed=3.28x (threads = 2) frame= 3826 fps= 10 q=28.0 size= 2853kB time=00:02:31.08 bitrate= 154.7kbits/s dup=3824 drop=0 speed=0.408x (threads =2) this time, speed extremely slow. frame= 3826 fps= 83 q=28.0 size= 2717kB time=00:02:31.04 bitrate= 147.4kbits/s dup=3824 drop=0 speed=3.27x (threads = 3) frame= 3826 fps= 83 q=28.0 size= 2712kB time=00:02:31.00 bitrate= 147.1kbits/s dup=3824 drop=0 speed=3.28x (threads = 4) Logs attached. I have couple of questions to deep dive here, and may be find an alternative: 1. Can we determine at points it is stuck or slow, what is it actually doing? If it's an encoder issue, may be I can try switching to some other one? 2. Alternatively, is there a way we can create video using images & an audio in lesser time? My worry is I want to run it over AWS lambda which can't for more than 5 minutes. 3. Can we somehow maintain state (partial output) of ffmpeg so that it can be passed in the next call to lambda. Highly appreciate your help! On Fri, Feb 24, 2017 at 4:49 PM, Carl Eugen Hoyos <ceffmpeg@gmail.com> wrote:
2017-02-24 8:08 GMT+01:00 Vivek Jain <vivek.jain@mindtickle.com>:
ffmpeg -safe 0 -f concat -i /tmp/config.txt -i /tmp/audio.mp3 -y -pix_fmt yuv444p -shortest /tmp/out_ffff.mp4
Missing time and / or benchmark option. Please also try with -threads 1 and different values for -threads.
Carl Eugen _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
-- Thanks, Vivek
2017-02-28 8:42 GMT+01:00 Vivek Jain <vivek.jain@mindtickle.com>:
I tried with benchmark options and varying no of threads but I could not find differences in execution time on EC2 instance. They all took almost ~6 minutes.
So only one cpu is used. What did your tests on your local mac show? Please understand that only current FFmpeg git head is supported on this mailing list, if you feel that the "note" on https://www.johnvansickle.com/ffmpeg/ is not sufficient, please say so! Please do not top-post here, Carl Eugen
participants (2)
-
Carl Eugen Hoyos -
Vivek Jain