Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to convert a MPEG2 file to H264/AAC.

No problem about video, but when I convert Audio: ac3, 48000 Hz, stereo, s16, 255 kb/s to MP3 or AAC, with any bitrate, the sound is not synced with the video. The sound is in advanced to video when I play it. How to fix it please ?

More information : the source video is 1h30 long and 3,4 Gio.

share|improve this question

To sync the audio stream with video time stamps we may use the -async option:

-async samples_per_second
Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, the parameter is the maximum samples per second by which the audio is changed. -async 1 is a special case where only the start of the audio stream is corrected without any later correction. This option has been deprecated. Use the asyncts audio filter instead.
Libav documentation

Begin to try with samples per second matching your framerate and decrease until your audio is in sync:

avconv -async 30 -i <infile> <encoding options> -r 30 <outfile>
share|improve this answer

protected by fossfreedom Sep 23 '13 at 7:57

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.