View Full Version : Directshowsource - framecount
Delta2
15th February 2008, 12:17
Script 1 :
DirectShowSource("movie.avi",fps=25, convertfps=true)
info()
Script 2:
DirectShowSource("movie.avi")
info()
The movie is a NTSC 23.976FPS Source
Script 1 gives a frame count of 121799
Script 2 gives a frame count of 116810
I need to make a ECL template for CCE and therefore I must know in advance the framecount
What formula is used to add extra frames ?
scharfis_brain
15th February 2008, 12:41
don't use directshowsource unless you really have to.
it is inaccurate.
Delta2
15th February 2008, 12:54
well, it is for converting RMVB files, how can I change frame rate then ?
I only need to know in advance the frame count
scharfis_brain
15th February 2008, 12:56
RMVB is VFR while AVIsynth only supports CFR.
You'll might run in severe difficulies with rmvb videos.
Delta2
15th February 2008, 13:19
RMVB is VFR while AVIsynth only supports CFR.
You'll might run in severe difficulies with rmvb videos.
Yes, I know, that's why I need to do frame rate conversion
How can I calculate the number of extra frames it adds ?
scharfis_brain
15th February 2008, 13:30
directshowsource("...", fps=25) gives 121799 Frames
directshowsource("...", ) gives 116810 Frames
so it adds :
121799 - 116810 = 4989 Frames
this is a ratio of :
121799 / 116810 = 1.042710384 : 1
so the original framerate of this video seems to be:
25 fps / 1.042710384 = 23.976 fps
which is NTSC-Film.
So Directshowsource seems to do it correctly.
Why do you use fps=25 at all?
It will duplicate every 24th source image and thus introducing motion judder every second.
Delta2
15th February 2008, 14:02
Thanks a lot, will solve my problem, my math is ugly :/
=====
Why do you use fps=25 at all?
It will duplicate every 24th source image and thus introducing motion judder every second.
=====
That's was only a example, not a real RMVB.
scharfis_brain
15th February 2008, 14:04
That's was only a example, not a real RMVB.
So you'll gonna have more trouble with rmvb cause of the variable framerate...
Delta2
15th February 2008, 14:27
So you'll gonna have more trouble with rmvb cause of the variable framerate...
But is there any other way to convert RMVB using Avisynth ?
I must always do convertfps, right ?
I'm talking about good quality rmvb files, not that mini-crap sources
scharfis_brain
15th February 2008, 14:31
can you provide an example rmvb-file?
Delta2
15th February 2008, 14:43
can you provide an example rmvb-file?
I can't upload 120Mb, but WMV, maybe you have some. How do you convert WMV using Avisynth ? is it not necessary to add "convertfps=true" parameter to DS ? imagine a RMVB with 23.976 FPS/25FPS....
frank
15th February 2008, 17:39
AVISYNTH DOC:
convertfps = false (in v2.56): It turns variable framerate video (vfr) into constant framerate video (cfr) by duplicating or skipping frames. This is useful when you want to open vfr video (for example mkv, rmvb, mp4, asf or wmv with hybrid video) in AviSynth. It is most useful when the fps parameter is set to the least common multiple of the component vfr rates, e.g. 120 or 119.880.
Wilbert
15th February 2008, 19:16
AVISYNTH DOC:
convertfps = false (in v2.56): It turns variable framerate video (vfr) into constant framerate video (cfr) by duplicating or skipping frames. This is useful when you want to open vfr video (for example mkv, rmvb, mp4, asf or wmv with hybrid video) in AviSynth. It is most useful when the fps parameter is set to the least common multiple of the component vfr rates, e.g. 120 or 119.880.
I should clarify the docs a bit :) It's false by default, but when set to true it turns vfr into cfr by duplicating or skipping frames.
@OP,
Assuming that, as an example, your source is truly 25 fps (on average), it means it is vfr. Since you are encoding to MPEG-2/MPEG-1 (thus cfr) you need to use
DirectShowSource("movie.avi", fps=25, convertfps=true, 121799)
otherwise your video and audio will not be in sync.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.