Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have an mp4 video file with multiple audio tracks. I would like to strip away the rest of the tracks and keep just one. How do I do this?

share|improve this question

5 Answers

up vote 10 down vote accepted
+100

First run ffmpeg -i file.mp4 to see which streams exists in your file. You should see something like this:

Stream #0.0: Video: mpeg4, yuv420p, 720x304 [PAR 1:1 DAR 45:19], 23.98 tbr, 23.98 tbn, 23.98 tbc
Stream #0.1: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s
Stream #0.2: Audio: ac3, 48000 Hz, 5.1, s16, 384 kb/s

Then run ffmpeg -map 0:0 -map 0:2 -acodec copy -vcodec copy -i file.mp4 new_file.mp4 to copy video stream and 2nd audio stream to new_file.mp4.

share|improve this answer

Related issue—removing all audio tracks from an mp4 file can be done thus:

ffmpeg -i input_file.mp4 -vcodec copy -an output_file.mp4
share|improve this answer

You could try avidemux which handles only one audio file internally (and therefore forces you to select one specific track). I've never tried it with .mp4 but it works with other formats.

share|improve this answer
Doesn't work so well. Maybe it's a bug, but the audio comes back mangled, though it does do the job (remove the rest of the audio tracks). – Tshepang Jan 25 '11 at 20:32

FFMPEG might be a helpful solution for you.

$ man ffmpeg
share|improve this answer
I had a brief look, and it's quite dense. I searched for "audio" and "audio track" and nothing seemed obvious. – Tshepang Jan 25 '11 at 8:01

http://howto-pages.org/ffmpeg/#strip

please see the example.

share|improve this answer
That link explains how to extract audio from the file. You mind reading my question again. – Tshepang Jan 25 '11 at 10:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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