Npm - videoshow taking long time to convert video from images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Npm - videoshow taking long time to convert video from images

Vivek Jain
Hi,

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.

*Input supplied to videoshow:*
Image-Loop list:

[ { path: '/tmp/out_1.png', loop: 153 },  { path: '/tmp/out_2.png', loop:
711 } ]

VideoOptions:

{ fps: 25,  videoBitrate: 1024,  videoCodec: 'libx264',  size: '640x?',
 audioBitrate: '128k',

  audioChannels: 2,  format: 'mp4',  pixelFormat: 'yuv420p' }

Here's *Videoshow module output*:

ffmpeg process started: ffmpeg -i
/var/folders/9f/1wx7q0954l94rhtc4r6r95xw0000gn/T/videoshow-4b27c460-1ad5-450b-a1a0-66bd9519dafc
-i
/var/folders/9f/1wx7q0954l94rhtc4r6r95xw0000gn/T/videoshow-40f0337c-d67e-4b47-b050-10f11d36daff
-y -filter_complex concat=n=2:v=1:a=0 video_test.mp4

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

Video created in: video_test.mp4
Total Time in conversion: 3 minutes 5 seconds

--
Thanks,
Vivek
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Npm - videoshow taking long time to convert video from images

Moritz Barsnick
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"?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Npm - videoshow taking long time to convert video from images

Vivek Jain
Hi Moritz,

My requirement is to create video using an audio and set of images with
varying durations. I wouldn't want to compromise the quality unless there
is no other way to reduce video generation time.

Would you be able to advise if there is a good npm module over ffmpeg which
does the conversion?

My end goal is to run ffmepg over AWS lambda and generate video, so I am
currently trying out various available node modules over ffmpeg.

Thanks in advance!

Vivek

The below ffmpeg output is actually produced by npm-videoshow module (over
ffmpeg)

On Fri, Feb 10, 2017 at 2:37 PM, Moritz Barsnick <[hidden email]> wrote:

> 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"?
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".




--
Thanks,
Vivek
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Npm - videoshow taking long time to convert video from images

Carl Eugen Hoyos-2
In reply to this post by Vivek Jain
2017-02-10 7:55 GMT+01:00 Vivek Jain <[hidden email]>:
> -af afade=t=in:ss=0:st=0:d=3 -af afade=t=out:st=861:d=3

This does not do what most users expect, only
one filter invocation is made.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Npm - videoshow taking long time to convert video from images

Vivek Jain
Sorry, but I dint get your response. I am almost new to ffmpeg world.

On Fri, Feb 10, 2017 at 4:25 PM, Carl Eugen Hoyos <[hidden email]>
wrote:

> 2017-02-10 7:55 GMT+01:00 Vivek Jain <[hidden email]>:
> > -af afade=t=in:ss=0:st=0:d=3 -af afade=t=out:st=861:d=3
>
> This does not do what most users expect, only
> one filter invocation is made.
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
>



--
Thanks,
Vivek
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".