View Full Version : NTSC to PAL - how would you do it?
DarkT
10th May 2007, 01:58
Hi,
I want to convert the output of my Panasonic NV-GS500 into pal - since it's the NTSC model(if there's a pal model).
Why do I want to do it I am not so sure... I have two televisions, one is this old TV, but it has SECAM, PAL, NTSC, and whatever you want(a few types of SECAM/NTSC).
That is all well.
However on the other TV, something weird happens, my best bet is that it happens because I wrote the disc as NTSC(I used HC encoder).
The resolution my cam gives me is 720x480(1.5 3:2), and it's 29fps, BFF, interlaced.
So far what I did was use this script:
AviSource("dvio.avi").ConvertToYv12()
TComb(10,10)
DeGrainMedian(LimitY=1,LimitUV=2,Mode=4,norow=true,interlaced=true)
VagueDenoiser(threshold=0.7, method=3, nsteps=5, chromaT=2.0, interlaced=true)
interp = AssumeBFF().separatefields().SelectEven().eedi2(field=-1,pp=3, nt=55)
deint = TDeint(mode=0,Order=0,type=1,edeint=interp,AP=55,slow=2, denoise=true)
TFM(clip2=deint,order=0,Mode=3, pp=5)
Convolution3d ("movieHQ")
fft3dfilter(sigma=0.5, bt=5, bw=25, bh=25, ow=12, oh=12)
hqdn3d(ls=1.2,cs=1.4,lt=1.4,ct=1.2)
dctfun4b(1,2)
undot()
AA()
LimitedSharpenFaster(Smode=4, ss_x=1.25, ss_y=1.25, strength=210)
Tweak(cont=1.0, sat=1.4,bright=-1, hue=1)
That cleans it up and repairs the colors which for some reason I lose when I transffer the video from the camera to the computer (via firewire+some 40euro card for firewire I bought).
Anyway, I found the following two guides for said conversion:
http://forum.videohelp.com/viewtopic.php?t=209166
http://www.johnisme.shawbiz.ca/avi.shtml
But I wonder if somebody who actually has experience in said conversions could give me pointers/better methods/whatever before I go.
Also: Am I correct in wanting to do this? Or are modern dvd players doing said conversion on their own? If so, why did I get flickering/weird colors on the other TV?(which does indeed has a different dvd player)
Thanks, and sorry for the long post ;).
techreactor
10th May 2007, 05:51
I dont and will not do it and have/would buy a multi region/format player. Its more peaceful like this than getting an headache in the conversion process.
Blue_MiSfit
10th May 2007, 06:38
True. But, if you must convert, it's very possible and pretty easy with AviSynth.
:search: the forums and you will find dozens of threads.
Your AVS script looks pretty heavy, I have to say :)
~MiSfit
ChiDragon
10th May 2007, 06:42
Don't know much about conversion, but you shouldn't be using TFM on pure interlaced video!
DarkT
10th May 2007, 11:50
Don't know much about conversion, but you shouldn't be using TFM on pure interlaced video!
H0h0h0 - I remember hearing that somewhere, it flipped out of my head for some reason... Well, anyway, it's not like it's TFM-TFM, ya know? It uses Tdeint, which in turn uses EEDI2... So like... I think it's ok more or less, but yeah - good catch.
The script is prolly heavy coz' I'm pretty noobish, I find it hard using 1-2 filters to filter out stuff like I see sometimes pros do - I take a bunch and tweak them just a little bit - gives me the impression that I'm using the good effects of each filter... Silly me...
"the forums and you will find dozens of threads."
Infact I have, I did find one about Pal--->ntsc, but none the reverse... :(
MBoufleur
10th May 2007, 15:50
I too was looking for a solution (http://forum.doom9.org/showthread.php?p=1000860#post1000860) in the transcoding world...
My problem was a little bit different and I couldn't find a solution for it, but perhaps one of the things I discovered might do the trick for you...
In the Avisynth Wiki there is a section about Shared Functions with this nice example of SmoothDeinterlace (http://avisynth.org/mediawiki/Shared_functions/SmoothDeinterlaceFunctions).
As I was too dumb to get it to work (never really used an AVSI before), I later found out about the plugin for the same function.
You can get the latest version (1.5.5) in this page (http://www.guthspot.se/video/AVSPorts/SmoothDeinterlacer/), but since I had problems with it, I again discovered one posted by Wilbert (http://forum.doom9.org/showthread.php?p=705752#post705752) that worked for me (but wich unfortunatelly didn't solve my problem :( )
One more thing: Is the video you are using really 23.976fps with pulldown applied to create the 29.79fps interlaced or just plain NTSC interlaced content?
If it's the first case, you might want to use the Decomb filter to get the progressive frames and then speed up to achieve the 25fps for PAL (at least, that's what happens normally with film content in europe).
If it's pure interlace content, you might be luckier using the Smoothdeinterlace filter above.
DarkT
10th May 2007, 17:48
Sounds sweet man - thanks.
"Is the video you are using really 23.976fps with pulldown applied to create the 29.970fps interlaced or just plain NTSC interlaced content?"
Honest? I wouldn't know how to differentiate ;) - most of my knowledge comes from trying tons of different things and seeing what works best...
Anyway, I'll try it all out some time tommorow /me thinks.
Blue_MiSfit
10th May 2007, 18:25
The way to tell is to make a copy of your script, with just the source. No filters.
Open this script in VirtualDub, and seek to a point with some motion in it.
Step through the video one frame at a time, looking for interlace artifacts. If you see them consistently, that means it's pure interlaced. Deinterlace with something like TDeint, TomsMoComp, LeakKernelDeint etc... if you want to standards convert (NTSC to PAL for example), then a bob deinterlace is easier to work with. Tdeint(mode=1) is my personal favorite, some others are LeakKernelBob, MVBob, SecureBob etc... Bobbing will return 59.94p as opposed to "normal" deinterlacers, which will return 29.97p
If you see a pattern of fully progressive frames followed by some interlaced frames, then you need to field match and decimate, like tfm().tdecimate().
At any rate, once you've got the footage nice and progressive, you can apply a frame rate conversion. For FILM to PAL, just a speedup is easiest. AssumeFPS(25) should do it. For NTSC to PAL, you need to use a good frame rate converter like MVFlowFPS.
That's how you do it :)
~MiSfit
DarkT
10th May 2007, 18:41
Thanks a lot :) - from what I remember it's fully interlaced... Anyway, lots of good advice here - I'll be trying it all out...
Just one question though - why would I want to double my fps if I need it to become 25 anyway for it to be pal?
Here's something from what anotehr guy above you suggested:
function NTSC2PAL_DV(clip c)
{
c.SmoothDeinterlace(tff=false, doublerate=true)
BilinearResize(720, 576)
ConvertFPS(50)
SeparateFields()
SelectEvery(4, 0, 3)
}
This one also doubles the FPS, though I'm assuming the last two lines will be dealing with that... Hmmm, I wonder how the audio will be affected, well, besweet does have options for that, mhmhmhmhmhm, all so interesting, I'll need to run atleast like 10 different encodes - love it :).
Blue_MiSfit
10th May 2007, 19:07
Well here's the deal.. NTSC and PAL are usually interlaced, which means theres 59.94 / 50 pictures per second respectively.
If you were to just deinterlace NTSC to 29.97, and convert that to 25, you would lose half your motion. Bobbing to 59.94 and converting down to 50, then re-interlacing to 25 is the way to go.
ConvertFPS does a decent job, but MVTools does a much better job at the expense of speed.
Example: (Load MVTools.dll)
source=last
LanczosResize(720,576)
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
MVFlowFps(backward_vec, forward_vec, num=50, den=1, ml=100, idx=1) # get 50 fps
SeparateFields()
SelectEvery(4, 0, 3) #Interlace
foxyshadis
10th May 2007, 19:46
Step through the video one frame at a time, looking for interlace artifacts. If you see them consistently, that means it's pure interlaced. Or field-shifted, which is very common in PAL and somewhat common in NTSC home video. You should use SeparateFields() to differentiate these.
DarkT
10th May 2007, 21:03
It's ok - It's all interlaced... I mean, up untill now all I've been doing is anime encoding - and that is nothing like what this has... Here everything is interlaced... DEfinetly not pulldown thingy...
Anyway, the line
MVFlowFps(backward_vec, forward_vec, num=50, den=1, ml=100, idx=1) # get 50 fps
Throws out an access violation error... I tried everything I could think of(last one was using it with no parameters).
No good... And then I googled - and it seemed like other people had that problem too sometimes, something with either parameters in incorrect order, or unnamed parameters or something with resolution? Dunno... Well, I'll just keep on trying... Thanks guys.
Blue_MiSfit
10th May 2007, 21:18
I wish I had AviSynth installed here at work so I could help you out! :)
When I get home I will test the script.. I probably goofed it up somehow..
Maybe foxyshadis will swoop in to the rescue :D
~Misfit
DarkT
10th May 2007, 21:27
Maybe it's just my comp - I tell ya, I get the weirdest errors now and then ;) - OH GOD, that reminds me, I promised stickyboy to try and reconstruct the error I was getting due to his applyrange function, and I totally forgot about it! Goddamnit...
foxyshadis
10th May 2007, 23:13
What sort of access violation, exactly? Always reproducable in the same way, or more random after a few frames? What avisynth version? (Version() for that.) Multithreading? (Don't mix mt with mvtools for the time being.) Happens to all videos or only some? Can you upload a test sample+script that would cause it?
Sometimes it's avisynth, or a wayward plugin, sometimes it's the decoder (perhaps give directshowsource a shot in that case, or test another filter), sometimes it's the system overheating.
No magic fix, sadly, but it'd be nice to track down and fix any remaining bugs.
DarkT
10th May 2007, 23:51
I'm running it with Avsp - but it fails with megui just as well...
"What sort of access violation, exactly?"
'Evaluate: System Exception - access violation'
"Always reproducable in the same way, or more random after a few frames?"
Always same way, no frames play.
"What avisynth version?"
Avisynth 2.57 Build: Dec 31 2006
"Multithreading? (Don't mix mt with mvtools for the time being.)"
No to both, I belive.
"Happens to all videos or only some?"
Just a second, let me check - yup, also happens with anime stuff.
"Can you upload a test sample+script that would cause it?"
Can't upload sample, but that doesn't really matter since it happens with other video sources too, no?
Here's the script:
LoadPlugin("C:\Program Files\AviSynth 2.5\EXTRA\mvtools.dll")
avisource("[l33t-raws]Blood+_01_(640x480_LameVBR_wmv9).[1305B3CF].avi").converttoyv12()
source=last
LanczosResize(720,576)
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
MVFlowFps(backward_vec, forward_vec, num=50, den=1, ml=100, idx=1) # get 50 fps
SeparateFields()
SelectEvery(4, 0, 3) #Interlace
Mind you, I'm using the latest version of MVTools - by FIZICK, maybe that's the problem? I tried the one by "manao"(or a similiar name) - but those didn't have the neccesairy functions...
Edit:
Tried with DirectShowSource - no go, same error... I'm getting the feeling that the error is due to something very silly and noobish that somebody like msyelf might do...
ChiDragon
11th May 2007, 00:23
I'm not a big expert on MVTools (gotta preface just like my last post here :p), but you're applying your vectors to "last" instead of to "source". So you're using your vectors on "forward_vec". Also the LanczosResize isn't being used at all currently, and Blue_MiSfit seems to have forgotten to add Bob() in there before converting to 50 fps? It's going from 29.97 to 50 currently instead of 59.94 to 50.
How about:
#prepare for framerate conversion (29.97 fps -> 59.94 fps)
AviSource() #or whatever Source
Assume?FF() #need proper parity
Bob() #probably preferably a smart bobber instead
LanczosResize(720,576) #PAL DVD res
source=last
#motion-compensated framerate conversion (59.94 fps -> 50 fps)
backward_vec = source.MVAnalyse(isb = true, truemotion=true, pel=2, idx=1)
forward_vec = source.MVAnalyse(isb = false, truemotion=true, pel=2, idx=1)
source.MVFlowFps(backward_vec, forward_vec, num=50, den=1, ml=100, idx=1)
#interlace (50 fps -> 25 fps)
Assume?FF() #need proper parity again as Bob() destroys it
SeparateFields()
SelectEvery(4, 0, 3)
The "?" is a placeholder for T or B depending on the actual parity of your vid (check it with just Bob().Assume?FF() - motion will only be smooth with one of them).
DarkT
11th May 2007, 02:38
ChiDragon, thanks - that one did work... Though it's shaky... Not the 3 steps forward 1 step backward shaky you'd get from choosing the wrong BFF/TFF - just... Shaky... I dunno... I suppose I'll have to post a sample or something... Or is the shakyness something which just happens due to the whole proccess? Hmmmmm
Mug Funky
12th May 2007, 06:19
that might be from the bobbing. replace "bob" with yadif or leakkernelbob, or for more quality and less speed, tdeint or one of the tdeint + eedi or motion-compensated flavours.
search will find them for you :)
also, mvtools for framerate conversion usually needs some kind of artefact protection in case movements get too complex. i'd look for the "alchemist" thread for some possible solutions.
btw, i'm not familiar with panasonic camera model numbers, but i know some will do 24fps progressive scan in DV, giving you a pattern of 4 progressive to 1 interlaced. if your camera does this, it might be advantageous to use this mode - converting that to PAL is a matter of dropping the interlaced frame in each cycle, then resizing to 576 and speeding up to 25fps (along with the audio).
Blue_MiSfit
12th May 2007, 08:04
That would be the AG-DVX100/DVX100A :)
Sweet camera.
DarkT
12th May 2007, 15:24
Nah, my cam doesn't do that :), I do keep asking myself why I bought NTSC and not PAL... I knew I'd need to convert to PAL, my only answer is that unconciously I'm some sort of encoding-masochist... I can't think of any other explanation...
Anyway, thanks for all of the replies - I'm more or less on my way to making something normal I think...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.