View Full Version : Encoding DVB TV problem
ob-Tom
24th February 2006, 11:24
Hi All,
I'm rather new to this encoding lark, but I have done a reasonable amount of searching on this problem so hopefully it's not too basic.
Basically, I have a Compro DVB T200 (for my sins) and have recorded some tv from it. I open up the clip in Media Player and it looks very good. Video and audio is in sync throughout (fellow sufferers of Compro products will understand the simple pleasures that this brings; if you don't have the latest drivers for this card, get them!). Then I run the file through ProjectX, DGindex and write a simple AviSynth script to load the video and audio. I don't do any resizing etc.
If I open this script in Media Player, the audio/video is still in sync (wahoo!), but in fast sequences (particularly horizontal) I see lines across the screen. After a few Googles, I surmised these to be combing or interlacing artefacts. Interestingly, the video at this stage is not being shown in the same aspect ratio as before and leads me to believe that this changing of video size is probably causing the problems. Is this possible? I have no desire to use something like Decomb, because the source file seemed so good and I don't think that it should be necessary to remove something that shouldn't have appeared during processing.
Some other interesting-ish details: With the first unprocessed video clip, Media Player shows it in 'widescreen'. If I click on File->Properties, there is a resolution of 704x576 at 16:9. When I open the clip in DGIndex, the ratio becomes 11:9 (which by my reckoning is correct, i.e. 704/11*9=576). When the avisynth file is loaded, Media Player then says that the ratio is 11:9 @ 704x576.
So to summarise, I'm not really sure what my question is, and I really don't know what the answer is, but can anyone help?
Many thanks
Daodan
24th February 2006, 13:01
Welcome.
First of all, a short clip of the original would be good, otherwise we could be talking of different things.
Secod af all, from what you say you need to either do anamorphic encoding or resize to keep the original aspect ratio. And of course if you see interlacing artefacts you should get rid of them. From what you say itcould be soft telecine stuff since you don't see them in the original, so an IVTC may solve the problem.
But as I said, a sample is a must.
SeeMoreDigital
24th February 2006, 13:07
Hi, welcome to the forum.
May I ask.... How are you intending to view your MPEG-2 captures: -
Via your PC and PC screen.
Via a stand-alone player connected to a TV (after burning to DVD~R/RW).
Something else
By-the-way, when you played your "interlaced" captures in MediaPlayer Classic, did you try changing these options: -
http://img502.imageshack.us/img502/5915/mpcmpegdec8bf.png
Cheers
ob-Tom
25th February 2006, 11:59
Thanks for your replies guys. My Ultimate Grand Plan for these captures was to keep them on my PC, something along the following lines: Save each episode as mpeg2 stream, demux, trim ads, drop the avisynth script onto the DivX converter to get a pristine video, chortle happily to myself and then never watch the film clip again!
I was using Windows Media Player 10 which I don't think has the options you mentioned. I will have a look for this MediaPlayer Classic though.
I have uploaded a clip of 'The IT Crowd' (appropriate) at:
http://www.tobrien.dsl.pipex.com/clip
It is still about 7 megs which is hopefully not too big. The fire shows what I'm talking about nicely I think. This clip still looks good on my Windows Media Player, but as soon as it's in DGIndex, lines everywhere!
Thanks
SeeMoreDigital
25th February 2006, 13:10
The fire shows what I'm talking about nicely I think. This clip still looks good on my Windows Media Player, but as soon as it's in DGIndex, lines everywhere!The reason why DGIndex reveals "the lines" is because the MPEG-2 source is "interlaced"... In-fact all UK DVB broadcast sources are interlaced.
DGIndex has been specifically designed to visually highlight the differences between "interlaced" and "progressive" MPEG-2 sources, so you know what you're dealing with..... unlike many software media players which tend to display everything progressively!
Now that DGIndex has confirmed that the MPEG-2 source is "interlaced", this will help you determine how to deal with any future encoding choices you decide to make.
If your intension is to re-encode your "interlaced" MPEG-2 sources to MPEG-4 (DivX), you will obtain better visual results if you generate "interlaced" MPEG-4 encodes as opposed to progressive MPEG-4 encodes ;)
Anyway... I've probably confused the hell out of you now.... So you may need to read up on the differences between interlaced and progressive sources.
Cheers
W3ird_N3rd
25th February 2006, 19:29
I checked out your sample and it's pretty clear it's truly interlaced video (not just telecined, really interlaced).
Now you have to know the difference between interlaced and progressive. I assume you do, if you don't, check out http://www.100fps.com/. Now you have to know your PC display is *always* progressive (unless you're using a computer that's more than 10 years old *and* you messed up the settings :D ). The reason the interlaced material shows up just fine on your progressive display is because most MPEG2 decoding filters automagically deinterlace the material if it's interlaced. Examples are most (probably all) commercial DVD software players, Mediaplayer Classic's built-in MPEG2 decoder and nVidia's purevideo MPEG2 decoder. This is user-friendly ;).
However, when you go editting/re-encoding video, you don't want any weird filter activated without asking. That's why DGindex doesn't activate anything : if you want to deinterlace it, you can choose the filter that suits you best yourself.
Also, if you use FFDshow or VLC, you will see interlaced video. These decoders have deinterlace options but they must be manually activated.
About the aspect ratio. It's pretty clear this is an anamorphic picture. Standards only allow some given resolution for SD broadcasts, this resolution depends on where you live. In America it's usually NTSC, in Europe you'll find PAL. This resolution has an aspect ratio of 4:3 or, for weird technological reasons, something close to that. Nowadays a lot of material is shot in 16:9 because that fits the human vision better and probably because it's possible to create displays with that AR now (when TV was first introduced, and the standard was set, CRT tubes where almost round, far from 16:9!). The problem is, how do you fit 16:9 in a 4:3 picture.
There are 3 options. You can crop the picture so it fits fullscreen 4:3. This method sucks.
You can add black borders. If the first method isn't used, this is what is used for analog broadcasts. The black borders are empty, consume bandwidth and in fact lower the resolution.
Digital video (DVD and DVB) now allowed for a new option : forced AR. The video is squeezed in the 4:3 picture, and now all the people are very tall. But the good thing about this is that, compared to black borders, you don't waste any pixels. To correct the tall people, the AR is forced to be 16:9. No more square pixels.
For the forced AR almost the same applies as for the interlace : most decoding filters automagically read the forced AR and show the video right. You can watch the video with FFDshow to see it in it's original AR and see the tall people.
When you go edit/re-encode the video you want square pixels again, because you want to pick your own resize-method (Lanczos, pixel, bicubic whatever suits you best), or encode in another format with forced AR again.
I saw you want to encode the video into DivX format. Most MPEG4 based solutions don't support forced AR (or interlace), so you'll have to make some changes to the video.
To correct the interlacing, use a deinterlacing filter (no, really?).
To correct the forced AR, resize the video. It's up to you : you can scale up to 1024*576, keeping all the pixels but using more bandwidth. Or, what most people do, you can scale down to 704*396. You'll lose a few pixels so the image will have less detail, but it saves a lot of bandwidth. Lanczos is recommended.
If you don't want to you don't have to learn avisynth (if you don't know it already), for DivX/XviD you might as well drop the video in DGindex, demux audio, run the d2v through VFAPI and then work with the video (filters/compression) in Virtualdub(mod).
Hope this makes something clear :).
SeeMoreDigital
25th February 2006, 19:47
I saw you want to encode the video into DivX format. Most MPEG4 based solutions don't support forced AR (or interlace), so you'll have to make some changes to the video.
To correct the interlacing, use a deinterlacing filter (no, really?).I would recommend ob-Tom uses XviD's MPEG-4 codec, as it offers "anamorphic" signalling and interlaced encoding. Plus, it works really well ;)
To correct the forced AR, resize the video. It's up to you : you can scale up to 1024*576, keeping all the pixels but using more bandwidth. Or, what most people do, you can scale down to 704*396. You'll lose a few pixels so the image will have less detail, but it saves a lot of bandwidth. Lanczos is recommended.Personally, I would recommend you keep the exact same frame size (resolution) as the MPEG-2 source (ie: 704x576).... There's no real need to crop and/or resize anything.
Plus, XviD's MPEG-4 decoder filter offers automatic "anamorphic" signalling dectection (so you don't have to think of setting-up anything).... just like a good quality MPEG-2 decoder filter does!
Well there you go.... two replies to your enquiry, offering two different ways to go :D
Cheers
W3ird_N3rd
25th February 2006, 20:10
I would recommend ob-Tom uses XviD's MPEG-4 codec, as it offers "anamorphic" signalling and interlaced encoding. Plus, it works really well ;)
Of course, if there is a way to keep the interlaced/anamorphic image, that's probably the best thing you can do. Honestly I'm not familiar with the latest XviD versions, I know some time ago the forced AR was available but wouldn't work right (and I'm not so sure it will now on, for example, a standalone MPEG4 player). And interlacing didn't exist at all. I'm now pretty much switching to x264 which doesn't support interlacing at all. Interlaced video is a bit "unnatural" for digital video formats, I think (and I can understand.. with the displays we have today, there is no more reason to keep using interlaced formats). If ob-Tom only wants to watch on a PC (or, as he says, doesn't want to watch them at all :p), he might also consider x264, to save some bandwidth (or have better quality with the same bandwidth).
SeeMoreDigital
25th February 2006, 20:52
Of course, if there is a way to keep the interlaced/anamorphic image, that's probably the best thing you can do. Honestly I'm not familiar with the latest XviD versions, I know some time ago the forced AR was available but wouldn't work right (and I'm not so sure it will now on, for example, a standalone MPEG4 player). ).Thankfully most "branded" stand-alone players fitted with MediaTek's MT1389xx chip-set (http://forum.doom9.org/showthread.php?t=91616) support anamorphic signalling detection.
In fact both my Pioneer DV-575A (MediaTek MT1389xx chip-set) and Zensonic Z500 High-Definition Network DVD Player (Sigma EM8620L chip-set) support anamorphic signalling detection.
Cheers
ob-Tom
26th February 2006, 11:28
Thanks for all the help! My knowledge of interlacing and progressive film was definitely a little hazy but a visit too 100fps (excellent site) has cleared that up. I'm not too sure what place interlacing has in modern civilised society; maybe there should be a Campaign for Zero Interlacing or something.
Anyway, I've found that a simple call to 'FieldDeinterlace' (on Decomb) produces really nice results, and is presumably similar to what Windows Media Player et al do automagically. I also put in a resize (bilinear at the moment, but I'll have a play with Lancos) to get the proper resolution.
I think that I'll stick with AviSynth for the time being as I like to see the effect that each step has, plus you can then pipe the script into whatever you like really: Media player, DivX converter etc. Although it can be a bit time consuming to begin with I find that these other 'automatic tools', despite being written with the best intentions can be very confusing when something behaves differently to what you'd expect (at least for me anyway). I also tried using VirtualDub to encode to XVid to see if that automatically fixed interlacing but the result came out kind of blocky (an issue for another time and forum methinks). Still, I'm over the proverbial moon that the result from AviSynth looks so good.
Thanks again
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.