[Libav-user] Reading field by field of an interlaced video

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Jul 1 16:16:09 CEST 2012


Sampath Subasinghe <susiriss at ...> writes:

> But I guess that when avcodec_decode_video2() finishes
> reading a frame, it must have been de-interlaced 

libavcodec does no de-interlacing by default ...

> the two fields of a frame to the complete frame.

... but it usually outputs the two fields of interlaced 
video in one frame.

Imo, "interlaced" is a construct that is simply not 
compatible with the way videos are encoded / decoded 
by an application in a computer system.
(Note that is was invented for analog transmissions 
and CRT displays.)

I suspect your movie player would be quite unhappy if 
libavcodec would present it with a field on encoding...

Afaict (and I will happily stand corrected if I am 
wrong), codecs (especially MPEG-codecs) will always 
output frames, fields only exist to optimize encoding 
if the input is interlaced, fields are often abused 
when encoding progressive material but imo that only 
proves my point above.
Don't forget that typical DVB streams in PAL-land 
send movies and soaps field-encoded although the 
original material was never interlaced.
And you can of course take interlaced (live) material 
and encode it as progressive.

Carl Eugen



More information about the Libav-user mailing list