View Full Version : interlaced encoding bitrate requirements
greenlight
12th November 2004, 17:54
Hi,
I've been reading posts/guides and learning as much as I can, but can only seem to find general answers to the following question.
As I understand it, encoding interlaced material requires a higher bitrate. What range are we talking about roughly, bitrate or percentage-wise compared to progressive?
I'm using XVID for capturing from my dish-pvr receiver, tv-shows and occaisional anime that I'd like to keep. 640x480 interlaced NTSC from S-video out to bt878 capture card. The shows are intended for playback to tv-out from htpc and also for a future set-top player, so I'd like to keep most interlaced.
Some "short-term" captures I capture in single-pass with around 2000kbs, 3 B-VOP, Ultra-High motion, Turbo, VHQ off, to watch and delete. For show to be later archived, I'm using a Quant 2 capture with Sharktooth's EQM V3UHR matrix for later two-pass encoding and I'm happy with the quality.
Anyway, how does Xvid encode interlaced content vs. progressive. Does it encode twice as many frames at half the vert resolution...hence the higher bitrate requirement? Or just the way the separate fields exist in the frame cost more bits, or something else?
If I undertand correctly, the Dish Network content is mpeg-2 with varying resolutions, 4nnX4nn roughly, from what I've heard. Varying quality, artifacts are present sometimes of course. This probably belongs in vid capture forum, but any Xvid specific hints for encoding this content?
Thanks in advance for any answers,
Greenlight
Manao
12th November 2004, 22:36
When encoding interlaced material, XviD considers the interlaced picture as a frame. However, after making the motion compensation, it can "deinterlace" the residual if it's necessary.
XviD is not as efficient as MPEG2 to compress heavily interlaced material, because it lacks field motion compensation ( which is supported by mpeg4, but not (yet ?) by XviD ).
Sadly, I'd say that DivX5 should handle interlaced content better ( since it does field motion compensation, but somehow, seeing how they are able to bloat their software, and since I didn't try DivX5 on interlaced material, I prefer being cautious ).
To sum up, use mpeg2 (open format, playable on setupbox ) or vp6 ( never tried, there again, but it should be better than both mpeg2 and mpeg4 )
Koepi
12th November 2004, 22:46
Erm, I have to correct you there.
If you encode interlaced, the frame is treated as "two half frames", thus treating the frame as field based. So instead encoding the whole frame, 2 images get created and encoded, using every 2nd line of the image - picture 1 all even lines, picture 2 all odd lines. This is defined by the mpeg4 standard.
Regards
Koepi
SeeMoreDigital
12th November 2004, 23:12
Originally posted by Koepi
Erm, I have to correct you there.
If you encode interlaced, the frame is treated as "two half frames", thus treating the frame as field based. So instead encoding the whole frame, 2 images get created and encoded, using every 2nd line of the image - picture 1 all even lines, picture 2 all odd lines. This is defined by the mpeg4 standard. It might be interesting to see what happens when one of these pseudo fields is removed entirely, prior to encoding. Thus reducing 480 and 576 content to 240 and 288 respectively!
Cheers
minolta
13th November 2004, 00:11
Actually, divx is not efficient w/ interlaced material since it does not handle b-frames w/ interlace. Xvid does a good job, but could probably be much better. An "interlace" shoot-out between divx, xvid, wmv9, mpeg2, vp6, and ffvfw can be found here:
http://www.vrac.iastate.edu/~chadspen/interlace/index.html
In general, I'd say interlace increases bitrate-quality requirements (whatever that means???) by 10 to 25%...
-Minolta
loni_blues
13th November 2004, 00:11
Koepi,
I'm not sure I really understand. What you wrote does not mean that the encoding makes 2 frames out of an interlaced frame, but rather the way XviD deals with the encoding of interlaced frames (so as to avoid artifacts, may be?), isn't that so?
Another thing: I can't really understand the option "top field first" in XviD settings as IMHO this would only make sense if the interlaced frame was split in 2 (as it is with Bob() in Avisynth). But shouldn't that precisely be done through Avisynth? And in that case, what's the point of setting TFF (or BFF) in XviD settings?
Thanks for your help,
Regards,
loni_blues
Manao
13th November 2004, 00:19
Koepi : there's still a "#if 0" around the writting of the field motion compensation flags for the MB. And since the code allows to handle interlaced dct, I've thought that checking interlacing in XviD's gui was only activating the possibility of using interlaced dct.
If I'm wrong, what's the use of this code : interlaced dct is useless if you consider the whole frame as two fields.
Edit : loni_blues : And in that case, what's the point of setting TFF (or BFF) in XviD settings?Because the input flag (TFF or BFF ) may be wrong.
sysKin
13th November 2004, 03:24
Originally posted by Koepi
Erm, I have to correct you there.
If you encode interlaced, the frame is treated as "two half frames", thus treating the frame as field based. So instead encoding the whole frame, 2 images get created and encoded, using every 2nd line of the image - picture 1 all even lines, picture 2 all odd lines. This is defined by the mpeg4 standard.
I'm afraid it's incorrect this time Koepi :(
Manao is correct - XviD can use field-dct flag to save DCT coefficients on two fields separately, although decision whether to use this flag is not RD-based so it's not perfect. Also, VHQ will always assume that this flag is not available (I have no idea how to "fix" it without making VHQ twice as slow).
Field-ME is not supported at all, so motion estimation happens on the whole picture, with only one vector for both fields.
Can DivX do interlaced encodings now? I didn't know. What does it do, field-dct only, as well?
Radek
greenlight
13th November 2004, 06:34
Originally posted by minolta
Actually, divx is not efficient w/ interlaced material since it does not handle b-frames w/ interlace. Xvid does a good job, but could probably be much better. An "interlace" shoot-out between divx, xvid, wmv9, mpeg2, vp6, and ffvfw can be found here:
http://www.vrac.iastate.edu/~chadspen/interlace/index.html
In general, I'd say interlace increases bitrate-quality requirements (whatever that means???) by 10 to 25%...
-Minolta
Thanks Minolta for the link, and everyone else who answered. I have a much better picture of what is happening now.
Greenlight
Koepi
13th November 2004, 07:33
Thanks sysKin for correcting me - XviD had proper field based encoding earlier and I just _assumed_ it's still in there :(
Sorry Manao, my fault!
Regards
Koepi
SeeMoreDigital
13th November 2004, 10:43
I have a couple of Mpeg2 interlaced/field test encodes on my web site you guys can try generating Mpeg4 encodes with!
If you want them, please click here (www.SeeMoreDigital.net/51_Test_Encodes/51_AV_Setup_Test_Files.html).
Cheers
loni_blues
13th November 2004, 21:58
Thanks, Manao.
Sorry, but I still can't get it.
What's the point in correcting the field order if both fields are still in the same frame? Which, correct me if I'm wrong, is the case unless you separate the 2 fields to get 2 frames (one for each field). That's what Bob() does. But putting AssumeTFF() (or BFF()) before Bob() deals with the field order problem, doesn't it? Unless, pardon my ignorance, there's another procedure not based on Avisynth for splitting fields into different frames.
Regards.
minolta
13th November 2004, 22:48
Originally posted by loni_blues
Thanks, Manao.
Sorry, but I still can't get it.
What's the point in correcting the field order if both fields are still in the same frame? Which, correct me if I'm wrong, is the case unless you separate the 2 fields to get 2 frames (one for each field). That's what Bob() does. But putting AssumeTFF() (or BFF()) before Bob() deals with the field order problem, doesn't it? Unless, pardon my ignorance, there's another procedure not based on Avisynth for splitting fields into different frames.
Regards.
AFAIK, field-order is only written to the output stream. It is not useful for encoding (so far). Of course, it IS useful for decoding (my hardware player obeys mpeg4 field-order, and the "new" xvid decoder does/will also).
loni_blues
14th November 2004, 16:26
Of course! It DOES matter for decoding and telling which field should be displayed first! Simple, yet I couldn't see it.
Thanks a lot minolta!
dapipa
19th November 2004, 13:36
Sooooo... What would you recommend me for this case: House of Flying Daggers / 29.97 fps (genuine NTSC - not telecine) - I wanted to encode it as interlaced, because I plan to watch it on TV, but now I'm confused:confused: I thought that XviD just splits the frames into fields and encodes them separately (thence the higher bitrate requirement)... I'd rather not deinterlace it, although I've got pretty good result on some movies with fielddeinterlace, but I was configuring it frame by frame then and it takes sooooo much time:(
minolta
19th November 2004, 21:16
@dapipa
first, there is still nothing wrong with leaving your video interlaced. while xvid does not have all possible interlace optimizations, it is still much better (per bitrate) than divx or mpeg2 (see shoot-out link). also, motion will appear much more smooth just like the original...
however, if you wish to quickly de-interlace to 30p, i suggest trying tomsmocomp or others instead of fielddeinterlace.
manono
20th November 2004, 16:55
Hi-
Is this the R3 EDKO DVD of House Of Flying Daggers? If so, it's a very bad PAL to NTSC conversion. I used Restore24 on it to make it progressive and to get rid of all the blending. Looks one hell of a lot better than that crappy DVD.
It's not truly interlaced. There's a progressive 25fps movie underneath all that interlacing.
dapipa
22nd November 2004, 06:27
@manono
Yup, it's that R3 DVD:( I've downloaded Restore24 a long time ago, but never actually used it - I'll give it a try - hope it's not too complicated to configure, or something;) Thanks for the advice!
P.S. I've originally planed to preserve the interlace like this: SeparateFields() in AviSynth, progressive encode with XviD, then Weave() in ffdshow's AviSynth window (using automatic preset loading) - not very straightforward, is it?
dapipa
10th March 2005, 09:32
I've originally planed to preserve the interlace like this: SeparateFields() in AviSynth, progressive encode with XviD, then Weave() in ffdshow's AviSynth window (using automatic preset loading) - not very straightforward, is it?
I'm sorry to repeat this question, but I'd like to get an answer from one of the XviD gods here;) So, what's (in your opinion) better to preserve interlace:
1. Turn on Interlaced in XviD,
2. That AviSynth bussiness mentioned above?
Thanks!
dp
Shinigami-Sama
12th March 2005, 06:54
I;ve been wondering that too
I've wanted to encode a few consert dvds to xvid to get rid of het rather crapy grain and noise and I don't realy want ot de-interlace I;ve run acros to many pv;s that look lie crap because of de-interlacing
but that jsut mght be bad luck
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.