FFMPEG: Extracting audio from a video file.

To extract audio from a video file, I used the following command:
ffmpeg -i myvideo.mp4 -vn -acodec copy audio.mkv

Replace myvideo.mp4 with the video filename/path, and audio.mkv with the name you want to use for the audio output filename, and the extension.

In this command, -i is used to specify the path and filename of the input video, -vn skips the inclusion of the video stream, while -acodec copy is for copying the original audio (without re-encoding).


Comments