Video Metadata Analysis Guide: Understanding Video Information with FFprobe
Deep dive into video metadata, master the usage of FFprobe tool, learn to analyze container, video stream, and audio stream information.
Read More βMaster the core techniques of audio extraction and choose the most suitable bitrate and encoding mode
MP4 to MP3 conversion is essentially a process of audio extraction and re-encoding. MP4 is a container format that can contain multiple data streams such as video streams, audio streams, and subtitle streams. When we convert MP4 to MP3, we are actually extracting the audio data from the MP4 container and then encoding it into MP3 format.
Audio in MP4 files typically uses the following encoding formats:
In most cases, the audio in MP4 is in AAC format. Converting to MP3 requires lossy-to-lossy re-encoding, which will result in some quality loss. Understanding this is important for choosing the appropriate bitrate.
Bitrate is the most important factor affecting MP3 sound quality and file size. The higher the bitrate, the better the sound quality, but the larger the file. Choosing the right bitrate requires finding a balance between sound quality and file size.
320kbps is the highest bitrate supported by the MP3 format, with sound quality close to CD level, suitable for scenarios with high sound quality requirements.
256kbps is a good balance point, with excellent sound quality but much smaller files than 320kbps.
192kbps is one of the most commonly used bitrates, with good sound quality and moderate file size.
128kbps was the mainstream bitrate for early internet music, now mainly used for speech content and scenarios with limited storage space.
There are two main bitrate control methods for MP3 encoding: VBR (Variable Bitrate) and CBR (Constant Bitrate). Understanding their differences is important for achieving the best quality-to-file ratio.
CBR (Constant Bitrate) means the entire audio file uses the same bitrate. Regardless of whether the audio content is complex or not, the amount of data per second is fixed.
ffmpeg -i input.mp4 -c:a libmp3lame -b:a 192k output.mp3
VBR (Variable Bitrate) dynamically adjusts the bitrate according to the complexity of the audio content. Complex segments use higher bitrates, and simple segments use lower bitrates.
Using the VBR mode of the LAME encoder, quality is controlled by the -q:a parameter, with a value range of 0-9, smaller values mean higher quality:
ffmpeg -i input.mp4 -c:a libmp3lame -q:a 2 output.mp3
ID3 tags are metadata stored in MP3 files that contain song information such as song title, artist, album, cover image, etc. Adding complete ID3 tags allows music players to better manage and display music information.
Use FFmpeg's metadata parameter to add ID3 tags:
ffmpeg -i input.mp4 -c:a libmp3lame -q:a 2 \
-metadata title="Song Title" \
-metadata artist="Artist" \
-metadata album="Album Name" \
-metadata year="2026" \
-metadata track="1/10" \
-metadata genre="Pop" \
output.mp3
MP3 files can embed cover images to display album art in players:
ffmpeg -i input.mp4 -i cover.jpg -c:a libmp3lame -q:a 2 \
-c:v mjpeg -map 0:a -map 1:v \
-metadata:s:v title="Album cover" \
-metadata:s:v comment="Cover (front)" \
output.mp3
When there are a large number of MP4 files that need audio extraction, manual processing one by one is too inefficient. Below are several batch processing methods.
Create a batch file extract_audio.bat:
@echo off
for %%i in (*.mp4) do (
echo Extracting audio from "%%i" ...
ffmpeg -i "%%i" -c:a libmp3lame -q:a 2 "%%~ni.mp3"
)
echo All done!
pause
#!/bin/bash
for file in *.mp4; do
echo "Extracting audio from $file ..."
ffmpeg -i "$file" -c:a libmp3lame -q:a 2 "${file%.mp4}.mp3"
done
echo "All done!"
Extract only a segment of audio from the video:
ffmpeg -ss 00:01:30 -t 00:03:00 -i input.mp4 -c:a libmp3lame -q:a 2 output.mp3
-ss specifies the start time, -t specifies the duration.
Many people are concerned about the sound quality differences between different bitrates. Below are some objective and subjective comparison references.
Based on hearing tests of most people:
The simplest audio extraction command, using default parameters:
ffmpeg -i input.mp4 output.mp3
ffmpeg -i input.mp4 -b:a 320k output.mp3
ffmpeg -i input.mp4 -c:a libmp3lame -q:a 2 output.mp3
If the video has multiple audio tracks, select one of them:
ffmpeg -i input.mp4 -map 0:a:1 -c:a libmp3lame -q:a 2 output.mp3
0:a:1 indicates the second audio stream of the first file (index starts from 0).
MP4 to MP3 is one of the most common audio processing needs. By choosing the right bitrate and encoding mode, you can find the best balance between sound quality and file size. VBR mode is usually the best choice, as it provides better sound quality at the same file size.
If you don't want to install FFmpeg or memorize complex commands, you can use our MP4 to MP3 Online Tool, simply upload video files in your browser, select appropriate quality parameters, and extract audio with one click.
More great articles and practical tools
Deep dive into video metadata, master the usage of FFprobe tool, learn to analyze container, video stream, and audio stream information.
Read More βCompare the advantages and disadvantages of four WebM to MP4 methods, master FFmpeg efficient conversion techniques and batch processing solutions.
Read More βCollection of the most practical FFmpeg commands, covering transcoding, editing, merging, audio extraction and other common operations.
Read More βUse our free MP4 to MP3 online tool, no software installation required, extract high-quality audio directly in your browser
Try Now β‘