| 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" |
| | 175 | MPEG stream selection: |
| | 176 | |
| | 177 | The 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 | {{{ |
| | 179 | ffmpeg -i INPUT -map 0:6 OUTPUT # might not work the same every run. |
| | 180 | }}} |
| | 181 | |
| | 182 | Assuming your file is like this: |
| | 183 | {{{ |
| | 184 | $ ffmpeg -i INPUT |
| | 185 | ... |
| | 186 | Input #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 | }}} |
| | 204 | you could specify desired streams by program id: |
| | 205 | {{{ |
| | 206 | ffmpeg -i INPUT -map 0:p:1344 OUTPUT # pulls in both inputs from program 1344 |
| | 207 | }}} |
| | 208 | or specify a child stream: |
| | 209 | {{{ |
| | 210 | ffmpeg -i INPUT -map i:0x401 OUTPUT # pulls in input stream 0x401 |
| | 211 | }}} |
| | 212 | or 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 == |
| | 215 | Include "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" |