Here is my latest standards conversion script.
XesdeeniCode:###################################################################### # # Poor man's video standards conversion (NTSC to PAL and PAL to NTSC) # # This script converts one INTERLACED video format to another # INTERLACED video format. # # NOTE: This script is NOT meant to convert telecined films (that is, # films that have been transferred to video). There are much better # ways to convert that type of content (see the guides at # www.doom9.net and www.vcdhelp.com). This script is best for # INTERLACED content like HOME MOVIES shot with camcorders or live # events. It is also good for mixed content (film + video). # #--------------------------------------------------------------------- # # >>> Tools <<< # # This script is for use with AVISynth version 2.0.6 or above, # available from http://www.avisynth.org. # # This script uses my AVISynth port of Gunnar Thalin's smooth # deinterlacer, which is available at # http://home.bip.net/gunnart/video/AVSPorts/SmoothDeinterlacer/. # Place the plugin in an AVISynth plugin directory, so it can be # accessed below. # #--------------------------------------------------------------------- # # For comments/suggestions email me (Xesdeeni2001) at Yahoo dot com. # ###################################################################### # # >>> How It Works <<< # # This script works by first converting the input video from # interlaced fields to progressive frames using an adaptive # deinterlacer. Then the progressive frame rate is converted. # Finally the progressive frames re-interlaced for output. Scaling # is also performed where appropriate. # ###################################################################### # # >>> To Use <<< # # To use this script, first modify the lines below as specified. # Then save the script with any name ending in .AVS. # #--------------------------------------------------------------------- # # Set PluginPath equal to the path for your AVISynth plugins. Be sure # to end the path with a backslash. Note that if you put the plugins # in the system directory, you can leave this path completely empty. # ex.: # PluginPath = "C:\AVISynth\PlugIns\" # PluginPath = "" #--------------------------------------------------------------------- # # Set Input equal to the load directive for the input file. Also add # any plugins necessary to load the video file. Note that if the clip # contains audio, it is fed straight through without being modified, # because the output video will have the same length as the input # video. # ex.: # LoadPlugin(PluginPath + "MPEG2DEC.dll") # Input = MPEG2Source("Input.mpg") # Input = AVISource("E:\temp\LiveTest.avi") #--------------------------------------------------------------------- # # Set InputTopFieldFirst to either true or false, depending on the # format of your input file. DV files are normally bottom field # first, so set this value to false. DVDs and most other sources are # normally top field first, so set this value to true. # InputTopFieldFirst = false #--------------------------------------------------------------------- # # Set OutputFrameRate to the desired frame rate of your output video. # For PAL, this is normally 25. For NTSC, this is normally 29.97. # The input frame rate is derived directly from the input video. # OutputFrameRate = 25 #--------------------------------------------------------------------- # # Set the OutputWidth and OutputHeight to the desired width and # height of your output video. In most cases, the width of the # output should match the width of the input. For PAL, the height # is normally 576. For NTSC, the height is normally 480. The input # width and height are derived from the input video. # OutputWidth = Input.width OutputHeight = 576 #--------------------------------------------------------------------- # # Set OutputTopFieldFirst to either true or false, depending on the # desired format of your output file. See InputTopFieldFirst above. # OutputTopFieldFirst = true #--------------------------------------------------------------------- # # Set ConversionType to your desired type of frame rate conversion. # The choices are: # 0 - Replication/Decimation: Frames are repeated to increase the # frame rate; frames are dropped to decrease the frame rate. # This type of conversion is the fastest, but may show visible # stuttering on motion when decreasing the frame rate (i.e. # NTSC to PAL). # 1 - Temporally Interpolate: Output frames are created by # temporally interpolating between adjacent input frames. This # type of conversion can show a "jutter" effect on motion, but # is best when decreasing the framerate to ensure every input # frame is at least partially shown in the output. # 2 - Asynchronous: The conversion is done by showing the # portions of the input frames that correspond to the time # during which the output frame is visible. When decreasing # the frame rate, this can cause some areas of some frames to # never be seen, and can cause "broken" vertical edges on # horizontal pans. # ConversionType = (OutputFrameRate <= Input.framerate) ? 1 : 0 # ###################################################################### LoadPlugin(PluginPath + "SmoothDeinterlacer.dll") vpro = Input.SmoothDeinterlace(tff=InputTopFieldFirst, \ doublerate=true) vinfps = Input.framerate < OutputFrameRate ? \ vpro.BilinearResize(OutputWidth, OutputHeight) : \ vpro vfps = ConversionType == 2 ? \ vinfps.ConvertFPS(OutputFrameRate * 2, zone = 80) : \ ConversionType == 1 ? \ vinfps.ConvertFPS(OutputFrameRate * 2) : \ vinfps.ChangeFPS(OutputFrameRate * 2) voutfps = OutputFrameRate <= Input.framerate ? \ vfps.BilinearResize(OutputWidth, OutputHeight) : \ vfps vfields = voutfps.SeparateFields() vlace = OutputTopFieldFirst ? \ vfields.SelectEvery(4, 1, 2) : \ vfields.SelectEvery(4, 0, 3) # The ConvertToRGB() below is to work around a problem with the YUV to # RGB conversion caused by a bug in one of the Microsoft DLLs. The # bug makes the colors look bad. Your destination may bypass this # conversion, so you may be able to remove this conversion in some # cases. vout = vlace.Weave().ConvertToRGB() return(vout)
+ Reply to Thread
Results 1 to 1 of 1
Similar Threads
-
Pls help! Best way to convert NTSC VHS (captured using PAL VCR) to NTSC DVD
By rairjordan in forum Capturing and VCRReplies: 33Last Post: 28th Nov 2013, 11:33 -
when Pal dvd has correct Ntsc audio (Pal>Ntsc conver)
By spiritgumm in forum Video ConversionReplies: 15Last Post: 13th Oct 2011, 12:57 -
PAL to NTSC, NTSC to PAL framerate conversion?
By Baldrick in forum Video ConversionReplies: 44Last Post: 5th Dec 2009, 23:31 -
NTSC to PAL, PAL to NTSC framerate conversion?
By Baldrick in forum Video ConversionReplies: 23Last Post: 23rd Apr 2008, 11:19 -
NTSC-PAL-NTSC (25-23.976+pulldown) and audio sync problem - related?
By ecc in forum Video ConversionReplies: 14Last Post: 14th Nov 2007, 11:34