[FFmpeg-user] dv => mp4: deinterlace or not, and how?

sean darcy seandarcy2 at gmail.com
Fri May 6 01:34:12 CEST 2011

On 05/05/2011 04:36 PM, Baptiste Coudurier wrote:
> Hi,
> On 05/05/2011 01:19 PM, sean darcy wrote:
>> I have an interlaced dv file. I'm transcoding it with x264 to mp4.
>> 1. ffmpeg -i file.dv -an -vcodec libx264 -b<x>  out.mp4
>> If I just leave it like that, is out.mp4 interlaced or progressive?
> progressive. By default encoding is progressive.
>> 2. ffmpeg -i file.dv -an -vcodec libx264 -b<x>  -deinterlace out.mp4
>> Here I assume out.mp4 is progressive. The ffmpeg documentation says:
>> "The alternative is to deinterlace the input stream with `-deinterlace',
>> but deinterlacing introduces losses."
> Correct, it is progressive. Use -vf yadif instead of -deinterlace
> Deinterlacing may be a bit destructive, especially if the input is _not_
> interlaced.
>> [...]
>> Given this note about losses, am I right we should never deinterlace?
>> Almost never? When is deinterlacing required/better?
> You have options:
> if the receiving end playback interlaced (CRT tv):
> encode interlaced
> else if the receiver is going to deinterlace if the file is marked as
> interlaced and you trust this deinterlacer, then you may encode
> interlaced (deinterlacing will take cpu time)
> otherwise you should deinterlace yourself using a good deinterlacer.

Right. I knew that! Just passed right out of my mind, though.
> I suggest always deinterlace using -vf yadif if the source content is
> interlaced

Well I found http://guru.multimedia.cx/deinterlacing-filters/

so I thought I'd try:

-vf "yadif=3:0,mp=mcdeint=2:0:10"

(dv is bottom-field first, right?)

That generates a lot of perplexing output:

[snow @ 0x230df40] pass:4mv changed:1384
[snow @ 0x230df40] pass:0 changed:1083
[snow @ 0x230df40] pass:1 changed:407
[snow @ 0x230df40] pass:2 changed:147
[snow @ 0x230df40] pass:3 changed:50
[snow @ 0x230df40] pass:4 changed:17
[snow @ 0x230df40] pass:5 changed:11
[snow @ 0x230df40] pass:6 changed:2
[snow @ 0x230df40] pass:7 changed:1
[snow @ 0x230df40] pass:8 changed:1
[snow @ 0x230df40] pass:9 changed:1
[snow @ 0x230df40] pass:10 changed:1
[snow @ 0x230df40] pass:11 changed:2
[snow @ 0x230df40] pass:12 changed:2
[snow @ 0x230df40] pass:13 changed:2
[snow @ 0x230df40] pass:14 changed:0
[snow @ 0x230df40] pass:4mv changed:1864

I realize the filter comparison is from five years ago, and yadif may 
have changed significantly since then. Does mcdeint still add anything 
to yadif?


More information about the ffmpeg-user mailing list