brux
brux

Reputation: 3230

ffmpeg re-encode h264 mp4 trimming excess audio

The vids I am working with are created on an Android device, there is always a slight pause in video at the end of the file, the audio goes on for a spit second longer.

I think this is because the video stream is being concatenated to the nearest keyframe during the encoding of the mp4, however I dont have an control over this, I must work with these MP4's.

Can I use ffmpeg to re-encode the mp4 making the sound and video end exactly together (removing the excess audio)?

Here are a couple of examples of the mp4's I am working with, the pause at end of each file varies in length (presumably because the keyframes in the video stream can be up to a second apart)

http://www.sendspace.com/file/8281gm

Upvotes: 1

Views: 552

Answers (1)

Zombo
Zombo

Reputation: 1

Try this

ffmpeg -i a.mp4 -c copy -shortest b.mp4

Upvotes: 2

Related Questions