[FFmpeg-user] Npm - videoshow taking long time to convert video from images

Moritz Barsnick barsnick at gmx.net
Fri Feb 10 11:07:10 EET 2017


On Fri, Feb 10, 2017 at 12:25:38 +0530, Vivek Jain wrote:
> I am trying to create video using npm-videoshow, but it appears to take
> considerable time (~3 minutes for 14 minute video). Could someone please
> advise how can the timing be improved.
[...]
> ffmpeg process started: ffmpeg -i
> /var/folders/9f/1wx7q0954l94rhtc4r6r95xw0000gn/T/videoshow-0bdf6f71-cc4d-498c-b7bf-eaf1eccaa9a6
> -i /tmp/audio.mp3 -y -b:a 128k -ac 2 -r 25 -b:v 1024k -vcodec libx264
> -filter:v scale=w=640:h=trunc(ow/a/2)*2 -f mp4 -map 0:0 -map 1:0 -t 864 -af
> afade=t=in:ss=0:st=0:d=3 -af afade=t=out:st=861:d=3 -pix_fmt yuv420p
> video_test.mp4

> Total Time in conversion: 3 minutes 5 seconds

You didn't say anything about your requirements. There are a lot of
things which can be done to increase conversion speed:
- buy a faster CPU;
- choose a faster codec, such as mpeg4;
- reduce the size of the output video;
- ...

Or, assuming you actually want H.264 video with the given resolution:

You can (almost) always exchange the parameters encoding quality,
encoding speed, and bitrate (bandwidth) for each other. Using libx264,
you could add "-preset ultrafast" and it will encode up to 10x as
quickly - but the resulting file will suffer in quality. Or, if you
drop the parameter "-b:v 1024k", the file may become very much larger.
You can play with the presets until you hit an optimal compromise for
yourself.

Moritz

P.S.: Isn't "scale=w=640:h=trunc(ow/a/2)*2" just a complicated way of
      writing "scale=w=640:h=-2"?


More information about the ffmpeg-user mailing list