“How can we extract audio from video file (MPEG-4 format)? From other questions about this topic I learned that ffmpeg is a right tool to do this. I tried to use the following command: ‘ffmpeg -i video.mp4 -acodec copy -ss 00:30:00 -to 00:60:00 extract.mp3’. But it fails and says ‘[mp3 @ 0x3bfade0] Invalid audio stream. Exactly one MP3 audio stream is required. Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument’. Can anyone help me? Please show me how to extract audio from video using FFmpeg in detail. Thanks.”

For most people who watch movies a lot and do conversions frequently, FFmpeg is widely known to them. FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. Many people have used FFmpeg to convert video files for totally free.

If you are looking for a guide on using FFmpeg to extract audio off video files, this guide would be exactly helpful to you. Here we would like to show you how to extract audio from video files using FFmpeg.

Part 1: Extract audio from video via FFmpeg

To extract the audio from a video, and keep the original audio format, the first thing you'll want to do is check what's the original audio format so you know what file extension to use, by using ffprobe (part of the FFmpeg package):

    ffprobe myvideo.mp4

Replace myvideo.mp4 with the video filename (and path if the video is not in the current folder). Near the end of this command's output you should see the audio stream, e.g.:

    Stream #0:1(eng): Audio: vorbis, 44100 Hz, stereo, fltp (default)

Now that you know the original audio format, extract the audio from the video without re-encoding it using the below command:

    ffmpeg -i myvideo.mp4 -vn -acodec copy audio.ogg

Replace myvideo.mp4 with the video filename/path, and audio.ogg 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).

What if you just want to extract only a portion of the audio from a video? Use the same audio format used by the original source. And check the below command line:

    ffmpeg -i myvideo.mp4 -ss 00:00:00 -t 00:00:00.0 -vn -acodec copy audio.ogg

-ss is the start of the extracted audio timestamp, and -t is the audio duration. By using this command, you will be able to extract a certain portion of source audio file from video files using FFmpeg.

Part 2: Extract audio from video using best FFmpeg's alternative

If you are a programmer, it would be extremely easy to make FFmpeg extract audio from MP4 or other video files. But if you are just a regular movie fan and have no idea on the programming, FFmpeg might be a little bit complicated to you. It would be better for you to use FFmpeg alternatives to help you extract audio from videos. Leawo Prof. Media is the best alternative to FFmpeg for extracting audio from MP4 and other video files for you.

Leawo Prof. Media is a 11-in-1 media converter suite combo that offers you media conver

sion solutions upon 4K Blu-ray, Blu-ray, DVD, video, audio, picture, online videos, etc. It offers multiple functions including converting, burning, downloading, backup, editing, 3D movie creating, etc. With a video converter built in, Leawo Prof. Media enables you to easily extract audio from MP4 and other videos to save in various audio formats like MP3, AAC, FLAC, OGG, etc.

  • Leawo Prof. Media
  • Leawo Prof. Media 11

    An 11-in-1 All-inclusive Total Media Converter Ultimate Solution
    Convert All Media files of Video, Audio, 4K UHD Blu-ray and DVD
    Download Videos and Audios from 1000+ Sites
    Professional Photo Slideshow Maker and Burner
    Greatly Enhance Blu-ray/DVD/Video Output Effects

Download and install Leawo Prof. Media on your computer. Get source video files ready. And then follow the below guide to learn how to use Leawo Prof. Media to extract audio from MP4 or other video files.

Step 1: Enter Video Convert module

Launch Leawo Prof. Media after the installation. Then click the “Video Converter” option, or click the “Convert” menu to enter the “Convert” module.


Step 2. Import source video files

On the “Convert” module, click either “Add Video” button at the top left of program interface, or just drag the file directly to the main interface to browse and load source video files.

Step 3. Choose output format

