Ffmpeg Map Filter Option

What does below ffmpeg option do?

 -map [v] -map [a]

and

 -map 0

I have read this but still not able to understand exactly what it does and when to use them?

1 Answer

The -map option can refer to arbitrary stream labels or specific input streams.

  • -map [v] -map [a] – Select the streams arbitrarily labeled v and a. For example, these could be the outputs of filtering:

    ffmpeg -i input -filter_complex "[0:v]scale=iw/2:-1[v];[0:a]afade=d=5[a]" -map "[v]" -map "[a]" output
    
  • -map 0 – Select all streams from input 0. ffmpeg begins counting from 0, so this is the first input; using -map 4 would refer to the fifth input. Because the default stream selection behavior only chooses one stream per stream type, using -map 0 is useful if you want to select all streams from input 0. Example:

    ffmpeg -i input0 -i input1 -map 0 -map 1 output
    

Also see:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest