Ffmpeg how to limit input fps
Use the -re
input option:
-re (input)
Read input at native frame rate. Mainly used to simulate a grab device, or live input stream (e.g. when reading from a file). Should not be used with actual grab devices or live input streams (where it can cause packet loss). By default ffmpeg attempts to read the input(s) as fast as possible. This option will slow down the reading of the input(s) to the native frame rate of the input(s). It is useful for real-time output (e.g. live streaming).
Therefore:
ffmpeg -re -i rtsp://ipVideo …
Related videos on Youtube
cool
Updated on September 18, 2022Comments
-
cool over 1 year
I save rtsp stream to file with ffmpeg.
I see that even the stream is 30 fps, ffmpeg download it on 40-50-33 fps.
How can i limit the input frame per sec?
I tried
ffmpeg -r 30 -i rtsp://ipVideo out.h264
but it not helpI don want that only the output file will be 30 fps, I Want that ffmpeg will not download more than X fps
-
cool over 6 yearsthank about your reply , but i don't want to use -re becuase i must use -preset ultrafast , and if i use with this this not working good with ultrafast(i not sure why)
-
Gyan over 6 yearsIf you want to limit download speed, then it makes sense to use a fast preset only if the natural processing speed with that preset is less than X fps. That said, try the method at stackoverflow.com/a/46602882/5726027
-
cool over 6 years@Mulvya i use preset ultrafast becauase if not i got packages lost and then error decode. i think that ffmpeg/my cpu not fast enough to re-encode the stream, so i must use preset ultra fast.(i not find another solution how to fix this , because i muse decode- encode the stream if i want to overlay/crop it)