Log in

View Full Version : At least one frame delay


Lenchik
11th April 2007, 20:29
a2 = DirectShowSource("test1-1.avi",23.976,audio=false)#.info()
b2 = DirectShowSource("test1-2.avi",23.976,audio=false).bicubicresize(960,544)
b2 = b2.trim(152,0)#.info()
e1=Compare(a2,b2)
e2=Subtract(a2,b2)
c=StackHorizontal (e1,e2)
d=StackHorizontal (a2,b2)
f=StackVertical(c,d)
return e2

I have at least one frame delay (maybe only one) when i am seeking in virtualdub or MPC. If i am going from frame to frame from beginning to end - all is OK. Frames in sources seem to be identical. But if i place "e2.trim(500,0)" at the end - again 1 frame delay (of the second test avi)

What happens and how to avoid it?

Leak
11th April 2007, 22:10
What happens and how to avoid it?
Can you use AVISource instead of DirectShowSource?

DirectShow doesn't support seeking to frames by number, so DirectShowSource has to convert the frame number into a timecode, which can lead to rounding errors...

np: Sage Francis - Crack Pipes (Personal Journals)

actionman133
12th April 2007, 00:17
If you can't use AVISource or any other frame accurate source filter, then you can use DirectShowSource ("...", seek = false).

The upside is that it should be frame accurate. The downside is that if you seek to the middle of the file, it will start reading from the first frame.

IanB
12th April 2007, 05:18
DirectShowSource ("...", seek = false)Will disable seeking completely. Going forward is done the hard way, i.e. read all intervening frames. You can't go back, it just keeps returning the last frame (the cache can give the illusion of a small amount of backward seeking)

DirectShowSource ("...", seekzero = true)Is a little less restrictive in that it allows seeking backwards only to frame 0 (then read forwards to the desired frame)

foxyshadis
12th April 2007, 07:59
If those files are mpeg-4 encoded with b-frames, you might also need to use mpeg4modifier to pack them. Otherwise using avisource will give you the exact same behavior you're trying to avoid right now.