View Full Version : Quicktime FPS difficulties?
ffynnon
22nd August 2003, 23:39
I've never loaded a Quicktime into AVisynth and managed to keep the proper frames per second. Call me a dolt...
In the past I've just given up and made an intermediate file but this next project demands I go straight from QT (avid meridian codec) to Huff. I've tried the following script:
LoadVFAPIPlugin("E:\Program Files\Multimedia\AVIsynth\Filters 2\QTReader.vfp", "QTReader")
QTReader("G:\test sized empire\10 Meg MASTER HUFF\Avid QT\Avid QT.mov")
AssumeBFF()
AssumeFPS(29.97)
FlipVertical()
I've tried every variation of AssumeFPS, ChangeFPS and SelectEvery that seemed to make sense. Virtualdub will indeed show 29.97fps, but in reality has nearly 17minutes of footage from a 10 second source!
Also, the image is softer, and doesn't seem to respect the source as having a field dominance. There is added noise and some pixelization when loading quicktimes into avisynth. Directshowsource doesn't work with the meridian codec, so I'm left with loadvfapiplugin.
I've scoured the forums and FAQ, and it doesn't look like quicktime is used a whole lot here. I'm hoping someone can enlighten me as to what I'm missing. ????
Being able to load a 2 hour quicktime reference file, crop it, and save it to segmented AVIs with HUFF is my goal. Any and all suggestions are welcome!
stickboy
23rd August 2003, 00:43
IIRC, whenever I used the VFAPI QTReader, it generated 100 (upside-down) duplicates of each frame. (It looks like this is happening to you too; 10 seconds * 100 = 1000 seconds = 16.666... minutes.) Therefore, I always used:
QTReader("foo.mov").SelectEvery(100, 0).FlipVertical()
Edit:
I looked through some of my old scripts, and here's what I actually used:
# QTSource
#
# Opens the specified QuickTime movie file
#
# PARAMETERS:
# filename
#
# NOTE:
# This may not work on all QuickTime videos...
#
function QTSource(string filename)
{
LoadVFAPIPlugin(VFAPI_plugin_directory + "QTReader.vfp", "_QTSource")
c = _QTSource(filename)
# I'm not sure why there are so many duplicate frames or what
# determines how many there are. The values used below are based on
# a few empirical tests on 24 fps and 29.97 fps QuickTime videos.
return c.SelectEvery((Round(c.Framerate()) == 600) ? 25 : 100, 0).FlipVertical()
}
ffynnon
23rd August 2003, 19:17
Thanks for the reply! I can now get Virtualdub to show 29.97fps, and the actual framecount is very close--only 1 higher than the original quicktime file. I've chosen a better test file, and now vfapi reader returns a value of 600fps. ??? why would this be different between 2 quicktimes that are the same frame rate and same codec?
for the 600fps I used:
QTReader("G:\Vegas Files G\hit.mov")
SelectEvery(20,0)
AssumeFPS(29.97)
This yields a frame count of 271, while the original had 270. Is this cause for concern--especially over a 2 hour time span? (My new test file is only 9 seconds). ChangeFPS(29.97) yielded 271 as well.
I don't quite understand the nature of the script you provided. I assume I would plug my pertinent info into the appropriate places...forgive me for not immediately understanding this. Are you automatically determining the "selectevery" based on the fps returned? If so, is there a number I could use to turn 600-->29.97 directly instead of following it up with assumefps? It looks like you're headed towards PAL using 25, or maybe that's a different parameter entirely...I'm confused!
Forget about the garbage and pixelization--it was happening in After Effects for some reason--not vfapi's fault.
stickboy
23rd August 2003, 21:32
Originally posted by ffynnon
I've chosen a better test file, and now vfapi reader returns a value of 600fps. ??? why would this be different between 2 quicktimes that are the same frame rate and same codec?I really have no idea.
Are you automatically determining the "selectevery" based on the fps returned?Yes.If so, is there a number I could use to turn 600-->29.97 directly instead of following it up with assumefps? It looks like you're headed towards PAL using 25, or maybe that's a different parameter entirely...I'm confused!No... Basically what the script does is use SelectEvery(25, 0) if the clip reports a framerate of 600 and uses SelectEvery(100, 0) if it reports something else. (Remember that I determined these values empirically from the Quicktime files I happened to have, so they may not be correct for all files! In retrospect, I think if you know what the framerate is supposed to be, just use ChangeFPS, and it'll get rid of the duplicate frames for you.)
ffynnon
24th August 2003, 01:18
thanks. I get it now. For some reason changefps makes my image blurry--probably averaging multiple frames without regard to fields. I found if I use selectevery, then changefps everyting works out.
LogicDeLuxe
12th May 2008, 22:21
I hate those insane framerates. I usually got rid of them with a simple SelectEvery(100, 0) or similar. Now I'm really in trouble, though:
Original Video is 23.976 fps. QTreader reports 600 fps. There is no simple integer I could use with selectevery, and even fdecimate(rate=23.976, threshold=0.0001) fails occasionally.
Any idea how I could get all the original frames accurately?
stickboy
13th May 2008, 09:38
Are you sure that the original video is 23.976 and not 24 fps? That's why the QTSource function I posted above (almost five years ago) does:
SelectEvery((Round(c.Framerate()) == 600) ? 25 : 100, 0)
LogicDeLuxe
13th May 2008, 19:26
Are you sure that the original video is 23.976 and not 24 fps? That's why the QTSource function I posted above (almost five years ago) does:
SelectEvery((Round(c.Framerate()) == 600) ? 25 : 100, 0)Well, MediaInfo (http://mediainfo.sourceforge.net/en) says so, and this is definitely right. I just found the problem though.
Actually fdecimate(rate=23.976, threshold=0.0001) worked just fine.
Also SelectRangeEvery(1001,1000).assumefps(600000,1001).SelectEvery(25,1) does a flawless job.
The actual problem was the way the mov file is edited. It has some duplicate frames now and then for some reason, as I found out now.
NerdWithNoLife
15th May 2008, 00:05
You can use AssumeFPS(30000,1001) for 29.97 or AssumeFPS(24000,1001) for 23.976.
LogicDeLuxe
15th May 2008, 13:19
You can use AssumeFPS(30000,1001) for 29.97 or AssumeFPS(24000,1001) for 23.976.Sure, I could change my line to SelectRangeEvery(1001,1000).SelectEvery(25,1).assumefps(24000,1001), but the result remains the same.
fdecimate works better after all, though. It seems quicktime video's framerates can suffer from roundoff errors when long enough.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.