Ich stehe vor einem ffmpeg Problem und vor einem Rätsel. Vielleicht hat ja einer Idee, weil mir diese aktuell ausgegangen sind.
Situation:
Aus einem Stream will ich die Audio- und Video-Daten extrahieren und nach mpegts muxen. Soweit so gut. Allerdings transcodiert ffmpeg das Video immer nach mpeg2video und Audio nach mp2, obwohl die Quelle h264 und aac ist. Das passiert sowohl auf dem N2+, als auch auf dem Desktop.
Beide Aufruf machen das Transcoding:
ffmpeg -re -y -i https://swrswr3vr-hls.akamaized.net/hls/live/2018683/swr3vr/master.m3u8 -map 0:6 -c:6 copy -f mpegts out.ts
ffmpeg -re -y -analyzeduration 100M -probesize 100M -i https://swrswr3vr-hls.akamaized.net/hls/live/2018683/swr3vr/master.m3u8 -map 0:6 -c:6 copy -f mpegts out.ts
Der Stream 6 ist ein h264 Video und die Ausgabe sieht so aus:
[https @ 0x56200f9da9c0] Opening 'https://swrswr3vr-hls.akamaized.net/hls/live/2018683-b/swr3vr/20240612T094249/master-270p-828/00260/master-270p-828_00456.ts' for reading
Input #0, hls, from 'https://swrswr3vr-hls.akamaized.net/hls/live/2018683/swr3vr/master.m3u8':
Duration: N/A, start: 77459.961867, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 1672000
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 1672000
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1672000
Program 1
Metadata:
variant_bitrate : 1672000
Stream #0:2: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 640x360 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 1672000
Stream #0:3: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1672000
Program 2
Metadata:
variant_bitrate : 6520800
Stream #0:4: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 6520800
Stream #0:5: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 6520800
Program 3
Metadata:
variant_bitrate : 6520800
Stream #0:6: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 6520800
Stream #0:7: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 6520800
Program 4
Metadata:
variant_bitrate : 4224000
Stream #0:8: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 4224000
Stream #0:9: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 4224000
Program 5
Metadata:
variant_bitrate : 4224000
Stream #0:10: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 4224000
Stream #0:11: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 4224000
Program 6
Metadata:
variant_bitrate : 2182400
Stream #0:12: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 960x540 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 2182400
Stream #0:13: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 2182400
Program 7
Metadata:
variant_bitrate : 2182400
Stream #0:14: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 960x540 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 2182400
Stream #0:15: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 2182400
Program 8
Metadata:
variant_bitrate : 1034000
Stream #0:16: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 480x270 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 1034000
Stream #0:17: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1034000
Program 9
Metadata:
variant_bitrate : 1034000
Stream #0:18: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 480x270 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn
Metadata:
variant_bitrate : 1034000
Stream #0:19: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1034000
Stream mapping:
Stream #0:6 -> #0:0 (h264 (native) -> mpeg2video (native))
Press [q] to stop, [?] for help
Output #0, mpegts, to 'out.ts':
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 50 fps, 90k tbn
Metadata:
variant_bitrate : 6520800
encoder : Lavc60.3.100 mpeg2video
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 88 fps= 43 q=31.0 Lsize= 912kB time=00:00:01.72 bitrate=4343.2kbits/s speed=0.838x
video:874kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.372416%
Exiting normally, received signal 2.
Wie man sieht
Stream mapping:
Stream #0:6 -> #0:0 (h264 (native) -> mpeg2video (native))
Warum nur? Und wie kann ich das verhindern? Mit z.B. Streams aus der Mediathek funktioniert es doch einwandfrei.