extract audio track/stream from mp4

If we have known that the audio track in the mp4 file is .mp3, we can use the following commands to extract the .mp3 without any transcoding:

a) using ffmpeg:

ffmpeg -i input.mp4 -acodec copy output.mp3

b) using gpac/mp4box

mp4box -raw 2 input.mp4

(here, -raw 2 means the audio is the 2nd track in mp4, this parameter may vary in different cases, you should try to change this number if it doesn't work)


If you do not mind the audio to be transcoded, you can just use:

ffmpeg -i input.mp4 output.[formart]

here, [format] can be .mp3, .aac, .mp2, etc, any audio format that ffmpeg supports.


for more information about ffmpeg and gpac, visit [1][2].


[1] ffmpeg org, www.ffmpeg.org/

[2] gpac org, http://gpac.wp.mines-telecom.fr/

發佈了81 篇原創文章 · 獲贊 1 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章