/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install ffmpeg
ffmpeg -h
choco install ffmpeg
ffmpeg -h
ffmpeg -i "path/to/film.mkv"
Will print information about the movie to the console. This is helpful to see what streams you have available and which ones you might like to work with later.
.mkv
sits.cd ~/Dropbox/UoE-paperwork/teaching/Programme/soundtracksForScreen/03_Submission1-HOW-To/
hit enter after entering the pathcd
.mkv
sits.cd C:Users\mparker\Dropbox\UoE-paperwork\teaching\Programme\soundtracksForScreen\03_Submission1-HOW-To\
Home
tabWatch the film and note the start point of the part you want to extract
Note the starting point
00:29:05
= 29minutes and 5 seconds in
00:03:00
= lasting for three minutes
ffmpeg -ss 00:29:05 -i "path/to/film.mkv" -t 00:03:00 -codec copy -map 0 "path/to/film_extract.mkv"
ffmpeg -ss 00:10:20 -i Gravity_crunched.mkv -t 00:03:00 -codec copy -map 0 myGravityExtract.mkv
ffmpeg -ss 00:10:20 -i Gravity_crunched.mkv -t 00:03:00 -codec copy -map 0 myGravityExtract.mkv
ffmpeg -i "path/to/film_extract.mkv" -f wav -vn "path/to/audioTack.wav"
Usually the surround stream is the second stream in the file and this will grab that by default.
If it’s not there, or you want a different stream, you can select which stream you want to map to the output:
ffmpeg -i "path/to/film_extract.mkv" -f wav -map 0:2 "path/to/audioTrack.wav"
This will choose the third stream in your .mkv
file.
To extract the centre channel from the .mkv
you will need to know the channel order.
Have a look at the info about the extract
ffmpeg -i "path/to/film_extract.mkv"
Note the stream id and the description of the audio format layout.
Remind yourself of the layout names that FFMPEG uses
ffmpeg -layouts
This will show you the naming conventions for different audio layouts.
ffmpeg -i "path/to/film_extract.mkv" -f wav -vn -map_channel 0.1.0 "path/to/frontLeft.wav"
In the above example, you will see that the final 0
corresponds to the first channel. Channels are counted from 0
. So to get the sub channel–channel 4, you would use the command -map_channel 0.1.3
.
The example below extracts the final channel, rightSurround, channel 6, number 5:
ffmpeg -i "path/to/film_extract.mkv" -f wav -vn -map_channel 0.1.5 "path/to/rightSurround.wav"