Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AVI audio video sync (Read 6266 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

AVI audio video sync

Please give me some tips or some source code by using which able to
make the avi file for audio and video data to play in sync.
 
Some details are given below:
I noticed that many times the video recorded is 7 Frames
per second and again it will change to 15 frames per second. While in
this scenario the audio card's sampling frequency is 8000Hz therefore
the number of samples per second is 8000. So , in this situation I am
not understanding how to synchronize these two streams video and the
audio.

For audio it is fixed ie. the number of samples per second is 8000 but
for video frames, it is not fixed it will always get changes (ie. 7FPS
15FPS, 30FPS - here FPS -> Frames per second).So many times the audio
is ahead and many times the video.

In the avi source code I had sent to you earlier, can you just look at
the audio stream parameter settings. Can you just focus me is there are
correct parameters or something wrong used and probably what is the
value it should contain.

AVI audio video sync

Reply #1
Variable frame rate isn't possible at all with avi. You need to use Matroska or mpeg-4 systems. I'm pretty sure that the Matroska guys will help you at #matroska @ irc.corecodec.org. Doom9's forum has also something about sources like this.

AVI audio video sync

Reply #2
Thanks LEtxx,

But I want the sample source code for creating the AVI with audio and video stream which should play in perferct Sync in medial player.

AVI audio video sync

Reply #3
Quote
Please give me some tips or some source code by using which able to
make the avi file for audio and video data to play in sync.
 
Some details are given below:
I noticed that many times the video recorded is 7 Frames
per second and again it will change to 15 frames per second.


Video recorded from... what?

As said AVI cant deal with VFR streams... you might be able to fake it though by putting empty chunks in the stream if the different framerates have a common denominator.

So if you want to combine 15 fps with 30 fps, you can put an empty video chunk after every frame of the 15 fps part.

I'm not a programmer though and have no idea if this would actually work.
"We cannot win against obsession. They care, we don't. They win."