Do you need to work with a movie file with multiple audio tracks, but your tool can only import one of them? Learn how to extract all the tracks from any movie file using FFmpeg, a free cross-platform tool.
Links and full commands are provided after the chapter list below:
00:00 Intro
00:18 Example file with 2 audio tracks
01:27 What is FFmpeg?
02:40 Installing FFmpeg
03:45 Step 0: Open a terminal
04:20 Step 1: Determining how many audio tracks there are
06:07 Step 2a: Extracting the Tracks (to .WAV)
07:42 Step 2b (or not): Play back the extracted Track
09:08 Step 3: Use your extracted Track
09:39 Bonus 1: Raw Extract
11:40 Bonus 2: Looping
13:31 Closing words
FFmpeg downloads are available here:
https://www.ffmpeg.org/download.html
The sample movie file with 2 audio tracks is available here:
https://github.com/ietf-wg-cellar/mat...
-------------
Listing of Commands executed within this video::
A short description precedes each command as a "#" comment
Command to install FFmpeg for a Debian-based Linux OS
sudo apt install ffmpeg
Command to list info about a movie file. (Note: the "-i" is optional for ffprobe)
ffprobe -i moviefile.ext
Command to list just the audio tracks. Since there's less text displayed, it's also easier to spot the audio codecs used.
NOTE: replace the > in this command with a greater-than sign
ffprobe -i moviefile.ext 2>&1 | grep --colour -99 'Stream.*Audio'
Extract the 1st track to an uncompressed WAV audio file
ffmpeg -i moviefile.ext -map 0:a:0 track0.wav
Play the 1st extracted track
ffplay track0.wav
Extract the 2nd track to an uncompressed WAV audio file
ffmpeg -i moviefile.ext -map 0:a:1 track1.wav
Play the 2nd extracted track
ffplay track1.wav
Copy the 1st track out exactly, assuming it uses the AAC audio codec
ffmpeg -i moviefile.ext -map 0:a:0 -c copy track0.aac
Loop through the extraction of the first 2 audio tracks
for x in 0 1
do
ffmpeg -i moviefile.ext -map 0:a:$x track$x.wav
done