Extracting audio from a video file (mpg/mpeg)

So you have a video file, such as an mpg/mpeg file. You would like to extract the audio from it without making any changes. Video containers usually hold the video and audio file separately so lossless conversion is possible.

Depending on your video container format, the method would be different, but for mpg/mpeg you can simply download ffmpeg (BtbN/FFmpeg-Builds) and extract it to your C drive (or your preferred location), name the folder ffmpeg and start Command Prompt (see below)

Type “cmd” after pressing the Windows start menu.

Once you launch Command Prompt, you will need to head to the folder that you created and extracted the downloaded files. Type “cd C:\ffmpeg”. For convenience, move your video file to the same folder and execute the command below.

ffmpeg -i "1.mpeg" -vn -acodec copy "1.wav

What you’re telling ffmpeg to do is look for the file “1.mpeg” within the folder (rename this to your file name), then extract the audio, creating the file “1.wav” (or you could change it to “1.mp3”). Once done you should see the newly created file in the same folder.

All done!

For more advanced people, if you know what you’re doing you can do this without moving any files around.

Links

https://streamshark.io/blog/understanding-codecs-and-formats/

https://en.wikipedia.org/wiki/Comparison_of_video_container_formats

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.