[FFmpeg-user] Fw: Re: Confusion about fieldmatch, decimate and framerate

Nicholas Robbins nickrobbins at yahoo.com
Thu Nov 7 16:18:01 CET 2013



--- On Thu, 11/7/13, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> From: Carl Eugen Hoyos <cehoyos at ag.or.at>
> Subject: Re: [FFmpeg-user] Confusion about fieldmatch, decimate and framerate
> To: ffmpeg-user at ffmpeg.org
> Date: Thursday, November 7, 2013, 9:10 AM
> Nicholas Robbins <nickrobbins
> <at> yahoo.com> writes:
> 
> > Uploaded to upload.ffmpeg.org/incoming as
> sample-robbins.mkv
> 
> The sample claims to be 60fps while it actually is 30fps.
> Assuming you produced the mkv file from a MPEG original:
> Is the problem also reproducible with the original mpeg 
> file?

I'm at work now, I'll check when I get home. The mkv file is just a remuxing of the original mpeg, but it seems like this might be a container issue. Funny, the original plays at the proper rate. Presumably vlc and mplayer are playing the video frame by frame by their PTS's rather than listening to the container's fps information.

> The following work fine here:
> $ ffmpeg -i sample-robbins.mkv 
> -vf fps=30000/1001,fieldmatch,decimate -qscale 2 out.avi
> 

That works for me too. I saw the fps filter but thought that it would "Convert the video to specified constant frame rate by duplicating or dropping frames as necessary"? In this case dropping half the frames. However, that seems not to be the case. So, if I understand it correctly, the container says the video is 60fps (incorrect), but it contains frames with PTS's set for 30fps (correctly). So if I just to the fieldmatch, it is just moving frames around in the groups of 10 or whatever, so the PTS's stay correct. Adding in the decimate filter someone makes it recalculate the PTS's based on the alleged 60fps. Producing the double speed video. Adding in the fps=29.97 filter would drop frames, but the filter looks around for frames in the hypothetical 60fps stream and finds frames with PTS's spaced perfectly for 30fps. So it uses all of them, really just fixing the container fps information.

> $ ffmpeg -i sample-robbins.mkv -vf pullup 
> -r 24000/1001 -qscale 2 out2.avi
> 
> pullup is much faster but older and probably does not 
> fix all frames (this is what the console output 
> suggests here and what is expected).
> 

Fieldmatch is fast enough for me.


> Carl Eugen




More information about the ffmpeg-user mailing list