I have written a viewer that allows writing h264 video with libx264.
However the audio (mp3, ac3 or aac) comes out of sync with the video.
The problem seems to be the first 20 frames or so that are not written
out to the file.
I can reproduce the problem with the muxing.c example from the docs when
I modify it like the attached diff.
In that case, I cannot tell that it starts early but the sound ends 20
frames before the end of the movie.
Can someone suggest something to try?
diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c
index ad8e027..4ce056b 100644
--- a/doc/examples/muxing.c
+++ b/doc/examples/muxing.c
@@ -526,6 +526,9 @@ int main(int argc, char **argv)
fmt = oc->oformat;
+ fmt->video_codec = AV_CODEC_ID_H264;
+ fmt->audio_codec = AV_CODEC_ID_AC3;
+
/* Add the audio and video streams using the default format codecs
* and initialize the codecs. */
video_st = NULL;
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user