View Full Version : Confused about ChangeFPS(59.94)
nicksteel
12th July 2012, 01:09
In the following example script for converting interlaced PAL to NTSC, 59.94fps is output. Is this NTSC DVD compliant, or, if not, how do you use the output for creating a compliant DVD VOB?
# PAL DV (50 fps) to NTSC DV (59.94 fps)
LoadPlugin("SmoothDeinterlacer.dll")
AVISource("PALDV.avi")
SmoothDeinterlace(tff=false, doublerate=true)
BilinearResize(720, 480)
ChangeFPS(59.94)
SeparateFields()
SelectEvery(4, 0, 3)
manolito
12th July 2012, 01:37
Yes, this is absolutely DVD compliant. One thing is missing in the script, it needs a Weave() at the end. And of course you can use different bobbers and resizers. Here is a modified script which uses Yadif and Spline36Resize:
AssumeBFF() # Specify source field order
LoadCPlugin("mypath\yadif.dll")
# Padding - thanks Didée
PointResize(width,height+8,0,-4,width,height+8)
Yadif(mode=1)
Crop(0,4,-0,-4)
Spline36Resize(Width,480)
ChangeFPS(59.94)
AssumeTFF() # Specify target field order
SeparateFields()
SelectEvery(4, 0, 3)
Weave()
This script is only useful for interlaced or hybrid sources. For progressive sources you should encode at the source framerate and apply pulldown afterwards.
Cheers
manolito
nicksteel
12th July 2012, 01:40
Wow! Thanks for the quick answer. Will this affect audio muxing":)
TheSkiller
12th July 2012, 10:01
You should try to avoid using "59.94" in ConvertFPS() because 59.94 is not precisely the NTSC field rate. It may seem unnecessary, but over the course of a long video it does make a difference (like audio sync issues) whether you use 59.94 or "60000/1001" which is the exact NTSC field rate.
So my advice is, swap 59.94 for 60000/1001.
ChangeFPS(60000,1001)
nicksteel
12th July 2012, 13:27
mpeg2source("C:\USERS\NICKSTER\DESKTOP\TESTFPS\D2VAVS\V01.D2V")
Bob(height=480) # Separate fields and interpolate them to full height.
BicubicResize(720,480) # Resize to NTSC square-pixel frame size.
ConvertFPS(60000, 1001) # Convert field rate to NTSC, by duplicating fields.
SeparateFields.SelectEvery(4,0,3) # Undo Bob, even field first. Use SelectEvery(4,1,2) for odd field first.
Weave
http://avisynth.org.ru/docs/english/corefilters/fps.htm
Says that ConvertFPS keeps audio in sync, but isn't working for me.
What should I do to keep audio in sync?
TheSkiller
12th July 2012, 15:27
The audio should not run out of sync with that script.
If it does, it's not the fault of the script, most likely there is a static audio offset in the original DVD that needs to be considered for conversion or re-authoring. If you used DGIndex have a look at the log file to see if it reports a delay for the audio track(s).
Blue_MiSfit
15th July 2012, 07:23
convertfps("ntsc_double") is the easy way to do this precisely :)
Also, if you really want to do NTSC -> PAL conversion via simple field duplication this will suffice, but you might look at motion compensated conversion. Example (taken mostly from the MVTools2 documentation and modified a bit):
# Assuming source is 50p at this point
# Setup
super = MSuper(pel=2)
# Motion analysis
backward_vec = MAnalyse(super, isb = true)
forward_vec = MAnalyse(super, isb = false)
# Actual frame rate conversion
MFlowFps(super, backward_vec, forward_vec, num=60000 den=1001)
# Re-interlace
SeparateFields()
SelectEvery(4, 0, 3)
Weave()
Also, you could use a higher quality bobber like QTGMC.
Finally, this is really an AviSynth usage question, but I'll let it stay here since your ultimate target is an NTSC DVD.
nicksteel
21st July 2012, 19:29
DVDRebuilder Pro v1.28.2 results for interlaced 25fps PAL to interlaced 29.97 NTSC with menus and features intact. The menus may be "non-compliant", but the VOB's are converted to NTSC and the menus, subtitles and features all work. My only interest was to convert a PAL DVD to play on my NTSC only player. I have only tested with an animated DVD that was only available as PAL. Different Avisynth filters may be necessary for a regular movie. I was unable to reencode with DVDRebuilder v098.2 (Free) due to audio issues.
Extracted full disk with DVDFab
Altered HC.ini file (in programs folder) to generate all VTS files (not just the large ones) with:
[Options]
VTS Minimum Size Re-Encode Threshold
vts_min_size=0
Range:0-?, Default: 25625 (~52 MB)
Encoded with CCE in DVDRebuilder Pro v1.28.2 with following script in the Filter Editor:
ConvertToYUY2(interlaced=true) #Probably unnessary - (I sometimes frameserve from VirtualDubMod).
# Smart bob to get 50fps video
sbdeint()
# Gamma on PAL content is generally 20% higher than NTSC,
ColorYUV(Gamma_Y= -43)
# ChangeFPS duplicates frames to reach the desired framerate
ChangeFPS(60000,1001)
# Separate new frames into fields
Separatefields()
# Alternate keeping the top field from one frame and bottom field from the next
SelectEvery(4,0,3)
# Resize fields to NTSC-compatible size
Lanczos4Resize(720,240,0,0,720,288)
# Weave fields back into interlaced video
Weave()
DVDRebuilder has audio sync problems when changing frame rates. Remuxed and corrected sound sync on only the main title set (multiple VOB's). Smaller title sets appear to be ok. (If problem, remux them too.)
Demuxed selected title set with DemuPgcDemux_1205_exe
Muxed with muxman_0_16_8
Renamed new VOB's to match DVD and overlaid into DVD folder.
Ran FixVTS1.603 (full dvd) to repair structure and "adjust your DVD files into better DVD compliance"
Changed Video Manager Menu and title set(s) attributes from PAL to NTSC 720/480 Letterbox with IfoEdit.exe
Burned, everything works on my Pioneer player.
Attached are before/after Dgindex screens. I also confirmed file data in VirtualDubMod, VLC and VideoReDo. I won't discuss menu compliance (VMGM_MAT in IfoEdit shows "TV system NTSC 525/60"), as I have no experience with menu editing, but this method allows one to use their desired AVS script, select content and encoder thru DVDRB and quickly process a complete DVD. Aside from DVDRebuilder (you can run v1.28.2 unattended with "One Click Mode"), everything else is straight forward and takes about 10-15 additional minutes.
It's fast and simple, but may or may not work for you. Its advantage over just changing the DVD video attributes with IfoEdit or VobBlanker is that you can encode the video to NTSC size and frame rate with any Avisynth filters you desire.
Again:
I was successful only using DVDRebuilder Pro v1.28.2, not the free version. It has more features and I feel it is well worth the $30.00 price.
manolito
22nd July 2012, 22:13
You should try to avoid using "59.94" in ConvertFPS() because 59.94 is not precisely the NTSC field rate. It may seem unnecessary, but over the course of a long video it does make a difference (like audio sync issues) whether you use 59.94 or "60000/1001" which is the exact NTSC field rate.
So my advice is, swap 59.94 for 60000/1001.
ChangeFPS(60000,1001)
After reading this post I got a little curious because I never had any audio sync issues using ChangeFPS(59.94). I did a little test converting a 1 hour clip from PAL to NTSC, using ChangeFPS(59.94) and ChangeFPS(60000,1001). I fully expected that the total number of frames in both conversions would be different, but they were exactly the same.
So there must be some rounding from AviSynth involved. Is it the 60000/1001 expression, or is it done by SelectEvery(4, 0, 3)? Whatever, right now I see no reason to replace ChangeFPS(59.94) by ChangeFPS(60000,1001).
Cheers
manolito
IanB
23rd July 2012, 00:07
The difference here is very very very small!
60000/1001 = 59.9400599400... frame duration = 0.01668333...
59.94 frame duration = 0.0166833500166833500...
A difference of 16.6833500166833500... nanoseconds
Try this :-ColorBars(320, 480).AssumeFPS(50, True) # 50fps source
Last+Last+Last+Last
Last+Last+Last+Last # Make up a 9.5 hour clip
ShowFrameNumber()
StackHorizontal(ChangeFPS(60000, 1001), ChangeFPS(59.94)) # Compare
Sometimes this matters, sometimes it does not. ;)
manolito
23rd July 2012, 14:49
Thanks IanB, your explanation was very helpful...:thanks:
Your example shows that even for a 10 hour clip the total number of frames is never off by more than 2 frames. And this number even gets halved when you reinterlace the clip.
Nobody can hear an audio sync error of 1 frame, so my conclusion is: Don't worry, be happy...
ChangeFPS(59.94) is also a little faster than ChangeFPS(60000,1001) on my machine.
Cheers
manolito
TheSkiller
24th July 2012, 11:21
OK, I have to admit I did not know the difference is that small. But there is something I'm more concerned about and that is the framerate of the encoded MPEG2 video. For NTSC compliant video the encoder – if I'm not mistaken – writes 30000/1001 in the MPEG2 header. In the end that's the framerate the video will play with on a TV.
But what if you feed your encoder with an avisynth script that has a flagged framerate of 2997/100 instead of 30000/1001, how will this be handled? :) I don't know.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.