[FFmpeg-user] Questions about w3fdif deinterlacing

Andy Furniss adf.lists at gmail.com
Sun Jan 19 21:35:39 CET 2014

Christian Ebert wrote:

> I seem to get different results regarding the amount of resulting
> frames:
> ffmpeg -y -v quiet -i prog-int.ts -an -vf yadif=1 test.mp4
> ffprobe -show_frames test.mp4 2>/dev/null | grep -c video
> 2356
> ffmpeg -y -v quiet -i prog-int.ts -an -vf yadif=1:deint=interlaced test.mp4
> ffprobe -show_frames test.mp4 2>/dev/null | grep -c video
> 2356
> ffmpeg -y -v quiet -i prog-int.ts -an -vf idet,yadif=1 test.mp4
> ffprobe -show_frames test.mp4 2>/dev/null | grep -c video
> 2348
> ffmpeg -y -v quiet -i prog-int.ts -an -vf idet,yadif=1:deint=interlaced test.mp4
> ffprobe -show_frames test.mp4 2>/dev/null | grep -c video
> 2348

It seems this is because you are muxing to mp4 - I assume, but don't 
know that it can't handle the different framerates that result from 
using yadif=1.

The output of your commands without the -v quiet shows eg.

frame= 2356 fps= 17 q=-1.0 Lsize=   66806kB time=00:00:47.08 
bitrate=11624.3kbits/s dup=432 drop=0

So 432 frames have been duplicated these look to be the progressive ones.
The difference in number between those flagged as progressive (408) are 
all the first frame duped, though slightly strange because of the -an 
the explanation is probably that the sound is 1 sec ahead of the video 
in the prog-int.ts stream.

This does not happen if you change mp4 to mkv - the container will show 
50fps, but the pts timestamps vary to give 25 fps then 50 fps.
I don't know how compatible this is with players generally, but it works 
with mplayer.

> And I don't understand why deinterlacing takes place in the
> following case:

> [Parsed_idet_0 @ 0x7f9c24000000] Single frame detection: TFF:0 BFF:0 Progressive:928 Undetermined:303
> [Parsed_idet_0 @ 0x7f9c24000000] Multi frame detection: TFF:0 BFF:0 Progressive:1210 Undetermined:21
> ffprobe -select_streams v -show_frames test.vob 2>/dev/null | grep -c video
> 1232
> ffmpeg -y -v quiet -i test.vob -vf idet,yadif=1 test.mp4

This should be -vf idet,yadif=1:deint=interlaced for yadif to honor what 
idet detects.

> ffprobe -select_streams v -show_frames test.mp4 2>/dev/null | grep -c video
> 2462
> As idet does not report any interlaced frames, why are nearly all
> frames deinterlaced?
> I must be misunderstanding something entirely, sorry for being
> naïve.

More information about the ffmpeg-user mailing list