[FFmpeg-user] Detect interlaced video

Nicholas Robbins nickrobbins at yahoo.com
Tue May 13 22:44:26 CEST 2014



> On Tuesday, May 13, 2014 4:31 PM, Clément Bœsch <u at pkh.me> wrote:

> > On Tue, May 13, 2014 at 10:20:34PM +0200, Oliver Fromme wrote:
> 
>>  Carl Eugen Hoyos wrote:
>>   > Oliver Fromme <oliver <at> fromme.com> writes:
>>   > 
>>   > > Actually I had hoped that there is a flag somewhere 
>>   > > on the DVD, either in the meta data or in the MPEG2 
>>   > > stream itself, indicating whether a title is 
>>   > > interlaced or progressive.
>>   > 
>>   > The flag tells you if the stream was encoded using 
>>   > mpeg2video interlaced or mpeg2video progressive, but 
>>   > to decide whether or mot to deinterlace a video, only 
>>   > the actual content is relevant: Progressive content 
>>   > is often encoded as interlaced and it is of course 
>>   > possible (although unlikely) that interlaced content 
>>   > is encoded using progressive frames.
>> 
>>  Ok, thanks for the explanation.  So I will just use the
>>  idet filter to determine whether deinterlacing is required.
>> 
>>  By the way, does it hurt to use the yadif filter on frames
>>  that are not interlaced?
>> 
> 
> While it might be fine for playback, it will probably alter non interlaced
> frame a lot. You might want to use the timeline system of libavfilter to
> enable the filter in some specific time ranges.
> 
> [...]
> 
> -- 
> Clément B.

Yadif definitely hurts progressive video if it is done on everything. you can see it on smooth motion in particular.

If I understand correctly,

-vf idet,yadif=deint=interlaced:mode=1

should turn video that is a mix of 30 frames per second progressive and 30 fps interlaced into 30 fps progressive and 60 fps progressive. I've had mixed success with it. I've looked a little at the code and played with it and I don't see why it shouldn't work, but I wouldn't count on it.

I would also make sure that the content isn't telecined. If you are talking about something like deleted scenes with comentary from a dvd, it is often a mixed of 24fps->30fps telecine and 30fps progressive. On this, in theory,

 -vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1

should produce a mix of 24fps (originally telecined), 30 fps (originally progressive) and 60 fps (originally interlaced) all progressive.


Nick


More information about the ffmpeg-user mailing list