View Full Version : PAL TV - To Deinterlace, or not?
Monkeylord
7th September 2012, 15:49
I'm nearing the point in my DVD backup quest when I turn my head towards my DVD's of TV series... more specifically my old PAL TV series.
I'm in the UK, so these are all PAL shows in PAL format.
Almost all my old shows (Red Dwarf, Bottom, The Young Ones, etc) were shot on video and so the DVD's are pure interlaced. If I BOB them I get a 50fps video stream with movement on every frame.
The way I see it, I have 3 options:
1. BOB them and encode at 50fps
2. BOB then decimate (or blend) back to 25fps
3. Encode at 25fps interlaced
With option 1, the filesize ends up huge as it's essentially the same as 2 episodes in one file. With option 2 I lose half the motion, which to me looks really "off" upon playback, especially after all these years of seeing these shows with their full range of motion. Even blending the frames doesn't look right.
I was toying with the idea of option 3, but I'm using the WME command line interface, and every time I get some kind of error which closes the encoding window almost instantly.
Has anyone managed to successfully encode an interlaced WMV using the command line?
I've made sure all my settings are correct, so it can only be the input.
The command line wouldn't accept either a fragment of a VOB or a demuxed M2V.
Currently I've been processing AVI's that I've created using avisynth/Vdub and encoding to Lagarith, but they've all been from my R1 DVD's and deinterlaced. My tests with PAL last night were unsuccessful.
I understand that AVI's don't have any interlacing flags, so when I process a VOB and spit out an AVI I imagine WME doesn't recognise it as interlaced and so doesn't progress.
Can anyone advise please?
I'll provide samples and any script details I can once I get home from work.
mvBarracuda
11th September 2012, 09:44
Any reason why you would prefer to archive your DVDs in ASF containers, using WMV/WMA codecs? Do you want to watch the videos on your xbox?
You'll get great quality using qtgmc for deinterlacing and you won't lose any motion information if you use qtgmc's framerate doubling option. If you encode the video with x264, you should get the best quality/size ratio by using --crf encoding mode.
Monkeylord
5th October 2012, 14:51
Any reason why you would prefer to archive your DVDs in ASF containers, using WMV/WMA codecs? Do you want to watch the videos on your xbox?
You'll get great quality using qtgmc for deinterlacing and you won't lose any motion information if you use qtgmc's framerate doubling option. If you encode the video with x264, you should get the best quality/size ratio by using --crf encoding mode.
Sorry I've taken so long to reply.
Yes, they're for playback on Xbox. I have 2, one in the living room and one in the bedroom. The reason for WMV is because losing 5.1 audio is too high a price.
If I can send an X264 with 5.1 through the Media centre extender on the Xbox, I may grin and bare it (not a fan of the extender though - controls are too limiting). I shall have to make one and test it.
Goethe
5th October 2012, 21:22
Have you tryed the original mpeg2-video and ac3-audio in a mpeg or vob-container?
Maybe it works.
Monkeylord
6th October 2012, 13:41
Have you tryed the original mpeg2-video and ac3-audio in a mpeg or vob-container?
Maybe it works.
That will only play through the Xbox in the Media Centre extender, and I don't really want 1GB+ sized files per 30min episode.
burfadel
6th October 2012, 22:54
PAL is 25 frame per second, consisting of 50 fields (interlaced). If you BOB it, you aren't getting 50 frames of motion, it is still the original 25 FPS and everything else is artificially created. To be honest none of the options you listed are worthwhile, you need to go to option 4. 'Option 4' truly is the only real solution for encoding PAL interlaced material, so really should be option 1 :). Option 4 is to deinterlace it and have it at 25FPS. There are different methods for deinterlacing, but YADIF is probably the most suitable.
With NTSC material (29.976 FPS), you don't want to use a simple deinterlacer (common mistake), you need to inverse telecine it first (which also deinterlaces it), then remove the duplicate frames. You then end up with 23.976 FPS. 23.976 is pretty much the 'standard' TV format. For NTSC material you can telecine it (telecining sucks for motion), and for PAL it can be sped up to 25FPS without people noticing. This is why you may see a video as 100 mins (US) or 96 mins (UK). The UK version is exactly the same, just slightly sped up! This is also true for TV shows in general. This way they can be returned to 23.976 and converted to the US framerate.
In most cases anything that is 50FPS is a fake 50FPS, the cases where it isn't are so rare you would never have actually seen the 50FPS verisons.
But in any case, deinterlacing is what you want to do. Motion isn't an issue, if it is something is wrong! Especially for shows like Red Dwarf (how do you like the new Season 10 so far?), Bottom etc.
Guest
7th October 2012, 11:38
To be honest none of the options you listed are worthwhile, you need to go to option 4. ...deinterlace it and have it at 25FPS. That is effectively the same as his option 2 (with decimation), as long as he uses a good quality bobber. And he has stated that he doesn't want to lose half the motion information.
Goethe
7th October 2012, 13:23
I understand that AVI's don't have any interlacing flags, so when I process a VOB and spit out an AVI I imagine WME doesn't recognise it as interlaced and so doesn't progress.
Yes, but the codecs have flags for that, but I don't know if it is read by the decoder.
The best thing is, like the other said, try AVIs with different deinterlacers and use what you like most. I sometimes even like a simple lineare blending deinterlacer best. Or you find out you don't like that at all and then you have too use the extra space for the 50fps.
benwaggoner
9th October 2012, 17:25
PAL is 25 frame per second, consisting of 50 fields (interlaced). If you BOB it, you aren't getting 50 frames of motion, it is still the original 25 FPS and everything else is artificially created.
Untrue. If the content was shot interlaced, there are 50 unique images a second, and encoding as interlaced or bobbing to 50p is the only way to preserve all that motion. A decimation throws out half the temporal samples.
Zambelli and I did some tests a few years back with VC-1, and determined that encoding interlaced was at least 20% more efficient than encoding bobbed with the extra frames, so if you're worried about file size, I'd go that route. WMP on Win 7+ does a really good real-time bob on playback for standard-def content.
If you're using the WME command-line tool, you'll definitely want to tweak some reg keys using Zambelli's WMV PowerToy.
http://www.citizeninsomniac.com/WMV/
Here's a basic config for decent interlaced encoding:
http://forum.doom9.org/attachment.php?attachmentid=13012&stc=1&d=1349799382
Note you have to use Advanced Profile for interlaced.
Beyond those basic "best practices" settings, for interlaced-from-broadcast style sources, you could also look at tweaking:
Noise Edge Removal: tries to blank out any noise at the edge, but better that you just crop!
Motion Search Level: Chroma values are slower, but higher quality
Video type: If there aren't any or many truly progressive frames in your source, you can set it to just Field/Frame for faster encoding.
A little denoise can help with noisy sources. But better to use a good external algorithm; this one isn't as good as the VC-1 Encoder SDK denoiser.
If encoding is too slow, you can generally get away with using Complexity 3 instead of the default Complexity 4 when using Format SDK 11 or higher (which you have if you've got WMP 11 or higher).
Note Windows 7 encodes VC-1 about 30% faster and will use up to 8-way threading on 720x576 sources, compared to the Vista and XP implementation.
Feel free to share your command line if you're still having trouble with it after applying the above.
I really wish Expression Encoder supported interlaced. There's probably a way to force it by editing the .xej file, but I don't know it offhand.
Monkeylord
12th October 2012, 13:14
*huge and amazingly useful post*
Wow, thanks for going to the effort of explaing all that. I'm sure it'll be very useful. I'll give it a bash once I get home tonight! I've not even thought about using the powertool yet, as I tought I'd applied all the required settings through my command line script.
In the mean time, here's (one of) the command line I've been using:
csscrpit.exe "C:\Program Files\Windows Media Components\Encoder\WMCmd.vbs" -input E:\ -output C:\Temp\Encoded
-a_codec WMAPRO -a_mode 2 -a_setting Q90_44_2 -v_codec WVC1 -v_mode 2 -v_keydist -v_preproc 17 2 -v_quality 85
-v_complexity 4 -v_profile ap -pixelratio 12 11 -v_loopfilter 1 -v_overlap 1 -v_mslevel 2 -v_msrange 0 -v_mmatch 2
-v_bframedist 7 -v_lookahead 16 - v_type 0
I set up a batch file that worked well with my anime rips, and then made several copies and tweaked them to apply to different video input types (widescreen, fullframe), and different audio inputs (stereo, 5.1) and then regions (PAL, NTSC) and then all variations thereof, so I have 8 different batch files all running the same basic settings just tweaked for combos of inputs. One for PAL Widescreen Stereo, one for PAL widescreen 5.1, and so on. I simply copied these and added the extra -v_preproc entry to account for interlaced content. This brings my batch count up to 16, lol. Overkill, I know but it works for me.
After that I just adjust the -v_quality setting on a case by case basis.
As an additional, how should I format the source to get interlaced encoding working? I use quality based encoding because whenever I do anything involving more than one pass I just get audio with a green screen, but whenever I try to encode using the interlace preprocessing option the dialogue box opens and closes instantly (so I never catch any error messages if they pop up).
Currently for my source I set up all my pre-processing through avisynth and encode to a lossless (Lagarith) AVI through Virtualdub. I don't think Lagarith accounts for interlaced content, and even if it does, the AVI container doesn't.
I know the command line apparently accepts avisynth scripts as a source, but I've never managed to get it to. Anything other than avi's in RGB just cause the DOS window to close.
I'd just like to say again how much I appreciated the advice given so far.
Monkeylord
18th October 2012, 12:56
I noticed my amateur error by not changing the last entry on my script "- v_type 0", which tells the WMV encoder to output a progressive video rather than an interlaced one.
So, I finally managed to get an interlaced WMV produced. HUZZAH! Unfortunately, I still have a problems...
What is the difference between "Frame based" and "Field Based" interlacing? (apart from "field based" taking about much, much, MUCH longer to encode).
Either way, I may have to knock the whole idea on the head as the interlaced videos I produced played fine on my PC, but on the Xbox (the whole point of using WMV in the first place) it plays with interlacing. I tried both the dashboard and the Media Centre Extender, and got the same results - smooth playback but with interlacing artifacts throughout.
Looks like I may have to go back to using x264 and downmixing 5.1 to DPLII. Thing there is, the interlaced x264 files only play properly in the Media Centre Extender, albeit only in either 16:9 or 4:3, so anything I do in other aspects are stretched (14:9 content is stretched to 16:9). In the dashboard it drops frames!!!
Sometimes I feel like giving up!
benwaggoner
18th October 2012, 18:19
Huh. I am pretty darn sure I've been able to get interlaced WMV to correctly deinterlace on playback on the Xbox 360.
Field versus Frame is pretty similar to the same feature in MPEG-2. Generally Frame is slightly more compatible with hardware decoders (which don't apply in your case), and apparently faster as well. I wouldn't have expected a huge difference unless you were picking field/frame adaptive or something, which tries each frame both ways to pick the more efficient.
What version of WMP do you have installed on your PC? And when you are playing back, are you getting a nice adaptive bob at 50p? That's what should happen on Vista/7, but I'm not sure what the XP experience would be.
You have some other things in your script that aren't optimal:
You don't have a -v_keydist specified. No reason to use the parameter unless you want to change from default of 10 seconds (which is on the long side)
-v_complexity could be 3 if you want to speed things up some. That is generally the quality/speed sweet spot in the WMFSDK 11 implementation which I gather you're using.
-v_mmatch 0 is, someone non-intuitively, faster and slightly higher quality on average than 2. The why is up for debate, but this was empirically determined by double-blind testing.
-v_bframedist 7 is CRAZY for this VC-1 implementation. It's not a max like in x264, but the default, so you'll be getting IBBBBBBBP most of the time! use 1, which is almost always the optimum value in VC-1. Fixing that will reduce your bitrate and could help some playback issues.
For -v_type, I like 4. It'll be somewhat slower, but there are other places you can pick up some speed above. It'll let truly progressive frames get coded as progressive, and thus won't get the quality hit of a deinterlacing filter on playback.
I'd use -v_edgeremoval if you're not cropping blanking out of your sources.
-v_dquantoption 2 generally improves quality with the Windows VC-1 implementation. (although it might not be compatible with -v_mode 2 in Windows)
-v_adz 1 generally improves quality/efficiency as well.
your _a_setting is just stereo, I note. I assume you use a *_6 setting with 5.1 sources?
Monkeylord
18th October 2012, 19:43
Huh. I am pretty darn sure I've been able to get interlaced WMV to correctly deinterlace on playback on the Xbox 360.
Field versus Frame is pretty similar to the same feature in MPEG-2. Generally Frame is slightly more compatible with hardware decoders (which don't apply in your case), and apparently faster as well. I wouldn't have expected a huge difference unless you were picking field/frame adaptive or something, which tries each frame both ways to pick the more efficient.
What version of WMP do you have installed on your PC? And when you are playing back, are you getting a nice adaptive bob at 50p? That's what should happen on Vista/7, but I'm not sure what the XP experience would be.
You have some other things in your script that aren't optimal:
You don't have a -v_keydist specified. No reason to use the parameter unless you want to change from default of 10 seconds (which is on the long side)
-v_complexity could be 3 if you want to speed things up some. That is generally the quality/speed sweet spot in the WMFSDK 11 implementation which I gather you're using.
-v_mmatch 0 is, someone non-intuitively, faster and slightly higher quality on average than 2. The why is up for debate, but this was empirically determined by double-blind testing.
-v_bframedist 7 is CRAZY for this VC-1 implementation. It's not a max like in x264, but the default, so you'll be getting IBBBBBBBP most of the time! use 1, which is almost always the optimum value in VC-1. Fixing that will reduce your bitrate and could help some playback issues.
For -v_type, I like 4. It'll be somewhat slower, but there are other places you can pick up some speed above. It'll let truly progressive frames get coded as progressive, and thus won't get the quality hit of a deinterlacing filter on playback.
I'd use -v_edgeremoval if you're not cropping blanking out of your sources.
-v_dquantoption 2 generally improves quality with the Windows VC-1 implementation. (although it might not be compatible with -v_mode 2 in Windows)
-v_adz 1 generally improves quality/efficiency as well.
your _a_setting is just stereo, I note. I assume you use a *_6 setting with 5.1 sources?
I'm using Win 7, and playback on there (tried WMC, WMP and MPC) seems flawless to me. It was just on the 360. I was thinking it may be because I cropped the originals (most PAL TV, especially older stuff, have big borders added). I was musing over if the cropping may be confusing the decoder on playback as it upscales the file to fill the screen.
I realised earlier that the 7 Bframes was still in there. Like I said, I used settings that seemed to work well with previous animated sources and just adjusted it. Must have missed that one. I shall adjust accordingly. Is it recommended to do the same for my animated stuff? (may as well try, eh!).
I'll give your suggested adjustments a try tonight and will report back again, and yes, I have a separate version for 5.1 sources.
Thanks for giving me a bit more hope :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.