[MEncoder-users] interlaced/non-interlaced
Andrew Berg
bahamutzero8825 at gmail.com
Sat Oct 2 07:53:40 CEST 2010
On 10/1/2010 3:36 PM, Toerless Eckert wrote:
> As far as yadif is concerned, i am still confused as to the benefit
> of deinterlacing during encoding as opposed to when displaying the media.
There are two big reasons. First, progressive video is more compressible
than interlaced video with any codec. Second, the video would only need
to be deinterlaced once instead of every time you want to watch it.
> So, i do have PAL TV media sent as 720i50 MPEG2. I don't think there
> is any indication in the MPEG stream whether or not the content is actually
> interlaced or not. As far as i know it's always indicated to just be
> 720i50 MPEG2. Factually 50% of the content is actually interlaced and
> the other 50% is non-interlaced: it was recorded with 720p25 cameras
> and is just sent as 720i50 (aka: anything newer usually is recorded
> progressive). So ultimately, i do not know what content type it is.
I am not sure how 25p -> 50i is handled. It's possible that you are
receiving 25p video flagged as interlaced if the original is recorded at
25p. You can play video back frame-by-frame with MPlayer by pausing it
and pressing the period key to advance a frame. If you see full frames,
it's progressive. If you see combing, it's interlaced.
> So, when i do have original 720p25 content i receive as 720i50 and i
> use a deinterlacer like yadif then i should always loose resolution/sharpness
> due to the interpolation happening in the deinterlacer. Right ?
If you use a deinterlacer on progressive content, you will likely have
very noticeable distortions. If the 25p video was interlaced before
broadcast, you've already lost (a very small amount of) quality.
> For such content the best encoding would simply be to merge both fields
> back and encode as progressive 720p25. I think this is what would happen
> in ffmpeg if i would not specify progressive encoding, but not specify any
> deinterlacer. Right ?
AFAIK, it's not possible to losslessly restore progressive frames once
the video is interlaced while maintaining a constant frame rate and
resolution throughout. I'm not sure what you mean by merging fields.
> But if i would do deinterlacing into 720p50 before re-encoding into mpeg4
> then i would have just have doubled the number of bits to encode over
> the origianl 720i50 input i had. Are you really claiming that if i re-encode
> into eg: 1500 kbps mpeg4 (part 2 ;-), that i do get a better result
> with the deinterlaced 720p50 input as opposed to the interlaced 720i50
> input (given the duplicate number of input bit's ) ????
You will get better quality if you deinterlace to 25p (Yadif can output
one frame for every pair of fields) than if you stay with 50i. Yes,
technically, quality is lost when you deinterlace, but it's not much of
a loss. If you are so concerned about the quality loss from
deinterlacing, don't re-encode it. The bits you'd save (if any) would be
too few to justify the time spent to encode whether you encode 50i or
50p. Seriously, take material that you know is recorded at 50i and
compare the quality when encoded at 25p, 50p and 50i.
Yadif is an excellent deinterlacer. I don't know about ffmpeg, but
MEncoder has mcdeint, which will reduce the very small amount of quality
loss that Yadif introduces. Of course, mcdeint is very slow and only
worth the time if you are obsessed with reducing temporal artifacts
(which you seem to be).
> And because the TV recording will switch mid-stream between either
> case, this decision would need to be made continuous resulting in a
> media stream switching between 720i50 and 720p25 - and the encoder should
> according encode interlaced and progressive.
It shouldn't switch during a program. It could switch when ads come on,
but you would have those cut out anyway.
> Short of that it still sounds most prudent to continue
> encoding interlaced everything as 720i50.
As I said, compare encodes. You'll see that the quality loss that comes
from the encoder not being able to handle interlaced material
efficiently is going to be much more than the loss from deinterlacing.
More information about the MEncoder-users
mailing list