FFmpeg - Selecting streams: Difference between revisions

From PiRho Knowledgebase
Jump to navigationJump to search
Created page with "The <code>-map</code> option is used to choose which streams from the input(s) should be included in the output(s). The <code>-map</code> option can also be used to exclude specific streams with negative mapping. When the <code>-map</code> option is used, only the selected streams will be included in the output.<br/> The code below selects the 1st video stream from the 1st input file and the 1st audio stream in the 2nd input file:<br/> <code>ffmpeg -i <input.mp4> -i <inp..."
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Category:FFmpeg]]
The <code>-map</code> option is used to choose which streams from the input(s) should be included in the output(s). The <code>-map</code> option can also be used to exclude specific streams with negative mapping. When the <code>-map</code> option is used, only the selected streams will be included in the output.<br/>
The <code>-map</code> option is used to choose which streams from the input(s) should be included in the output(s). The <code>-map</code> option can also be used to exclude specific streams with negative mapping. When the <code>-map</code> option is used, only the selected streams will be included in the output.<br/>
The code below selects the 1st video stream from the 1st input file and the 1st audio stream in the 2nd input file:<br/>
The code below selects the 1st video stream from the 1st input file and the 1st audio stream in the 2nd input file:<br/>
<code>ffmpeg -i <input.mp4> -i <input.mkv> -map 0:v:0 -map 1:a:0 <output.file></code><br/>
<code>ffmpeg -i <input.mp4> -i <input.mkv> -map 0:v:0 -map 1:a:0 <output.file></code><br/>
Reference: [[https://trac.ffmpeg.org/wiki/Map FFmpeg: Selecting streams with the -map option]]
Reference: [[https://trac.ffmpeg.org/wiki/Map FFmpeg: Selecting streams with the -map option]]

Latest revision as of 11:47, 6 March 2025

The -map option is used to choose which streams from the input(s) should be included in the output(s). The -map option can also be used to exclude specific streams with negative mapping. When the -map option is used, only the selected streams will be included in the output.
The code below selects the 1st video stream from the 1st input file and the 1st audio stream in the 2nd input file:
ffmpeg -i <input.mp4> -i <input.mkv> -map 0:v:0 -map 1:a:0 <output.file>
Reference: [FFmpeg: Selecting streams with the -map option]