View Full Version : PAL to NTSC with HCEnc
ron spencer
31st May 2009, 20:27
After looking around the net, I think I have come up with a reasonable choice for converting PAL DVDs to NTSC, that is interlaced PAL (tv show DVDs). The AVISynth script I have chosen is:
LoadPlugin("dgdecode.dll")
LoadPlugin("SmoothDeinterlacer.dll")
LoadPlugin("Convolution3D.dll")
LoadPlugin("Convolution3DYV12.dll")
LoadPlugin("MSharpen.dll")
MPEG2Source("C:\TMP\Christmas78.d2v")
crop(4,4,-4,-4)
SeparateFields()
odd=SelectOdd.Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D (0, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
SmoothDeinterlace(doublerate=true)
AddBorders(4,4,4,4)
LanczosResize(720,480)
ChangeFPS(59.94) # or ConvertFPS(59.94)
SeparateFields()
SelectEvery(4,1,2)
Weave()
MSharpen(9,100,highq=true,mask=false)
ConvertToYV12
The question I have is this...since I have used SmoothDeinterlace, the video is obviously deinterlaced upon being fed to HCEnc; so how should HC handle this? In the settings, should I specify that source video is progressive and if so, should I enable the 3:2 pulldown box? Also, since this is from DVD, is the final converttoyv12 even needed?
thanks for any suggestions!!!
-RC
Guest
31st May 2009, 21:47
since I have used SmoothDeinterlace, the video is obviously deinterlaced upon being fed to HCEnc No, because you re-interlaced it in your script.
should I enable the 3:2 pulldown box? No, because it is already 29.97 at that point.
Also, since this is from DVD, is the final converttoyv12 even needed? Probably not. Use Info() at that point to find out for sure.
ron spencer
31st May 2009, 23:59
thanks very much...I am not that proficient in this pulldown/interlacing world. These scripts came from visits to various pages.
So then since I am in NTSC land, I would tell HC to use BFF...is this right given the AVISynth stuff I have used above?
thanks for your expertise in all this
-rs
Guest
1st June 2009, 00:08
Ron, rather than spoon feed you, maybe I can teach you to fish. Do you know how to determine field order?
Add AssumeTFF().SeparateFields() to the end of your script. Open it in VirtualDub and step through the fields. If everything is smooth then the output of the script is TFF. If it jumps back and forth during motion, then it is BFF.
ron spencer
1st June 2009, 01:03
I am all for learning....I make notes on all this stuff...thanks
Info() even told be it was BFF....verified with virtualdub as the assumetff was a bit jerky, subtle, but there.
Thanks...I will use BFF for HCEnc in future. I had done a test encode of my PAL DVD to NTSC the right way in any case (interlaced BFF). Upon playback on my plasma, things did not look 100% right, not like on my region free PAL player, but close, about 90-95% there, niot bad for a re-encode. So this is a nice methodology.
Can you recommend any changes to the script I have cobbled together? Thanks for teaching me to "fish"
Guest
1st June 2009, 02:59
Info() even told be it was BFF....verified with virtualdub as the assumetff was a bit jerky, subtle, but there. No! You can't trust that. It only tells you what Avisynth thinks it is. It may not be correct.
You have to check it manually.
I don't like C3D, especially on field separated material. Is it really necessary?
manolito
1st June 2009, 12:38
@Ron
A nice modification of your script goes like this (compiled from a couple of previous posts):
AssumeTFF() # Specify source field order
LoadPlugin("SmoothDeinterlacer.dll")
SmoothDeinterlace(doublerate=true)
Spline36Resize(720,480)
ChangeFPS(59.94)
AssumeTFF() # Specify target field order
SeparateFields()
SelectEvery(4, 0, 3)
Weave()
In the first line you specify the field order of your source (which you have to determine manually, like neuron2 already pointed out). In line #6 you enter the desired field order of your target stream. It does not matter which target field order you actually choose, for a DVD both are legal (but TFF is far more common on DVDs).
The nice thing about this script is that the "SelectEvery" command stays the same no matter which field order you are dealing with.
Cheers
manolito
ron spencer
1st June 2009, 15:49
@neuron2
-C3D is not really necessary...I can leave out easy enough
thanks for your input
@manolito
-thanks for the changes...I gather DVD player does not care of TFF or BFF if I am in NTSC land (as long as flagged correctly in mpeg stream)
-Also, why did you change SelectEvery from (4,1,2) to (4,0,3) in your script
thanks
manolito
1st June 2009, 17:07
-Also, why did you change SelectEvery from (4,1,2) to (4,0,3) in your script
Have a look here: http://forum.doom9.org/showthread.php?p=1271903#post1271903
SelectEvery(4,1,2) inverts the field order while SelectEvery(4,0,3) does not. It just makes your life easier to use the non-inverting command and control the desired target field order by the Assume?FF() command just before SeparateFields().
But this does not mean that you cannot do it otherwise. You can even shorten your script by using DoubleWeave. I just prefer Alex_ander's method for its ease of use...
Cheers
manolito
ron spencer
1st June 2009, 18:38
thanks...learning alot here.
One final question...is keeping original field order, which is PAL and TFF, the same for NTSC (i.e., NTSC TFF) a more preferred way of setting up for encoding? That is, less messing around with the video so a better quality encode?
I was under the impression that for NTSC you HAD to have BFF. Is this not the case for DVD in an NTSC country?
manolito
1st June 2009, 23:42
Commonly you expect a DV file (captured from a digital video camera) to be BFF and everything else to be TFF. Most commercial interlaced DVDs (Soaps, Sport) are TFF, and at least here in Germany all interlaced stuff from DVB-S or DVB-T is also always TFF.
But this is NOT a law. Interlaced content in MPEG2 format can of course be BFF as long as it is flagged correctly. But normally if the stuff comes from a DVD you just asssume it will be TFF because just about everyone does it this way.
Cheers
manolito
ron spencer
1st June 2009, 23:49
thanks again....but does it "hurt" the video quality if you have a TFF case (which I do here) and then choose a script to change to BFF? Just curious that is all. Is is better to keep the field order the same always in the script throughput?
Guest
1st June 2009, 23:51
It does not hurt the video. You have converted it to progressive in between so the original TFF status disappears completely from any consideration.
ron spencer
2nd June 2009, 00:11
thank you....this is fun stuff to learn....now just to figure out whether to use changefps or convertfps
mikenadia
2nd June 2009, 01:01
http://forum.doom9.org/showthread.php?p=1292680#post1292680
ron spencer
7th June 2009, 14:17
thanks to all....I am getting some really nice re-encodes with the following...feel free to comment on my notes as well:
LoadPlugin("dgdecode.dll")
LoadPlugin("SmoothDeinterlacer.dll")
LoadPlugin("MSharpen.dll")
LoadPlugin("LeakKernelDeint.dll")
LoadPlugin("FFT3DFilter.dll")
MPEG2Source("C:\TMP\Test.d2v")
assumeTFF() # verify first with GSpot or VDub!!!!
#
# Denoise with FFT3D, if want to...nice
#
# Modify sigma, but can look too smooth at higher values
#
FFT3DFilter(sigma=1.6,bw=32,bh=32,ow=16,oh=16,plane=4,interlaced=true)
#
crop(4,4,-4,-4) # crop away any overscan
AddBorders(4,4,4,4) # add back from crop
#
# Now to deinterlace, choose one of KernelBob or Smoothdeinterlace
#
LeakKernelBob(1) # 1 for TFF source, (0) for BFF
#SmoothDeinterlace(tff=true,doublerate=true) # tried and true but some like
# kernelbob better
#
Spline36Resize(720,480) # resize to NTSC DVD
#
ConvertFPS(59.94) # or ChangeFPS(59.94), Convert blends frame so is smoother
# changefps is crisper, but you will see jerking at fast action
# convertfps is smoother, but very slighlty blurry
#
# Now specify the target field order you can choose TFF ot BFF, both are
# ok for DVD, just flag it properly in encoder options. Some say
# keeping original field order is better. Also by specifying the
# field order, you never need to worry about which fields to select
# below. SelectEvery(4,1,2) inverts the field order while
# SelectEvery(4,0,3) does not
#
# Now convert to NTSC fields
#
AssumeTFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()
#
MSharpen(10,100,highq=true,mask=false)
# AssumeBFF().SeparateFields() # use for testing field order in VirtualDub
#
#info() # use to see colorspace and other info; is useful
#
# ConvertToYV12(interlaced=true) # should not be necessary as DVD is YV12
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.