Log in

View Full Version : drop frame recovery


maago
14th March 2003, 00:15
I noticed that virtual dub has an option to seek to the next drop frame in an avi file. This made me wonder if there is a way to correct drop frames automatically?

Would it be possible to do this by repeating the last good frame to replace all drop frames?

Is there a filter or some other method of doing this automatically?

The reason I ask is because if my scheduled capture is running, occasionally someone will come use my computer and i will experience a few dropped frames. Sometimes this seems recoverable instead of throwing out the entire capture. So basically I am wondering if you can fix the audio/video unsynch problem of dropped frames by inserting frames that look 'okay' in their place. Perhaps a smart filter could even try to blend in the missing frames by taking a gradual difference between the last and next good frame. I don't know! I hope this is possible. I'd appreciate anyone with more information on this topic to share.

Thanks,
maago

fccHandler
14th March 2003, 07:47
Originally posted by maago
Would it be possible to do this by repeating the last good frame to replace all drop frames?
IIRC VirtualDub doesn't render dropped frames, so the result is exactly as you described (the last good frame is shown instead).

The reason I ask is because if my scheduled capture is running, occasionally someone will come use my computer and i will experience a few dropped frames.
Kick them in the butt and tell them to get off your computer! :devil:

maago
14th March 2003, 18:09
IIRC Virtualdub?

As far as I know, all versions of Virtualdub I have used to save avi's with dropped frames, when played back in WMP or Zoom Player, are not synch'ed. At the passing of each dropped frame, the audio gets further ahead (i think) than the video.

IIRC VirtualDub doesn't render dropped frames

More information on IIRC Virtualdub? Google search yielded no useful results.

fccHandler
14th March 2003, 20:19
Sorry. IIRC isn't a different version of VirtualDub, it's net-speak which stands for "If I Remember Correctly..."

Dropped frames are stored in the AVI file, but their frame sizes are all zero. VirtualDub can't render them, so the image from the last good frame is used. If the audio sounds like it's playing too early, then what might work is to delete all of the dropped frames from the AVI. I don't know of an automated way to do it, but here's the manual way:

1) Start VirtualDub
2) Open your AVI with dropped frames
3) Choose "Edit/Next drop frame"
4) If it says "No next dropped frame found" go to step 6
5) Press Delete, and go back to step 3
6) Set video and audio to "direct stream copy"
7) Save a new AVI

If that doesn't help, or the audio sounds like it's playing too late, then you could also try "change so video and audio durations match" in the Video/Frame rate menu.

maago
14th March 2003, 22:43
After intentionally capturing a segment of video with dropped frames, these are the results I have concluded:
Neither deleting dropped frames nor changing the fps so the audio/video durations match cure the unsynchronization problem. I also tried doing one then the other, twice, in both orders, and nothing worked. Using the option to change the fps so the durations match helps but does not completely remove the unsynch problem.

Maybe the problem lies in ATI's TV capture program not handling dropped frames and synchronization properly? However, obviously the durations of the audio and video do not match, since virtualdub suggests to change the video fps to a higher value (~30.187) in order to make the durations match. Does this imply that there is more video data than audio, and we are speeding up the video to match the audio? This contradicts the fact that you always hear the audio and then see the corresponding video which might suggest we lost the video frames but not the audio frames??? After thinking about it for a little bit, I was unable to draw any conclusion as to what the problem actually is... :confused:

Hopefully you or someone else already knows the answer? If not, I guess I'll just have to kick people's butts for going on my PC while I'm capturing video!

fccHandler
15th March 2003, 00:26
:scared: Oops, I just noticed a flaw in my step-by-step guide to manually deleting the dropped frames (it didn't occur to me that VirtualDub will also delete the corresponding audio samples). To work around that, you'll first have to separate the audio from the video, delete the dropped frames, save the new video stream, then put the original audio back in.

1) Start VirtualDub
2) Open your AVI with dropped frames
3) Save WAV (extract the audio)
4) Choose "Edit/Next drop frame"
5) If it says "No next dropped frame found" go to step 7
6) Press Delete, and go back to step 4
7) Set video to "direct stream copy"
8) Save a new AVI
9) Open the new AVI you just saved in step 8
10) Choose WAV audio (the WAV you saved in step 3)
11) Set video and audio to "direct stream copy"
12) Save another new AVI

(Unfortunately steps 8 and 12 must be done separately because you have to clear the edit points before remuxing the AVI.)

If that doesn't work then I give up. I guess you'll have to start kicking butt.

maago
15th March 2003, 06:35
This method results in the opposite as before, I end up with less video information than audio, and the suggested fps is now about 27. If I chop off the end of the audio, or adjust the video framerate to match the audio, either way, it's not synched. I'm still thinking about this, and if I come up with anything I'll post it here. Otherwise, the situation is seemingly hopeless for successfully recovering from drop frames. :(

Thanks, fccHandler, for all of your help.

-Maago

IanB
15th March 2003, 14:54
Originally posted by maago
Maybe the problem lies in ATI's TV capture program not handling dropped frames and synchronization properly?
....
Hopefully you or someone else already knows the answer? If not, I guess I'll just have to kick people's butts for going on my PC while I'm capturing video!Troll the "Capturing Video" forum for "ATI" and you will see how highly ATI's capture software is regarded. NOT!

Experiment with capturing with VirtualDub (use the WDM interlude if you don't have any vidcap drivers) to see how things can work with quality software.

IanB

Note: the WDM -> vidcap interlude sucks, but it is useful for testing.

maago
17th March 2003, 05:26
My capture card works fine with virtualdub. The only reason I don't like to use it is because I enjoy the scheduling feature of programs like WinDVR or ATI's software. I can close them, and they will automatically open at a scheduled time via a service, and record the correct channel. I know Virtualdub has a VCR++ program but I have to leave it open, and to me that's annoying. ATI works fine as long as frames aren't dropped, so I think I am going to stick to that. Thank you for the suggestions. ;)

-Maago