[FFmpeg-user] Slowing ffmpeg down

Shaun Procter shaun.procter at gmail.com
Wed Aug 12 06:54:35 EEST 2020



> On 12 Aug 2020, at 9:01 am, Rich Andrews <stuart.r.andrews at gmail.com> wrote:
> 
> Is there any trick to slow down ffmpeg on a simple stream mapping?
> 
> Stream mapping:
>  Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
> 
> Given an input file that is looped and output with a command such as:
> 
> ffmpeg-4.2.1-armhf-static/ffmpeg -y -t 200 -stream_loop -1 -i HoldMusic.wav
> -map 0:a:0 -f wav output.wav
> 
> ffmpeg can move the data really quickly!
> 
> bitrate=1411.2kbits/s speed= 262x
> 
> Any way to get that speed down to ~1x?  My purpose is that ffmpeg is being
> used as a child subprocess and I would like to be able to test its behavior
> in-situ.  There is a lot of timing in my  application between fork and join
> and having ffmpeg be slow would be really helpful.
> 
> Push comes to shove, I'll just use another program to more slowly copy, but
> that wouldn't be as good as using ffmpeg itself since it has a host of
> behaviors as a child process regarding signaling and return codes. Come to
> think of it, since I built ffmpeg, maybe I can just build a variant that
> sleeps frequently?
> 
> Thanks for any clever ideas!
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe”.

You can use the -re flag like this,

ffmpeg-4.2.1-armhf-static/ffmpeg -re -y -t 200 -stream_loop -1 -I HoldMusic.wav -map 0:a:0 -f wav output.wav

“The FFmpeg's "-re" flag means to "Read input at native frame rate. Mainly used to simulate a grab device." i.e. if you wanted to stream a video file, then you would want to use this, otherwise it might stream it too fast (it attempts to stream at line speed by default). My guess is you typically don't want to use this flag when streaming from a live device, ever.” - https://trac.ffmpeg.org/wiki/StreamingGuide

Hope that helps.

Shaun



More information about the ffmpeg-user mailing list