- Do dropped frames affect audio/video sync when capturing in AVI?
- Posted by Leonid Makarovsky on December 21st, 2003
I capture with my TV card in 704x480 NTSC AVI using Huffyuv2.1 lossless codec.
Then I load AVI into VirtualDub, frameserve it into TMPGenc and make a DVD
compliant MPEG2 file.
In best case scenario if a VHS tape is good, I get 1 dropped frame per every
20 minutes. However, if a VHS tape is not that great, I'll be getting many
more dropped frames. The question is, do they affect audio/video sync? Suppose,
I capture exactly a minute of a video and all of a sudden I get 30 dropped
frames in a row. Does it mean that a video portion of AVI file is now 59
seconds while audio portion is still 60 seconds? If that's the case, then
obviously video will be ahead of audio. Is there anyway to fix it, like
insert frames in place of dropped frames? Thanks.
--Leonid
- Posted by DeepOne@ix.netcom.com on December 22nd, 2003
Leonid Makarovsky <venom@cs.bu.edu> wrote:
Try capturing with AVI_IO. http://www.nct.ch/multimedia/avi_io/
Markus Zingg (the author) has made some good posts on the subject of
dropped frames and audio synchronization in this newsgroup recently
(you should be able to find them with a Google search).
- Posted by Markus Zingg on December 22nd, 2003
Hi Leonid
If the capture program as well as the encoder are not broken it does
not affect sync cause a drop is also stored in the file as a zero
sized frame. Such a frame must then be interpreted by any program that
reads the avi as an instruction to repeate the last know good frame.
HTH
Markus
- Posted by Leonid Makarovsky on December 22nd, 2003
DeepOne@ix.netcom.com wrote:
: Try capturing with AVI_IO. http://www.nct.ch/multimedia/avi_io/
Fly2000 works the best for my hardware. It actually does have an option to
synchronize audio and video on a fly. However, when I used it, it didn't do a
good job on it. When I didn't use this option, my synchronization was perfect.
But I had only 3 dropped frames. My soundcard is M-Audio.
--Leonid
- Posted by Leonid Makarovsky on December 22nd, 2003
Hi Markus,
Thanks for response,
: If the capture program as well as the encoder are not broken it does
: not affect sync cause a drop is also stored in the file as a zero
: sized frame. Such a frame must then be interpreted by any program that
: reads the avi as an instruction to repeate the last know good frame.
Is there any way to find out whether the program I use actually does store
a 0 sized frame? It actually does report a dropped frame. If I load the file
in virtualdub, do I need to mask any dropped frame or will it do the job
on its own? Thanks.
--Leonid
- Posted by Markus Zingg on December 23rd, 2003
You should not need to do anything special at all. If you need to,
then the captuer application (or processing app provided the drops are
in the file) is broken/incompatible.
Markus
- Posted by Leonid Makarovsky on January 12th, 2004
Hi Markus,
I noticed that I get 1 dropped frame precisely per every 20 minutes.
However, VirtualDub does NOT see them. My test showed once I get such
a dropped frame, my audio is behind by the duration of a standard
frame (1/25 for PAL and 1/29.97 for NTSC). It's not a big deal - just
a little extra work to shrink the audio portion of AVI file by the
number of dropped frames divided by 25 for PAL and 29.97 for NTSC.
The way I tested the loss of sync was I captured a 95 minute long
video and got 5 dropped frames (at 10, 30, 50, 70, and 90 minute
points). Then I recaptured the very end of the video at like 93 minute
point. Chose the same frame for both AVI files in VD. Saved the WAV
files from that point on for both AVI files. Compared the WAV files
and noticed that the audio was shifted by .224 seconds. 5.75/25 = .23.
--Leonid
- Posted by Paul D. Sullivan on January 12th, 2004
One reason I use AVI_IO. Ensures audio/video sync.
- Posted by Markus Zingg on January 12th, 2004
And how did you capture them? Again, if the capture aplication does it
right you should see a zero sized frame in the stream. There are avi
structure dump utilities around that show this very well.
If however one uses avi_io's option to insert the last good frame if a
dropp ocures you would not be able to see it. You haven't said which
capture app you were using so...
Markus
- Posted by Leonid Makarovsky on January 13th, 2004
Markus Zingg <m.zingg@nct.ch> wrote:
: And how did you capture them? Again, if the capture aplication does it
: right you should see a zero sized frame in the stream. There are avi
: structure dump utilities around that show this very well.
I use Fly2000 application. It has the option to sync video and audio
(probably resampling like in VD). However, this option didn't work for me
- it shrinks audio and I get out of sync. If I do'nt use the option, my sync
is perfect except for those reported dropped frames.
: If however one uses avi_io's option to insert the last good frame if a
: dropp ocures you would not be able to see it. You haven't said which
: capture app you were using so...
Other thing. I have the VHS tape is eaten in one place. I captured it. In
eaten part, the application reported 111 dropped frames. I then loaded the
AVI file into VirtualDub. VirtualDub only saw 102 dropped frames. After
that eaten part, things went out of sync. I shifted an audio by
(111 - 102) x 25 and got the perfect sync.
And then another thing. When I watch the resulting DVD with 1 dropped frame
per every 20 minutes, I didn't see any dropped frames. Everything was smooth.
--Leonid
- Posted by Markus Zingg on January 13th, 2004
On 13 Jan 2004 05:08:01 GMT, Leonid Makarovsky <venom@cs.bu.edu>
wrote:
You see, my previous statement holds true. I said "If the capture
program as well as the encoder are not broken...." unfortunately there
are too many capture programs out there that just don't do it right.
Well, all I can tell you is that in all those cases avi_io would have
worked well for you. You might want to give the trial a shot and have
it work over those critical parts.
Markus