View Full Version : Convert 120fps or VFR to fixed framerate (23.97 or 29.97)
takeshimiyagawa
31st January 2005, 20:03
Hi! I have problems regarding framerate from a HD video that will be converted to DVD-MPEG2 using TMPGEnc and frameserved by avisynth.
The content of the show is the same, but I can choose from the following encodes:
-Source#1: Matroska 1024x576 WMV9 Vorbis Fixed (MatroskaProp says 119.879997 fps)
-Source#2: Matroska 856x480 Xvid Vorbis VFR (MatroskaProp says 25.480164 fps)
Of course when played in MPC or GraphEdit all is ok.
The first problem is, I have to specify a framerate to DirectShowSource(), so I don't know what to specify.
My current non-working avisynth script is:
DirectShowSource("Source#1.mkv", 119.879997)
LoadPlugin("VSFilter.dll")
TextSub("Subtitle.ass")
ConvertToRGB24()
My intention is to encode this in progressive 29.97fps DVD-MPEG2
I have read a little about Decimate, MultiDecimate, FDecimate, but I don't know how to handle a Matroska VFR or 120fps and I have no success.
My setup is:
-AviSynth 2.5.6 06-01-2005
-XviD 1.1.0-Beta1-16012005
-TMPGEnc XPress 3.0.4.24
-Media Player Classic 6.4.8.2
-Matroska Splitter 1.0.2.4
-CoreVorbis 1.0b6
Any help will be appreciated.
Takeshi Miya
lamer_de
31st January 2005, 22:35
well, 120fps is usually used to have mixed 23fps and 29fps content. That was the only way to handle it in avi. Matroska allows VFR, so 120fps is obsolete. Well, never question the actions of the original capper ;). If you want 29,97fps, just use the 120fps raw and add a Changefps(29.970) after your DShowsource line.
Alternatively, you can use Selectevery(4,0)
If you want to use the vfr one, use mp_rel from this thread and proceed as described:
http://forum.doom9.org/showthread.php?threadid=81425
Or simply get another capture. DVD has a fixed resolution, so you'll have to downsize your HD resolutions anyway :p
(btw, HD starts at 720p vertical resolution afaik, so your sources are not HD ^_^)
CU,
lamer_de
takeshimiyagawa
1st February 2005, 00:56
Hi, thanks for reply
Using the 120 fps raw I get the video in avisynth like at 4x speed and out of synch:
DirectShowSource("Source#1.mkv", 119.879997) <- Is this correct?
ChangeFPS(29.970)
LoadPlugin("VSFilter.dll")
TextSub("Subtitle.ass")
ConvertToRGB24()
I tried also for the MKV VFR the mp_rel, but I don't know what to do with the .avi and .vfr files, how to load that in avisynth using AVISource.
a side note: why don't exists a MKVSource in avisynth?
lamer_de
1st February 2005, 08:48
DirectShowSource("Source#1.mkv", 119.879997) <- Is this correct?
I always explicitly add the fps parameter, but I think it should be correct. Look it up in the documentation if unsure.
DirectShowSource("Source#1.mkv",fps=119.879)
But now that you mention it, I made an error. I forgot that DShowsource only delivers "real" framnes and not the drop frames that are used to achieve the 120fps. So if you use Dshowsource your video strem will contain all the frames that contain content at a framerate you specify. So, if your stream is 23.976 fps with 29fps segments like OP/ED (I'll just assume you're working with anime, judging from your nick, the a high res and on top I haven't seen many 120fps files outside of Japan), your stream will play too fast. If your stream is 29.97fps and you supply that as an argument, it'll be in sync. Doing it like I told you will give you 4x faster video :P Sorry. If you open it at 23fps, you'll discover a nice phenomenon. You can seek around in the video with vitualdub just fine and in sync with the audio, but if you encode it, it'll always be too short, because the 29fps segments get encoded at 23 fps ^_^ I spend quite some time fiddling with this :P You need to find the segments with the different framerate and apply the correct fps to them.
The mp_rel one is surely the easier alternative. Open the avi just like your usual avi. Open the vfr file in atext editor, and you'll see something like this:
Assume 23.976
0,2274,23.9759
2275,2275,13.3333
2276,21990,23.9760
21991,21991,11.9048
21992,29622,23.9760
29623,34850,59.9397
34851,37535,23.9760
37536,37536,119.8800
Now you can create segments in your avi and apply the correct framerates with assumefps and then bring it down to a common denominator with changefps (in my case, it would be 23,976fps)
a side note: why don't exists a MKVSource in avisynth?
For exact those resons. Avi can't handle VFR.
http://forum.doom9.org/showthread.php?s=&threadid=69132&highlight=MKVSource
CU,
lamer_de
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.