View Full Version : PAL To NTSC Conversion using AviSynth?
castellandw
2nd October 2005, 07:03
I've been searching the forum over various posts on various ways to use Avisynth for PAL to NTSC conversion, various deinterlacers have been recommended as well as different ways to how the script the conversion. The script I've used is this:
LoadPlugin("DGDecode.dll")
LoadPlugin("SmoothDeinterlacer.dll")
MPEG2Source("test.d2v", ipp=true)
ConverttoYUY2(interlaced=true)
SmoothDeinterlace(tff=true, doublerate=true)
Lanczos4Resize(720,480)
AssumeTFF()
ConvertFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
I recently talked to a bunch of decent video restoration engineers online (If you can figure out the word VIDFIRE, give yourself a pat on the back for knowing which video restoration engineers I'm talking about) who said that expensive standards converter hardware which they use for broadcast standards conversion uses a technique called phase-correlated motion compensation which helps deinterlace with real-time motion estimation for standards conversion.
Anyway, any recommendations for better deinterlacers as well as other ways to change my AviSynth script for PAL to NTSC conversion to get the most decent results?
I don't care how slow the method is. If it's brings decent results in the end that's fine enough and what matters to me. I heard on past posts in these forums that motion compensation is the best way to deinterlace for PAL standards conversion, but I like to know what you guys know now (any updates on conversions methods that you know now that you weren't aware of in the past for example).
foxyshadis
2nd October 2005, 10:16
I remember that scharif's brain posted a mocomp script, that was excruciatingly slow. I'll get that link. Hmm, apparently it's a current thread, I must be getting addled. :p
http://forum.doom9.org/showthread.php?p=718529#post718529
RestoreFPS should be able to handle the PAL phase changes when necessary, and undo any blending present in the clip as well.
I also remember Mug Funky saying he knew of those machines but they are $$$$$, even for a business. =p
castellandw
2nd October 2005, 14:08
Well, those video restoration engineers I was talking about mentioned that they didn't buy those standards converters boxes. They actually pay a per-hour charge to rent a facility to use the standards converter box.
If you guys are able to compare how close in results are any of the existing deinterlacing plugins built for AviSynth to the Phase Correlated Motion Compensation that I mentioned used in the latest standards converter boxes, that would be a plus. Here's a link I was given to a PDF file on a Guide To Motion Compensation:
http://www.snellwilcox.com/knowledgecenter/books/books/emotion.pdf
I forgot to mention, the main intent of my AviSynth script is to convert from PAL 25 interlaced fps to NTSC 29 interlaced fps. So, basically I'm only interested in converting between a purely interlaced video in PAL to NTSC interlaced video in the end. Nothing about converting from or to sort of film footage, progressive footage, telecine footage, pulldown footage, etc..
MuttLover
3rd October 2005, 14:23
I'm not an expert by any means, but I have used the following PAL interlaced to NTSC interlaced script many times with good success.
----------
loadplugin("C:\Program Files\AviSynth 2.5\plugins\dgdecode.dll")
loadplugin("C:\Program Files\AviSynth 2.5\plugins\leakkerneldeint.dll")
MPEG2Source("C:\images\pc2\project\pc2.d2v")
LeakKernelDeint(order=1, threshold=10, sharp=true, twoway=false, map=false, linked=false, debug=false)
LanczosResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SeparateFields()
#SelectEvery(4,1,2)
SelectEvery(4,0,3)
Weave()
ConvertToYUY2(interlaced=true)
castellandw
3rd October 2005, 15:26
I 've noticed various messages in this forum in the past using SelectEvery(4,0,3) for converting to PAL and sometimes use SelectEvery(4,0,3) for some AviSynth scripts converting to NTSC. Which select SelectEvery command is accurate, SelectEvery(4,1,2) or SelectEvery(4,0,3)?
Also, what's the better resize filter for this because your script used Lanczos and I used Lanczos4? Is it Bilinear, Bicubic, Lanczos, or I'm using now Lanczos4?
One more thing, I heard ConvertFPS is the better deal while ChangeFPS just adds and drops frames. So which is better there, ConvertFPS or ChangeFPS?
midnightsun
3rd October 2005, 16:47
(4,0,3) if top field first, (4,1,2) if bottom field first.
But it's not a matter of converting pal to ntsc or viceversa. It just serves the purpose of getting rid of the additional fields created in the bobbing process.
castellandw
3rd October 2005, 17:00
According to the help file on LeakKernelDeint, if you leave the threshold=0, you get artifact free results. Which is actually the better deal for LeakKernelDeint, threshold=0 or threshold=10 based on anyone's experience with it?
Leak
3rd October 2005, 17:23
According to the help file on LeakKernelDeint, if you leave the threshold=0, you get artifact free results. Which is actually the better deal for LeakKernelDeint, threshold=0 or threshold=10 based on anyone's experience with it?
Well, if you really use threshold=0 you practically throw out a field, so you'll get a noticeable vertical resolution decrease on the static parts - I'd really use a threshold of 3 or something at the minimum...
(Although I must say using KernelBob(!) for video material with a threshold of 0 looks quite good, if your PC can keep up and if the display's refresh rate matches the (bobbed) frame rate... :))
np: Eric B. & Rakim - Just A Beat (Follow The Leader (Expanded))
castellandw
3rd October 2005, 17:54
Does the display's refresh frame rate as well as the CPU have to keep up with the bobbed frame rate in order for kernelbob to give the expected results(if you mean just displaying video directly from the Avisynth script, then I can understand, but I'm talking about after encoding the video to MPEG-2 with the AviSynth script? I thought regardless of speed, the results would be the same encoding with MPEG-2 using the AviSynth script.
By the way, should I be using LeakKernelBob or LeakKernelDeint because as I said before, I want to preserve the interlaced fields?
Mug Funky
4th October 2005, 05:19
kernelbob will keep the full field-rate.
as for conversion methods in avisynth, we use block-matched motion compensation (mvtools is almost an ME engine for a codec), so it's not as optimal as overlapped-block MC with ME done using phase corellation (the DePan plugin uses phase corellation IIRC, but on the full frame. it is theoretically possible to combine MVtools and DePan to do exactly what the Alchemist does, but not yet. we need overlapped block ME and MC, and a few other little tricks).
i'm not surprised video monkeys would hire an alchemist rather than buying one. they're prohibitively expensive (i've never even seen one much less used one). however, there comes a point where buying one becomes cheaper than hiring one.
Leak
4th October 2005, 07:31
Does the display's refresh frame rate as well as the CPU have to keep up with the bobbed frame rate in order for kernelbob to give the expected results?
Well, I was talking about using the KernelBob deinterlacer in ffdshow, which happens to use my LeakKernelBob code - dropped frames will stand out like a sore thumb, but if you manage to keep it running in realtime it looks rather smooth with a threshold of 0, even though each displayed frame has reduced vertical resolution.
It's hard to describe, and of course I can't post a screenshot - you'll have to try it yourself... :)
castellandw
4th October 2005, 19:59
Do you mean my final interlaced mpeg-2 dvd encoded video file will have dropped frames, meaning no jerky motion or any sort of huge artifacts whatsoever, if I don't run the KernelBob deinterlacer in realtime compared to running the avisynth script with kernelbob for mpeg-2 encoding at a slower timespan?
Leak
4th October 2005, 23:16
Do you mean my final interlaced mpeg-2 dvd encoded video file will have dropped frames, meaning no jerky motion or any sort of huge artifacts whatsoever, if I don't run the KernelBob deinterlacer in realtime compared to running the avisynth script with kernelbob for mpeg-2 encoding at a slower timespan?
Argh.
I wasn't talking about encoding *AT ALL*.
I was talking about taking any DVD or what-have-you with telecined or video material and make it actually watchable on a PC - take the DVD, pop it in your drive, launch Media Player Classic or some other DVD playing application, set up ffdshow to deinterlace the video using KernelBob and just plain watch it.
Also, why would anyone use ffdshow's deinterlacers when encoding when there's AviSynth, which is much more powerful? :confused:
np: Yoko Kanno - Siberian Doll House (Ghost In The Shell Stand Alone Complex OST 1)
Mug Funky
5th October 2005, 01:57
i wouldn't recommend threshold 0 for standards conversion - it'll cause vertical "wobbling". low thresholds are fine (1-4 are good), but 0 means static horizontal lines will get deinterlaced, and fields will be mixed together resulting in lines moving up and down between 0 and 1/2 pixels - not too noticable on a TV, but still best to avoid.
but a high threshold is also a problem for standards-conversion because combs that get through will turn into blurred fields, giving a flickering wave pattern in subtle areas (this is very noticable even on a crappy TV).
i use a max threshold of 4, and a min of 1 depending on how tricky the video is (subtle fades are hell to deal with...).
also, threshold=0 is a fair bit slower as more is being done.
castellandw
5th October 2005, 12:40
Argh.
Also, why would anyone use ffdshow's deinterlacers when encoding when there's AviSynth, which is much more powerful? :confused:
Leak, I don't know where you got the idea that ffdshow deinterlacers were being used for MPEG-2 encoding, but doesn't avisynth have a kernelbob plugin for avisynth which I don't think involves ffdshow at all?
By the way, Mug Funky, what threshold do you use between 1-4 usually on what I'm assuming is LeakKernelbob, right?
Leak
6th October 2005, 06:54
Leak, I don't know where you got the idea that ffdshow deinterlacers were being used for MPEG-2 encoding, but doesn't avisynth have a kernelbob plugin for avisynth which I don't think involves ffdshow at all?
Well, I guess so - I wrote it, after all... :P
i wouldn't recommend threshold 0 for standards conversion - it'll cause vertical "wobbling".
Well, it works well on my TFT; at least watching the first episode of Full Metal Alchemist looked much better that way, and I really didn't notice any wobbling *as long as the video runs at full 60 FPS*; if a frame is dropped it's very noticeable of course...
Mug Funky
6th October 2005, 07:01
aah, if you're running at the native field rate, there wont be any wobbling. i meant using threshold=0 for standards conversion where 2 fields are being blended together, but the pixels are in different positions.
i have threshold=2 as default, and change it when the source demands it (set it lower if there's wavy combs coming through, set it higher if there's static bits wobbling)
MuttLover
6th October 2005, 12:31
So in a standard interlaced PAL to interlaced NTSC conversion, are better results obtained with LeakKernelBob or LeakKernelDeint -- and lowering the threshold param to (1 thru 4)???
I know this is dangerously close to the dreaded "what is best?" question, but I'm just wondering if I have been using the wrong tool (e.g., LeakKernelDeint instead of LeakKernelBob)...
castellandw
8th October 2005, 13:00
I'm wondering does mvbob() and mvfps() from mvtools() work better than kernelbob or leakkernelbob? I tried using it, but although it cleaned up my video very good, it left very blocky artifacts at the edges of the picture.
castellandw
12th October 2005, 04:27
I think I should change the questions, which is a better interlacer, mvbob, leakkernelbob or kernelbob?
Guest
12th October 2005, 04:39
I think I should change the questions, which is a better interlacer, mvbob, leakkernelbob or kernelbob? They're not interlacers; they're deinterlacers. They are all arguably "better" than Bob(). Don't ask which is best, per forum rule 12.
All these "what is better" questions, sheesh! It depends on your goals, values, and esthetic tastes. Answer it for yourself. We can't tell you what to prefer.
castellandw
12th October 2005, 13:28
Sheesh, I made a typo already in 1 post and after the previous posts in this thread, you'd think anyone would notice that. Oh well, it's alright, I meant deinterlacers. In any case, I can never why there's such a big deal with the "What is best question?" unless there really is some fierce competition or it leads to bad, fierce arguments.
Anyway, when I tried to use leakkernelbob and kernelbob, I tend to notice some jerky motion from time to time and some static bits wobbling especially during fast motion between thresholds 1-4. When I tried using mvbob, I got some jerky motion every as well as black spot artifacts at the edges of the picture. Does anyone know if that's normal or am I doing anything wrong?
MuttLover
20th October 2005, 16:50
@castellandw:
See http://forum.doom9.org/showthread.php?t=99818 and read down for a side-by-side for common deinterlacers
HTH
zambelli
20th October 2005, 20:31
@castellandw:
I've used a very similar script before with excellent results, except that I used LeakKernelBob() instead of Smooth.
castellandw
22nd October 2005, 04:00
zambelli, I've used leakkernelbob(), and it does leave some artifacts of wobbling static bits. What settings do you use for leakkernelbob()? Please keep in mind that I'm talking about converting interlaced shot video aka 50-60 fps progressive video which has more fluid motion than 25-29 fps progressive. When I tested out all the motion compensation plugin they actually do a better job but they do seem to leave these black spot artifacts.
Recently however, Fizick created a new Block Overlap Plugin along with MVTools, and it seemed to produce better results without any sight of black spots at the edge of the picture. I mentioned here in an earlier post that video engineers use motion compensation using phase correllation with motion estimation for broadcast standards conversion. The video engineers mentioned that motion compensation was so revolutionary that no other method has surpassed it until this day, and so I guess it even surpasses leakkernelbob as well. Mug Funky also mentioned that motion compensation using phase correllation with motion estimation can be done using block overlapped motion compensation (Fizick's Block Overlap Plugin with MVTools seems to be the best tool for this on AviSynth) and phase correlation with the Depan plugin, but Mug Funky says there's a few other tricks as well.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.