Click the box next to “Add Photo” button to pop up a small panel, and then click the “Change” option to enter the Profile panel. Since you need to extract audio from video files, here you need to choose one audio profile from “Format > Common Audio” group, such as MP3 Audio.

If you need, you could adjust the parameters of selected profile to meet your devices more. To do this, click the “Edit” button to enter the Profile Settings panel, where you could adjust audio codec, audio bit rate, audio sample rate, audio channel, etc.

Step 4. Trim audio file

What if you only want to extract a portion of audio file from source video file? Don’t worry. Leawo Prof. Media also helps. With a built-in video editor, Leawo Prof. Media enables you to trim video length, crop video size, add watermark, adjust effect, and even create 3D movies. To extract a portion of audio file from source video, you could make use of the Trim feature. Click the edit icon in each loaded video file. On the Trim tab, just move the starting and ending slide bars to determine which portion you want to keep. Or, you could precisely set the Start Time and End Time to get desired audio clip extracted from video.

Note: You could also edit your video files like cropping, adjusting effect, adding watermark, applying 3D effect, removing noise, etc. Check how to edit video for detail.

Step 5: Set output directory

Click the green icon “Convert” at the top right corner of the main menu. And then on the sidebar, set an output directory in the “Save to” box. After that, click the bottom “Convert” button on the sidebar to start extracting audio from video files.

Actually, besides extracting audio file from video, Leawo Leawo Prof. Media also enables you to rip and convert 4K Blu-ray/DVD/Blu-ray, burn video/photos to Blu-ray/DVD, download online videos, copy and back up 4K Blu-ray/Blu-ray/DVD movies, etc. It even provides some useful bonus features such as media editing like adjusting effect, rotating video, adding image or text watermark, applying 3D effect, removing noise, designing disc menu, merging videos into one, etc.

Part 3: Comparison between FFmpeg and Leawo Prof. Media

With Leawo Prof. Media and FFmpeg able to help you extract audio from video files to save in various formats, which is better? What are the differences between these 2 media encoders? To help you get a more straightforward acknowledgement on these 2 media converter tools, we have made a comparison table for you below.

Leawo Prof. Media FFMPEG

Convert 4K Blu-ray/Blu-ray/DVD to video

Yes Yes

Convert video files

Yes Yes

Decrypt 4K Blu-ray/Blu-ray/DVD discs

Yes No

Get rid of disc protection and region restriction

Yes No

Convert 4K Blu-ray/Blu-ray/DVD disc, folder and ISO image file

Yes Only convert Blu-ray/DVD folders

Edit 4K Blu-ray/Blu-ray/DVD/video files

Yes. Trim, crop, add 3D effect, adjust video effect, rotate, add watermark, etc. Trim video files only

Select subtitles and audio tracks

Yes No

Adjust parameters of output video/audio files

Yes No

Create 3D movies out of 2D media files

Yes No

Play back 4K Blu-ray/Blu-ray/DVD/video/audio files

Yes No

Convert photos to slideshow video

Yes No

Burn photos to DVD/Blu-ray slideshow

Yes No

Copy and back up 4K Blu-ray/Blu-ray/DVD

Yes No

Burn photos to DVD/Blu-ray slideshow

Yes No

Download online videos and live streams

Yes Yes

Handle Cinavia Blu-ray discs

Yes No

Design disc menu

Yes No


Windows 7 and later, macOS 10.10 and later Windows, Mac, Linux

From the above comparison table, you could see the differences of function between Leawo Prof. Media and FFmpeg. Obviously, Leawo Prof. Media offers you more features and functions to help you get better digital entertainment. It could help you even handle 4K Blu-ray movies and play back up to 4K movies directly. On the contrast, FFmpeg is much computerizing. As a command liner tool, FFmpeg handles conversion tasks well, but requires technical knowledge to run it smoothly. Leawo Prof. Media is much easier to use. Even novices are able to complete audio extraction tasks smoothly. You could get a better converting experience from Leawo Prof. Media.