以下是直播信息
Program 0
Metadata:
variant_bitrate : 660144
Stream #0:0(en): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp (default)
Metadata:
comment : English
Stream #0:1: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:2(hi): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
Metadata:
comment : Hindi
Stream #0:3: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:4(bn): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
Metadata:
comment : Bengali
Stream #0:5: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:6(mr): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
Metadata:
comment : Marathi
Stream #0:7: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:8: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 660144
Stream #0:9: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
Metadata:
variant_bitrate : 660144
Stream #0:10: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 660144
Program 1
Metadata:
variant_bitrate : 944962
Stream #0:0(en): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp (default)
Metadata:
comment : English
Stream #0:1: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:2(hi): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
Metadata:
comment : Hindi
Stream #0:3: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:4(bn): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
Metadata:
comment : Bengali
Stream #0:5: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:6(mr): Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, mono, fltp
Metadata:
comment : Marathi
Stream #0:7: Data: timed_id3 (ID3 / 0x20334449)
Stream #0:11: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 944962
Stream #0:12: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp
Metadata:
variant_bitrate : 944962
Stream #0:13: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 944962
我希望从程序 1 映射 0:11 和 0:2。可能需要 p:program_id[:stream_index]。
这是我尝试过的,但每当命令成功执行时,它就会从程序 0 映射 0:0 两次。
ffmpeg -i "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_eyx5tw99/format/applehttp/defaultAudioLang/English/tags/tv_hd/f/a.m3u8" -map p:1:#0:11 -map p:1:#0:2 -c copy video101.ts
ffmpeg -i "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_eyx5tw99/format/applehttp/defaultAudioLang/English/tags/tv_hd/f/a.m3u8" -map p:1:#11 -map p:1:#2 -c copy video101.ts
ffmpeg -i "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_eyx5tw99/format/applehttp/defaultAudioLang/English/tags/tv_hd/f/a.m3u8" -map p:1:[0:11] -map p:1:[0:2] -c copy video101.ts
ffmpeg -i "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_eyx5tw99/format/applehttp/defaultAudioLang/English/tags/tv_hd/f/a.m3u8" -map p:1:[:11] -map p:1:[:2] -c copy video101.ts
ffmpeg -i "https://cdnapisec.kaltura.com/p/1982551/sp/198255100/playManifest/protocol/https/entryId/0_eyx5tw99/format/applehttp/defaultAudioLang/English/tags/tv_hd/f/a.m3u8" -map p:Program 1:[:11] -map p:Program 1:[:2] -c copy video101.ts
答案1
快到了。
... -map p:1:8 -map p:1:2 -c copy video101.ts
流id指的是程序中的流位置(从0开始)
在这种特殊情况下,您还可以使用绝对流 ID,因为流在不同的程序中重新列出但引用相同的底层流。
... -map 0:11 -map 0:2 -c copy video101.ts