Log in

View Full Version : Converting 29.97fps to 25fps?


mizumi
26th November 2011, 11:55
I have this NTSC DVD I want to convert to PAL avi.

Usually, the PAL audio duration is longer than the NTSC audio, so the usual procedure I do is: Converting NTSC to film and make the PAL audio shorter to match the duration of the NTSC audio applying a pitch correction.

This time the PAL audio's duration is shorter than the NTSC audio. So the audio distortion is worse if I make the PAL audio longer, and there's less distortion if I make the film audio duration longer. So I thought of converting the NTSC video to film and then converting it to PAL video to match the PAL audio.

I've heard telecining film to PAL is better than using AssumeFPS. Which would be the filter and script to telecine from film to PAL?

Also, if you know of a better solution than the one I thought of, please let me know. Thanks!!

Jenyok
26th November 2011, 17:30
MVTools v2.0


Constants
#
Audio_Rate = 44100 # или (or) 48000
#
FPS_Numerator = 25
FPS_Denominator = 1

# 29.970
multinum = 25000 # FPS = FPS * multinum / multiden
multiden = 29970 # FPS = 29.970 * 25000 / 29970 = 25

# 23.976
multinum = 25000 # FPS = FPS * multinum / multiden
multiden = 23976 # FPS = 23.976 * 25000 / 23976 = 25

# 30
multinum = 5 # FPS = FPS * multinum / multiden
multiden = 6 # FPS = 30 * 5 / 6 = 25

# 24
multinum = 25 # FPS = FPS * multinum / multiden
multiden = 24 # FPS = 24 * 25 / 24 = 25


LoadPlugIn("C:\PROGRAM FILES\AVISYNTH 2.5\PLUGINS\MVTOOLS-V2_5_10\mvtools2.dll")


### что то здесь делаем, открываем файл и т.д...
# Do something, open files, etc...

#
# Change (30, 29.970, 23.976, 24) FPS to 25 FPS PAL
#
# Local Constants
#
# MSuper()
#
blkh = 16
blkv = 8
pel = 2
levels = 0
sharp = 2
rfilter = 4
isse = true

# MAnalyse()
#
delta = 1
overlap = 4
overlapv = 2
plevel = 2
search = 5
dct = 0
divide = 0
badSAD = 10000
truemotion = true

# MRecalculate()
#
thSAD = 100
smooth = 1
chroma = true

# MFlowFPS()
#
mask = 2 # = 1
ml = 2500
thSCD1 = 100
thSCD2 = 130

# Constants
#
spar = 30 # parametr ?

# Variables
#
dist_h = int((0.01 * spar * Width(last)) / blkh)
dist_v = int((0.01 * spar * Height(last)) / blkv)
dist = (dist_h > dist_v) ? dist_h : dist_v
dist = (dist > 0) ? dist : 1


# function MSuper(clip, int "hpad", int "vpad", int "pel", int "levels", bool "chroma", \
# int "sharp", int "rfilter", clip "pelclip", bool "isse", bool "planar")
#
super = MSuper(last, \
hpad = blkh, \
vpad = blkv, \
pel = pel, \
levels = levels, \
chroma = true, \
sharp = sharp, \
rfilter = rfilter, \
isse = isse, \
planar = false)

# function MAnalyse(clip super, int "blksize", int "blksizeV", int "level", int "search", int "searchparam", \
# int "pelsearch", bool "isb", int "lambda", bool "chroma", int "delta", bool "truemotion", \
# int "lsad", int "plevel", bool "global", int "pnew", int "pzero", int "pglobal", int "overlap", \
# int "overlapV", string "outfile", int "dct", int "divide", int "sadx264", int "badSAD", \
# int "badrange", bool "isse", int "full", bool "meander", bool "temporal")
#
backward_vec1 = MAnalyse(super, \
blksize = blkh * 2, \
blksizeV = blkv * 2, \
isb = true, \
chroma = chroma, \
delta = delta, \
truemotion = truemotion, \
search = search, \
searchparam = dist, \
plevel = plevel, \
overlap = overlap * 2, \
overlapV = overlapv * 2, \
badSAD = badSAD, \
dct = dct, \
divide = divide, \
isse = isse)

