Changes between Version 8 and Version 9 of Map


Ignore:
Timestamp:
Dec 30, 2015, 9:20:28 PM (3 years ago)
Author:
rogerdpack
Comment:

add MPEG select example yikes

Legend:

Unmodified
Added
Removed
Modified
  • Map

    v8 v9  
    173173 
    174174== Example 8 == 
    175 Copy "all" inputs to the output.  The default behavior is to copy only one audio and one video channel.  If you want to copy 'all' channels, use "-map" 
     175MPEG stream selection: 
     176 
     177The tricky part with selecting from MPEG TS is it may contain multiple streams/channels, and if you are receiving "live data" just specifying an index might not work because it can change from run to run, so 
     178{{{ 
     179ffmpeg -i INPUT -map 0:6 OUTPUT # might not work the same every run. 
     180}}} 
     181 
     182Assuming your file is like this: 
     183{{{  
     184$ ffmpeg -i INPUT 
     185... 
     186Input #0, mpegts, from 'INPUT': 
     187  Duration: N/A, start: 22159.226833, bitrate: N/A 
     188  Program 1344 
     189    Metadata: 
     190      service_name    : 7 Digital 
     191      service_provider: Seven Network 
     192    Stream #0:0[0x401]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 14950 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc 
     193    Stream #0:1[0x402](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 256 kb/s 
     194  Program 1346 
     195    Metadata: 
     196      service_name    : 7TWO 
     197      service_provider: Seven Network 
     198    Stream #0:3[0x406]: Unknown: none ([5][0][0][0] / 0x0005) 
     199    Stream #0:6[0x421]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 720x576 [SAR 64:45 DAR 16:9], max. 14950 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc 
     200    Stream #0:7[0x422](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s 
     201    Stream #0:8[0x424](eng): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006), 492x250 
     202    Stream #0:4[0x499]: Unknown: none ([11][0][0][0] / 0x000B) 
     203}}} 
     204you could specify desired streams by program id: 
     205{{{ 
     206ffmpeg -i INPUT -map 0:p:1344 OUTPUT # pulls in both inputs from program 1344 
     207}}} 
     208or specify a child stream: 
     209{{{ 
     210ffmpeg -i INPUT -map i:0x401 OUTPUT # pulls in input stream 0x401 
     211}}} 
     212or similar, see other specifier examples.   NB if you have "unknown" streams in there you may need to add the -ignore_unknown flag as well. 
     213 
     214== Example 9 == 
     215Include "all" inputs to the output.  The default behavior is to copy only one audio and one video channel.  If you want to copy 'all' channels, use "-map" 
    176216{{{ 
    177217ffmpeg -i input -map 0 output.mp4 # re encodes all video and audio channels from input one