View Full Version : Help using AVISynth with PAL to NTSC conversion
alanisrox69
14th April 2005, 20:34
Hi all,
I have a quick question, I'm converting a PAL dvd to NTSC dvd, I frameserved it using DVD2AVI, got my AVS file setup (I'm going to use CCE for the encoding), but here's the problem, the source video has a resolution of 768x576, how would I resize that keeping the aspect ratio to 720x480? It seems everything I tried stretched the picture out a little, your help is greatly appreciated, I'll buy you a beer! Thanks sooo much.
Here's what my AVS file looks like right now:
LoadPlugin("C:\Program Files\AviSynth2\plugins\MPEG2Dec3.dll")
mpeg2source("C:\PHILIPS_DVD_VR\VIDEO_TS\test.d2v")
ConvertToYUY2()
Bob()
BilinearResize(768, 576, 0, 0, 720, 480)
ConvertFPS(59.94)
SelectEvery(4,1,2)
Weave()
If you see anything wrong in there please let me know! Thanks sooo much.
-Derek-
alanisrox69
14th April 2005, 20:39
Oh yeah, I should mention, it stretched the picture out vertically not horizontally
Thanks in advace for your help guys!
-Derek-
alanisrox69
15th April 2005, 01:38
Please anyone???
Guest
15th April 2005, 05:26
You can't even wait 6 hours?!
alanisrox69
15th April 2005, 05:35
Originally posted by neuron2
You can't even wait 6 hours?!
I know I'm new, and the forum was moving fast (thread was down near the bottom), and had like 20+ views, just trying to get help!
I'm sure it's something so simple too.
-Derek-
Mug Funky
15th April 2005, 06:47
dude, if your sourceis 768x576, then it's out of spec for DVD.
DVD is only 4:3 or 16:9 - all other aspect rations require adding black bars somewhere or other.
so all you need do is resize to 720x576 and set the aspect flag to whatever the source was set to.
i'd suggest using a motion-adaptive bob for standards conversion - try LeakKernelBob (search :)), and have the threshold at around 4. also, use a better resizer than bilinear - with 480 lines, you'll want all the resolution you can get.
try:
LoadPlugin("C:\Program Files\AviSynth2\plugins\MPEG2Dec3.dll")
mpeg2source("C:\PHILIPS_DVD_VR\VIDEO_TS\test.d2v")
ConvertToYUY2(interlaced=true)
LeakKernelBob()
lanczosresize(720,480)
ConvertFPS(59.94)
separatefields()
SelectEvery(4,1,2)
Weave()
you'll want to check the field-order after this to make sure it's all good. (should be top field first for DVD, even though it'll handle both, it's good to keep to the norm).
alanisrox69
15th April 2005, 07:10
Originally posted by Mug Funky
dude, if your sourceis 768x576, then it's out of spec for DVD.
See that's my problem. However it's actually in spec for Philips standalone DVD recorders (PAL versions), strange I know! That's why it got me stumped! It took some investigative googling to find that out!
I will try what you suggested, but after some time playing around, I decided to swap the resize ratios and play with the numbers a bit and it worked! and yes I figred out that Lanczos is better than bilinear after I posted hehe.
So here's what my AVS file looks like now, it's still converting in CCE, I will do both, your way and the way I discovered and compare them:
LoadPlugin("C:\Program Files\AviSynth2\plugins\MPEG2Dec3.dll")
mpeg2source("C:\PHILIPS_DVD_VR\VIDEO_TS\test.d2v")
ConvertToYUY2()
Bob()
LanczosResize(720, 480, 0, 0, 720, 520)
ConvertFPS(59.94)
SelectEvery(4,1,2)
Weave()
it did crop a tiny bit on top and bottom, but nothing major, if anything it helped, since there was a color bar on the bottom (from VHS tape), and a slight curve at the top (I assume from VHS tracking problems?) and just filled in black bars.
Thanks for your help!
-Derek-
Mug Funky
15th April 2005, 09:37
you really shouldn't use a non-adaptive bob though. when you do standards conversion, it means top fields are getting mixed with bottom fields, causing a sort of phasing vertical wobbling in static areas. you'll notice it on the PC, but i'm not sure if it'll manifest as anything but a slight blur on a TV.
anyway, it's best to use a motion-adaptive deinterlacer for converting PAL to NTSC / NTSC to PAL. for something that'll be (probably) no slower than regular bob(), try LeakKernelBob. it'll make a basic decision between moving and non-moving areas, and pass the non-moving through untouched, and use a kernel based deinterlace on the moving bits. this gives you a lot more vertical resolution (which you'll need on an NTSC TV).
using kernelbob + lanczos will not only mimic the $10,000 standards converters out there, it will actually beat them. just make sure the thresholds are set right (there's an art to that... but don't wory, as i'm toying with the idea of determining the threshold per-frame depending on the picture's noise level. not sure how to do this just yet, but i have an inkling).
Boulder
15th April 2005, 11:49
Also, do the bobbing right after loading the source, before any colorspace conversion.
And before you enter the ocean called "interlaced processing", make sure you actually have truly interlaced material;)
Mug Funky
15th April 2005, 15:24
good point there, boulder!
if you've got progressive content (there's not really any telecine when we're talking PAL, but there's the very very rare field-shift), you can either not bob, and just convertfps(59.94) and interlace, or you can:
assumefps(23.976,true)
changefps(59.94)
separatefields().selectevery(4,1,2).weave()
SSRC(48000)
or you can:
changefps(59.94)
separatefields().selectevery(4,1,2).weave()
or you can simply encode to 720x480 @ 25fps and use DGpulldown to make the stream into a (nearly) 3:2 pulled-down mpeg2 file.
the first solution slows the film down (probably to the original speed), but at the cost of having to transcode a lossy audio source (lossy to lossy audio transcoding is evil and should only be done when there's no other possible option), the second solution does the same as the third but inside avisynth.
i'd go with the third solution, if and only if you have progressive material. otherwise use the kernelbob-convertfps method.
there's also extremely slow but potentially stunningly good methods of conversion that involve motion compensation, and actually reconstructing frames at a different frame rate. look for "MVbob". this method is pretty risky though, and if you're going to DVD, field-blending wont kill you like it would if your destination media was low-bitrate 1CD backups.
scharfis_brain
15th April 2005, 15:28
Sidenote:
resizing 768 to 720 is wrong.
resize to 704 instead.
alanisrox69
16th April 2005, 00:21
Originally posted by scharfis_brain
Sidenote:
resizing 768 to 720 is wrong.
resize to 704 instead.
but I'm converting to NTSC, isn't 704 PAL?
I think the problem lies within that weird Aspect Ratio 768x576. I'm re-encoding using Mug Funky's method, will post results later on.
-Derek-
scharfis_brain
16th April 2005, 07:55
allowed resolutions for DVD authoring are:
720x576 704x576 352x576 PAL
720x480 704x480 352x480 NTSC
trust me. resizing to 704 pixels is correct.
(or read the ITU-specs regarding Aspect Ratio)
EDIT: corrected Copy'n'Paste mistake, thanks to Boulder
Boulder
16th April 2005, 09:12
720x480 704x480 352x480 for NTSC, a small typo there;)
Mug Funky
17th April 2005, 08:58
hmm.. forgot about the 704x thing.
if you want guaranteed DVD compatibility, you'll have to stick with 720 (just addborders(8,0,8,0) on the 704 stuff) because loads of DVD players will mess up subpictures on anything but 720. this means menus and subtitles could be out of whack in unpredictible ways.
this is why you'll almost never see 352*xxx res on DVDs (that, and not many people know that anything but 720 is supported, though it's obvious at many stages in the production process that other sizes are supported).
704 is good for satellite/cable transmission though :)
Kika
17th April 2005, 15:18
A couple of my DVDs do include 704 or 352 - two of them with subtitles. OK, Hongkong-Stuff, but this does not matter, doesn't it?
For my own encodings i always use 704 letterboxed to 720, that's a very safe way.
scharfis_brain
17th April 2005, 15:37
if you want guaranteed DVD compatibility, you'll have to stick with 720 (just addborders(8,0,8,0) on the 704 stuff) because loads of DVD players will mess up subpictures on anything but 720. this means menus and subtitles could be out of whack in unpredictible ways.
how did you came to this conclusion?
lowering the size of the video from 720 to 704/352 and then putting it together with the original subpicture on DVD?
For sure. This cannot work properly, because the size of the subpicture hasn't been altered too.
PS: I am a DVD-N00b, just assumptions here
Kika
18th April 2005, 09:13
There are some dumb players out. If you feed them with any other resolution than 720, they will scale the subtitles too. So, on 352 or 704 videos, the subtitles are stretched.
This is not a DVD problem, it's a bug in the players.
Mug Funky
18th April 2005, 12:25
yes, kika hit the nail on the head. i think the DVD specs are unclear as to how to handle subpics with different resolution (or the same resolution!) video.
i know it's been tried, and more than a few players had problems (not just the cheap ones - i think the pioneer players have problems with this, but that may be something else they had problems with and my memory isn't serving me).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.