[MEncoder-users] AV sync issues with seperate audio and video encodeing

Andrew Berg bahamutzero8825 at gmail.com
Fri Apr 24 09:02:03 CEST 2009


ilyail3 K wrote:
> I figured out that the best way to use b-frames and mux to mp4 is with
> MP4Box.
> but every time I get a bad A-V sync issue of about 30 seconds.
>
> I've tried everything , extracting the video with ffmpeg with -async , or
> with mplayer  it doesn't seem to make any difference.
>
> can somebody please post an example of how to create .mp3(for example) files
> and .h264 files(raw h264).
> mux them with MP4Box and get a prefect audio-video sync.
Add harddup to the end of your video filter chain (e.g. -vf
scale=640:480,harddup). That should reduce sync problems dramatically.
Once you have your raw streams, you can mux with MP4Box. For example:

mp4box -add audio.aac:fps=29.97 -add video.h264:fps=29.97:delay=200 -new
movie.mp4

You may still have sync issues, but they shouldn't be nearly as severe,
and you can add :delay=[delay in ms] to the audio or video in your
MP4Box command to delay the audio or video to keep the streams in sync.
You'll have to have to watch the new movie file to determine which
stream to delay and by how much.


More information about the MEncoder-users mailing list