Log in

View Full Version : Virtualdub & TMPGenc keep closing when running scripts


funkydude74
23rd November 2004, 07:18
Hi all. Been trying to run some PAL/NTSC conversion scripts in Virtualdub and TMPGenc but I either get errors and once I fixed the errors when it is finally going to work the bloody programs close on me :angry: :angry: :angry: :angry: :angry: !!!!!!!!!! It's making me so mad I feel like punching a brick wall til my knuckles bleed angry: :angry: :angry: :angry: :angry: !!!!!!

Seriously I've been having so much trouble trying to get ANY PAL/NTSC conversion script I found on the net to work that I feel like I've got Buckleys chance of getting any of my PAL videos smoothly coverted to NTSC :( .

I would like to know why these programs close on me for NO REASON when running such scripts. The script I was trying to run in VirtualDub which closed on me was a PAL-NTSC conversion script someone posted here at some point which I found when searching google, this one has my mods to it to suit my requirements:

######################################################################
#
# 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/A...hDeinterlacer/.
# 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 = "C:\Program Files\AviSynth 2.5\plugins\"

#---------------------------------------------------------------------
#
# 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")
#
LoadPlugin("MPEG2DEC3.dll")
Input = MPEG2Source("C:\DVDtemp\norman gunston\VIDEO_TS\test.d2v")

#---------------------------------------------------------------------
#
# 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 = 29.97

#---------------------------------------------------------------------
#
# 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 = 480

#---------------------------------------------------------------------
#
# Set OutputTopFieldFirst to either true or false, depending on the
# desired format of your output file. See InputTopFieldFirst above.
#

OutputTopFieldFirst = false

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




If anyone can tell me why VirtualDub would close for no reason when running such scripts I'd most appreciate it.

Troy

kizuna
23rd November 2004, 09:12
This sounds like a codec conflict to me. I had TMPGEnc crash on me several times when I tried to open a video because it didn't like the codec (though it didn't crash right away).
Do you know what codec you use for YV12 (video format AviSynth sends to TMPGEnc/VDub)? You could have used VirtualDub to see what codec is used but that doesn't seem to be an option here. Did you try different versions of VirtualDub? Not all might be affected from this problam.
ffdshow worked fine with TMPGEnc in the past. Install the ffdshow codec and open an MPEG4 video. ffdshow sould be decoding it now and you can get to the opions through the filter menu of your player. Select "Codecs" from the lefthand menu and at the very bottom set "Raw Video" from "disabled" to "All supported".