Log in

View Full Version : For the Avisynth experts


oof
19th July 2003, 22:23
I hate to be a weeny, But I can't seem to figure this one out.

For whetever reason I have a video that has duplicate frames
every so often. Vdub shows a K frame followed by a D frame
at the duplicate pairs. My ATI capture card caused it.
The video is an MJPEG AVI.
This is causing A/V unsync every time there is a duplicate.
It can be fixed by saving the audio, deleting the dropped
frames, and then restoring the audio.

There is one (or two) about every sec. so manually deleting them
is very tedious.

I am trying to find an automated way to fix this.
AviSynth is probably the only way. It doesn't work so far.

* this is maybe close but no cigar

#####################
avisource( "file.avi" ).ConvertToYV12( )

# ShowFrameNumber() # Debug

ConditionalFilter(last , last.trim(1,0) , last , "YDifferenceToNext()" , "<", "1.0" , true )
####################

Frames 26 and 27 in the source are duplicates, The frame sequence out of this filter is ... 25 - 26 - 28 - 28 - 29 - 30 ... etc.
It deleted 27 OK but now there's 2 28s !

Is there a way to loop over frames ? Not in the Docs i've seen.
If I could get a variable set to the right frame number I could
use DeleteFrame.

Any clues ?

Wilbert
19th July 2003, 22:29
Source: pal or ntsc?

Btw, do you see that there are duplicates when playing the avi? If not you might to leave them in.

oof
19th July 2003, 22:52
The problem is they are causing
audio/video un-sync. It is variable and
not fixable by any linear method.

The only A/V Sync fix is to delete the duplicates

oof
19th July 2003, 22:53
Sorry
its NTSC Mjpeg Avi
Yes I can see them.

Kika
19th July 2003, 23:20
These D-Frames are dropped Frames. VirtualDub marks them this way.

oof
19th July 2003, 23:45
Thank you. That's extremely illuminating.
The last time I mentioned dropped frames,
I was told they didn't exist. :rolleyes:

I wish Vdub would REALLY drop them.

Kika
19th July 2003, 23:58
Normaly, the doubled frames are used to keep Audio and video in sync. It's very strange, that you get an async Video because of these doubled Frames.
What Program do you use for capturing? Try VirtualDubSync from A. Dietrich.

oof
20th July 2003, 01:50
I have a ATI AIW 8500 Radeon.
I does not have VFW drivers.
Vdub does not do WDM
the "wrapper" to fix this is slow
Therefore I cannot capture fast enough with Vdub.

Anyway...
The double frame thing happens almost exactly every 1 second.
It doesnt do it all the time !
I captured 6 episodes of a show on 6 successive days.
the last 2 had this problem. the first 4 did not.
I used exactly the same settings for everything.
Its a bug in the ATI stuff i guess. 1 frame per sec
is 3%. Sound card can't be off that much.

Never happens when I use ATi codecs

It's also strange that if you remove the dropped frames
the movie is exactly in sync.

FredThompson
20th July 2003, 02:48
Aren't you using the latest drivers from ATi? They have a specific driver update for capturing with WDM.

oof
20th July 2003, 03:57
ATI has had only WDM drivers for years.
I always get the latest.
I vaguly remember long ago
this didn't happen, but I didn't notice what version.

FredThompson
20th July 2003, 04:19
I have Win2K, Athlon 2100, All-in-Wonder Radeon. Full D1 captuer with no dropped frames using the last few versions of the ATI drivers.

Something else must be causing this problem because the drivers work fine for me.

cheap-red-wine
20th July 2003, 04:39
MultiDecimate().