tinparkBlog |||

OSX

  • install the easiest package manager out there BREW;
  • Paste the below into your terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  • Run the command brew install ffmpeg
  • Check, has it been installed by typing ffmpeg -h

WINDOWS

  • install the easiest package manager out there Chocolatey
  • Open your powershell or command prompt running as admin Here’s how to do it
  • Run the command choco install ffmpeg
  • Check it has been installed by typing ffmpeg -h

use FFMPEG to generate an extract to analyise

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.

REAL WORLD EXAMPLE - OSX

  • point your terminal to the directory where your .mkv sits.
  • cd ~/Dropbox/UoE-paperwork/teaching/Programme/soundtracksForScreen/03_Submission1-HOW-To/ hit enter after entering the path
  • you can drag and drop a folder right after you have typed cd

REAL WORLD EXAMPLE - WINDOWS

  • point powershell to the directory where your .mkv sits.
  • cd C:Users\mparker\Dropbox\UoE-paperwork\teaching\Programme\soundtracksForScreen\03_Submission1-HOW-To\
  • in the explorer you can copy path in the list of options under the Home tab

Play the film in VLC

Watch the film and note the start point of the part you want to extract

choose a segment

Note the starting point

00:29:05 = 29minutes and 5 seconds in

set the length of the extract (no more than 3min)

00:03:00 = lasting for three minutes

copy everything to a new file

ffmpeg -ss 00:29:05 -i "path/to/film.mkv" -t 00:03:00 -codec copy -map 0 "path/to/film_extract.mkv"

REAL WORLD EXAMPLE -OSX

ffmpeg -ss 00:10:20 -i Gravity_crunched.mkv -t 00:03:00 -codec copy -map 0 myGravityExtract.mkv

REAL WORLD EXAMPLE - windows

ffmpeg -ss 00:10:20 -i Gravity_crunched.mkv -t 00:03:00 -codec copy -map 0 myGravityExtract.mkv

extract the audio only stream

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.

Select different channels to extract

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.

Now you can extract different audio channels from your extract

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"

Up next Using TEAMS for teaching and tutoring
Latest posts Install FFMPEG Using TEAMS for teaching and tutoring denoising your home recordings pushToBlot - p2b.sh The sound of the Corona Spring In the field, on the street randomising soundfile playing listening to film Adapting In a large open space by James Tenney for Unity Game Engine mpAmbiDecoder some examples instructions - academic writing in markdown