View Full Version : Video Framerates dont match, but it worked before? Now it wont.
Ok i captured a cartoon. i was going to use vdubmod because i just want to encode the thing "as is" in XviD. However the framerates did not match. it gave me that warning.
So i tried AVISynth using "SegmentedAVISource" and sure enough it worked.
Ok i just captured another cartoon, same deal in vdubmod. Now when i use the same script identically it only loads the first segment. What is up with that?
i tried using UnalignedSlice(....
and when i opened it up in vdubmod avisynth gave me the error of framerates not matching.
I looked in the help. but the only thing i found was AssumFPS and dont think i can/want to use that.
i use iuVCR to capture. is there a setting im missing somewhere in it? this never happened before with the VFW application AVi_iO and vdub i used to use. in iuvcr i set master stream to "Audio" and dont think i can set it to "Video" without getting a horrible synch issue. in iuVCR i use segmented files of 12 mintues long (anything longer than 14min i get async results).
so im really confused on what to do now. i can encode each file seperately i guess, but that is the last resort. plus i want to use iuvcr but i have tested it out just minutes ago and it seems every segment it captures has different framerates. i dont want to have to encode the segments seperately each time.
i have looked into VirtualVCR but it doesnt segment files via time (or anythign else it looks like).
stickboy
3rd July 2004, 08:10
The problem is your capture app doesn't lock the video framerate. If you master to the audio stream, then the capture app will adjust the video framerate to maintain A/V sync. As a result, each capture file can have a slightly different framerate. (If you master to the video stream, then the capture app will adjust the audio sampling rate as needed, and then you'd have the problem of mismatched sampling rates.)
One way around this with VirtualVCR is to use its dynamic audio resampling mode. That way both video framerate and audio sampling rate are always fixed.
Of course, that doesn't help with existing files. For that, simply use AssumeFPS. Why don't you want to use it? Since the framerates should differ only slightly, it shouldn't have any noticeable effect.clip1 = AVISource("foo.avi")
clip2 = AVISource("bar.avi")
clip1.AssumeFPS(29.97) ++ clip2.AssumeFPS(29.97)Note that you should call AssumeFPS on both clips; that way you can guarantee that they both end up with the same framerate.
Although it's tempting to tryclip1 ++ clip2.AssumeFPS(clip1.FrameRate())that may not work due to the imprecision of floating-point numbers. (IanB's FrameRateNumerator and FrameRateDenominator (http://forum.doom9.org/showthread.php?s=&threadid=78727) functions would help here, but they're not in any builds yet.)
hey just now got to watch the whole thing in playback.
sure enough AssumeFPS(... works great! THANK YOU.
if my calculations are correct...
29.7 is the AssumeFPS(...
29.965 is the source.avi
this the math on when i will loose a whole _SECOND_
(29.7 / .005) / 60 = 99 (99minutes and i will loose a whole second (29.7)?)
im tired and about to head out the door for the 4th of July celeb. how long will it take for me to drop a entire 1 second (29.7)? know what i am saying?
the method you mentioned about taking the fps to pass to the first AssumeFPS(... does not work it seems. that is a very logical thing to do but it is the equivalent of keep the first clips fps and just alterning the second? if the first clips fps is 29.965 then i can just alter the second clip with no problems?
ie. clip1 ++ clip2.AssumeFPS(29.965)
the more logical method that doesnt work that you mentioned, is fine but i assume that would only work if you had 2 clips...i have 4 clips total. so...
clip1 ++ clip2.AssumeFPS(29.965) ++ clip3.AssumeFPS(29.965) ++ clip4.AssumeFPS(29.965)
this method is fine right? just althering the fps slightly of the following clips and leaving the clip1 "as is"
the last ? i have is, can you set a global variable to AssumeFPS(... of ALL clips. that way i could still use SegmentedAVISource(...
know what i mean? or do i have to alter each clip i want to use? can you do something like the below?
AssumeFPS(29.7(SegmentedAVISource(...))
that would be convienent.
stickboy
5th July 2004, 00:03
Originally posted by BITS
29.7 is the AssumeFPS(...
29.965 is the source.avi
this the math on when i will loose a whole _SECOND_
(29.7 / .005) / 60 = 99 (99minutes and i will loose a whole second (29.7)?)NTSC video is 29.97 frames per second. That doesn't impact your calculation that much, though; it means 99.9 minutes instead.
Of course, that assumes that the video is really 29.965 fps to begin with. NTSC video is already supposed to be 29.97 fps.
If you're concerned about A/V sync, then after calling AssumeFPS, you can resample your audio so that its duration matches...the method you mentioned about taking the fps to pass to the first AssumeFPS(... does not work it seems. that is a very logical thing to do but it is the equivalent of keep the first clips fps and just alterning the second?Huh? I don't understand what you are trying to say. If you're trying to say that the second method I mentioned doesn't work, yes, that's what I said...if the first clips fps is 29.965 then i can just alter the second clip with no problems?No. As I already mentioned, you need to call AssumeFPS on both clips. The conversion from a rational number -> floating-point value -> rational number may not be exact due to rounding errors. If you set the frame-rate of only one of the clips, it's likely that it won't exactly match the frame-rate of the other clip.the more logical method that doesnt work that you mentioned, is fine but i assume that would only work if you had 2 clips...i have 4 clips total. so...The case for four clips is the same as for two clips: you need to call AssumeFPS on all clips you want to splice together.clip1 ++ clip2.AssumeFPS(29.965) ++ clip3.AssumeFPS(29.965) ++ clip4.AssumeFPS(29.965)
this method is fine right?No.the last ? i have is, can you set a global variable to AssumeFPS(... of ALL clips. that way i could still use SegmentedAVISource(...
know what i mean? or do i have to alter each clip i want to use? can you do something like the below?Sorry, you'll need to load each clip manually with AVISource, call AssumeFPS, and then join them together.
I suppose you could write a recursive function that generates the numbered filenames and makes the AVISource, AssumeFPS, and AlignedSplice calls for you, but I'm not sure it's really worth the effort. How many segments are you dealing with?AssumeFPS(29.7(SegmentedAVISource(...))This syntax is wrong anyway.
toysoldier
5th July 2004, 09:27
I guess :
a1=avisource("...\*001.avi").changefps(30)
a2=avisource("...\*002.avi").changefps(30)
....
a1+a2+.....
no i was trying to think of how i could use AssumeFPS on all AVISource's in the script without having to define it for each clip. havent thought of one though.
stickboy
7th July 2004, 06:58
Originally posted by BITS:
havent thought of one though.As I said, you can write a recursive function that does it.
e.g., something like (this is totally untested):
function LoadSegments(string filenameBase, string formatString,
\ float fps, string "pixel_type")
{
c = AVISource(filenameBase + String(0, formatString),
\ pixel_type=pixel_type)
c = c.AssumeFPS(fps)
return LoadSegmentsHelper(filenameBase, formatString,
\ fps, pixel_type, c, 1)
}
# helper function LoadSegments; don't call this yourself
function LoadSegmentsHelper(string filenameBase, string formatString,
\ float fps, string pixel_type,
\ clip c, int i)
{
Try
{
seg = AVISource(filenameBase + String(i, formatString),
\ pixel_type=pixel_type)
c = c ++ seg.AssumeFPS(fps)
return LoadSegmentsHelper(filenameBase, formatString,
\ fps, pixel_type, c, i + 1)
}
Catch (msg)
{
return c
}
}
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.