Extract an audio track from an mp4 video with ffmpeg

by time news

Extraction with ffmpeg is very simple.

ffmpeg -i [VIDEO ENTRADA] [AUDIO SALIDA]

The option -iindicates the input file.

-vnindicates not to process the file for a transcode, to leave it as is. –acodec copy, indicates not to process and only copy the input audio to the output. The file with which the audio of the video is recorded must be the one we use in the output, otherwise we would have to transcode it

ffmpeg -i video_entrada.mp4 -codec:a libmp3lame audio_salida.mp3

o

ffmpeg -i video_entrada.mp4 -vn -acodec copy audio_salida.mp3

-acodec mp3we specify that it use the codec to transcode to mp3

ffmpeg -i video_entrada.mp4 -vn -acodec mp3 audio_salida.mp3

–acodec aacwe specify that it use the codec to transcode to aac

ffmpeg -i video_entrada.mp4 -vn -acodec libvorbis audio_salida.ogg

-acodec libvorbiswe specify that it use the codec to transcode ogg.

ffmpeg -i video_entrada.avi -ss 30 -to 60 -vn -acodec mp3 audio_salida.mp3

-ss 30 -to 60we specify that we will extract the audio, only from the second 30 a 60.

Pin It

You may also like

Leave a Comment