[FFmpeg-user] framerate issues
barsnick at gmx.net
Fri May 31 00:38:09 EEST 2019
On Thu, May 30, 2019 at 16:17:14 -0500, Calvin Arndt wrote:
> Interesting! Thanks for the tip. ffprobe now
> reports it at 7fps however it still runs way too fast.
I'm missing the complete output of your conversion command with a sane
loglevel, but I can guess what happens:
Your input provides an "mpjpeg" stream, which is "multipart-replace".
It sends one JPEG image after another, at *some* frame rate, but
without timestamps. ffmpeg assumes (a default of) 25 fps input, when in
reality it's something else, or even something varying. This assumption
speeds up the resulting video.
If you happen to know the real, exact input framerate, it is best to
specify that using the input option "-r". ffmpeg, as said, can only
guess for some types of streams.
If you do not know the exact input framerate, or it can vary, I believe
the best way to overcome the missing timestamp and fps issue is to tell
the input "-use_wallclock_as_timestamps 1". This will give the incoming
images a timstamp when they arrive (skewed against what the sender
would have stamped them, but much better than nothing). The fps filter
will ensure that you get constant framerate output by adding or
dropping frames to achieve perfectly aligned 7 fps.
(I can replicate this issue - I have an mpjpeg stream which switches
between 1 and 5 fps. ffmpeg cannot know the fps, and the varying frame
rate makes the output look peculiar if ffmpeg assumes CFR.)
More information about the ffmpeg-user