[Ffmpeg-devel] merge audio and video at frame level

Paul paul.pham
Thu Jan 18 03:10:54 CET 2007

>From a webcam (micro integrated ):
1) i have buffer PCM , and i success to encode this buffer to MPEG1 frame(s) audio.
2) I also can capture webcam to different buffer and encode to MPEG1 frame video.
But video and audio are seperated stream. All of audio frame(s) will be write direct to audio output file. And All of Video frames also write to video output file.

So, after have video and audio output. I will use ffmpeg.exe to merge. But i can see the final output seem not synch. 
if i capture long time, i see have not synch. I check the audio output is correct time of recording but video output is missing. So when merge , i see the final output cannot synch audio with video.

How can i make synch improve?

Can i also have different question: i see ffmpeg.exe can merge audio and video to final video (file level).
So, can you show me where/what is sample code to merge MPEG1 audio frame and MPEG1 video frame (frame level) to the final frame, so that i will write directly final frame to the final output file?

Thanks for any help

More information about the ffmpeg-devel mailing list