Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd October 2005, 07:03   #1  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
PAL To NTSC Conversion using AviSynth?

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).

Last edited by Guest; 6th October 2005 at 12:48.
castellandw is offline   Reply With Quote
Old 2nd October 2005, 10:16   #2  |  Link
foxyshadis
Angel of Night
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
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.

http://forum.doom9.org/showthread.ph...529#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

Last edited by foxyshadis; 2nd October 2005 at 10:20.
foxyshadis is offline   Reply With Quote
Old 2nd October 2005, 14:08   #3  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
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/knowledge...ks/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..

Last edited by castellandw; 2nd October 2005 at 14:21.
castellandw is offline   Reply With Quote
Old 3rd October 2005, 14:23   #4  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
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)
MuttLover is offline   Reply With Quote
Old 3rd October 2005, 15:26   #5  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
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?

Last edited by castellandw; 3rd October 2005 at 15:28.
castellandw is offline   Reply With Quote
Old 3rd October 2005, 16:47   #6  |  Link
midnightsun
Registered User
 
Join Date: May 2004
Posts: 67
(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.
__________________
Sorry I had to go see about a girl
midnightsun is offline   Reply With Quote
Old 3rd October 2005, 17:00   #7  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
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?
castellandw is offline   Reply With Quote
Old 3rd October 2005, 17:23   #8  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by castellandw
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))
Leak is offline   Reply With Quote
Old 3rd October 2005, 17:54   #9  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
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?
castellandw is offline   Reply With Quote
Old 4th October 2005, 05:19   #10  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
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.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 4th October 2005, 07:31   #11  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by castellandw
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...
Leak is offline   Reply With Quote
Old 4th October 2005, 19:59   #12  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
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?
castellandw is offline   Reply With Quote
Old 4th October 2005, 23:16   #13  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by castellandw
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?

np: Yoko Kanno - Siberian Doll House (Ghost In The Shell Stand Alone Complex OST 1)
Leak is offline   Reply With Quote
Old 5th October 2005, 01:57   #14  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
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.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 5th October 2005, 12:40   #15  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
Quote:
Originally Posted by Leak
Argh.
Also, why would anyone use ffdshow's deinterlacers when encoding when there's AviSynth, which is much more powerful?

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?
castellandw is offline   Reply With Quote
Old 6th October 2005, 06:54   #16  |  Link
Leak
ffdshow/AviSynth wrangler
 
Leak's Avatar
 
Join Date: Feb 2003
Location: Austria
Posts: 2,441
Quote:
Originally Posted by castellandw
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

Quote:
Originally Posted by Mug Funky
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...
Leak is offline   Reply With Quote
Old 6th October 2005, 07:01   #17  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
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)
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 6th October 2005, 12:31   #18  |  Link
MuttLover
Registered User
 
Join Date: Feb 2005
Location: Ohio Valley/USA
Posts: 67
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)...
MuttLover is offline   Reply With Quote
Old 8th October 2005, 13:00   #19  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
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 is offline   Reply With Quote
Old 12th October 2005, 04:27   #20  |  Link
castellandw
Registered User
 
Join Date: Sep 2005
Posts: 90
I think I should change the questions, which is a better interlacer, mvbob, leakkernelbob or kernelbob?
castellandw is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.