I have an mp4 video that has no audio/video sync issue. I tried to extract audio to an mp3 file, following the suggestion in this thread: Extracting audio from MP4 video into MP3

ffmpeg -i input_file.mp4 -vn -abr 128k -acodec libmp3lame output_file.mp3

However, the mp3 end up to be 7:51 long (while the video is 3:26). When I played the mp3, the player will terminate at 3:26. Why is this the case?

By the way, I also tried to use Mac builtin encoder to encode the mp4 to m4a (Finder->Services->Encode selected video file->Audio only), and there is no problem. The output m4a is 3:26 long.

  • 1
    Please show the complete ffmpeg console output. How did you check the output file duration? -abr is not a valid option: you can use -b:a or -ab instead. – llogan May 8 '13 at 0:34

The player exits when there is nothing more to read. A file may appear longer (or shorter?) than it actually is when a VBR mp3 has incorrect frame / length headers. I'm not sure about the technical details, but there are tools such as mp3val to fix this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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