# function MAnalyse(clip super, int "blksize", int "blksizeV", int "level", int "search", int "searchparam", \
# int "pelsearch", bool "isb", int "lambda", bool "chroma", int "delta", bool "truemotion", \
# int "lsad", int "plevel", bool "global", int "pnew", int "pzero", int "pglobal", int "overlap", \
# int "overlapV", string "outfile", int "dct", int "divide", int "sadx264", int "badSAD", \
# int "badrange", bool "isse", int "full", bool "meander", bool "temporal")
#
forward_vec1 = MAnalyse(super, \
blksize = blkh * 2, \
blksizeV = blkv * 2, \
isb = false, \
chroma = chroma, \
delta = delta, \
truemotion = truemotion, \
search = search, \
searchparam = dist, \
plevel = plevel, \
overlap = overlap * 2, \
overlapV = overlapv * 2, \
badSAD = badSAD, \
dct = dct, \
divide = divide, \
isse = isse)

# function MRecalculate(clip super, clip vectors, int "thSAD", int "smooth", int "blksize", int "blksizeV", \
# int "search", int "searchparam", int "lambda", bool "chroma", bool "truemotion", \
# int "pnew", int "overlap", int "overlapV", string "outfile", int "dct", int "divide", \
# int "sadx264", bool "isse")
#
backward_recalc = MRecalculate(super, \
backward_vec1, \
thSAD = thSAD, \
smooth = smooth, \
blksize = blkh, \
blksizev = blkv, \
search = search, \
searchparam = dist, \
chroma = chroma, \
truemotion = truemotion, \
overlap = overlap, \
overlapv = overlapv, \
dct = dct, \
divide = divide, \
isse = isse)

# function MRecalculate(clip super, clip vectors, int "thSAD", int "smooth", int "blksize", int "blksizeV", \
# int "search", int "searchparam", int "lambda", bool "chroma", bool "truemotion", \
# int "pnew", int "overlap", int "overlapV", string "outfile", int "dct", int "divide", \
# int "sadx264", bool "isse")
#
forward_recalc = MRecalculate(super, \
forward_vec1, \
thSAD = thSAD, \
smooth = smooth, \
blksize = blkh, \
blksizev = blkv, \
search = search, \
searchparam = dist, \
chroma = chroma, \
truemotion = truemotion, \
overlap = overlap, \
overlapv = overlapv, \
dct = dct, \
divide = divide, \
isse = isse)

# function MFlowFPS(clip source, clip super, clip mvbw, clip mvfw, int "num", int "den", int "mask", \
# float "ml", bool "blend", int "thSCD1", int "thSCD2", bool "isse", bool "planar")
#
MFlowFps(last, \
super, \
backward_recalc, \
forward_recalc, \
num = int(FramerateNumerator(last) * multinum), \
den = int(FramerateDenominator(last) * multiden), \
mask = mask, \
ml = ml, \
blend = true, \
thSCD1 = thSCD1, \
thSCD2 = thSCD2, \
isse = isse, \
planar = false)

AssumeFPS(FPS_Numerator, FPS_Denominator) # Let's comment this string if video is 25 FPS
AssumeSampleRate(Audio_Rate)

IanB
26th November 2011, 21:29
# 29.970 aka 30000/1001
multinum = 25*1001 # FPS = FPS * multinum / multiden
multiden = 30000 # FPS = 29.970 * 25025 / 30000 = 25

# 23.976 aka 24000/1001
multinum = 25*1001 # FPS = FPS * multinum / multiden
multiden = 24000 # FPS = 23.976 * 25025 / 24000 = 25

nhope
27th November 2011, 07:43
You can do high quality conversions between NTSC and PAL using QTGMC (http://forum.doom9.org/showthread.php?p=1510921#post1510921).