[FFmpeg-user] HLS to MCAST
Максим Молодцов
molodtsov40 at gmail.com
Thu Dec 3 12:45:00 EET 2020
Hello,
I've faced with a strange issue. When I try to get an HLS stream and
convert it to multicast, like this:
ffmpeg -re -timeout 60000000 -m3u8_hold_counters 5 -i http://xxx/HLS/HD.m3u8
> -codec:v copy -codec:a copy -f mpegts 'udp://127.0.0.1:1234?pkt_size=1316'
>
everything works fine for several hours:
[http @ 0x25a6280] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x2413540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x2413540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> [http @ 0x2582800] Opening 'http://xxx/HLS/HD2.ts' for reading
> frame=191103 fps= 25 q=-1.0 size= 5083538kB time=02:07:24.07
> bitrate=5447.9kbits/s speed= 1x
> frame=191114 fps= 25 q=-1.0 size= 5083940kB time=02:07:24.51
> bitrate=5448.0kbits/s speed= 1x
> frame=191127 fps= 25 q=-1.0 size= 5084228kB time=02:07:25.03
> bitrate=5448.0kbits/s speed= 1x
> frame=191139 fps= 25 q=-1.0 size= 5084568kB time=02:07:25.51
> bitrate=5448.0kbits/s speed= 1x
> frame=191151 fps= 25 q=-1.0 size= 5084895kB time=02:07:25.99
> bitrate=5448.0kbits/s speed= 1x
> frame=191165 fps= 25 q=-1.0 size= 5085242kB time=02:07:26.55
> bitrate=5448.0kbits/s speed= 1x
> frame=191179 fps= 25 q=-1.0 size= 5085529kB time=02:07:27.11
> bitrate=5447.9kbits/s speed= 1x
> frame=191192 fps= 25 q=-1.0 size= 5085904kB time=02:07:27.63
> bitrate=5447.9kbits/s speed= 1x
> frame=191202 fps= 25 q=-1.0 size= 5086246kB time=02:07:28.03
> bitrate=5448.0kbits/s speed= 1x
> frame=191215 fps= 25 q=-1.0 size= 5086591kB time=02:07:28.55
> bitrate=5448.0kbits/s speed= 1x
> frame=191227 fps= 25 q=-1.0 size= 5086912kB time=02:07:29.03
> bitrate=5448.0kbits/s speed= 1x
> frame=191239 fps= 25 q=-1.0 size= 5087258kB time=02:07:29.51
> bitrate=5448.0kbits/s speed= 1x
> [http @ 0x25a6280] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x2413540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x2413540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> [http @ 0x25684c0] Opening 'http://xxx/HLS/HD3.ts' for reading
> frame=191252 fps= 25 q=-1.0 size= 5087605kB time=02:07:30.03
> bitrate=5448.0kbits/s speed= 1x
> frame=191266 fps= 25 q=-1.0 size= 5087919kB time=02:07:30.59
> bitrate=5448.0kbits/s speed= 1x
> frame=191279 fps= 25 q=-1.0 size= 5088265kB time=02:07:31.11
> bitrate=5448.0kbits/s speed= 1x
> frame=191290 fps= 25 q=-1.0 size= 5088586kB time=02:07:31.55
> bitrate=5448.0kbits/s speed= 1x
> frame=191303 fps= 25 q=-1.0 size= 5088931kB time=02:07:32.07
> bitrate=5448.0kbits/s speed= 1x
> frame=191315 fps= 25 q=-1.0 size= 5089249kB time=02:07:32.55
> bitrate=5448.0kbits/s speed= 1x
> frame=191327 fps= 25 q=-1.0 size= 5089594kB time=02:07:33.03
> bitrate=5448.0kbits/s speed= 1x
> frame=191341 fps= 25 q=-1.0 size= 5089967kB time=02:07:33.59
> bitrate=5448.0kbits/s speed= 1x
> frame=191354 fps= 25 q=-1.0 size= 5090260kB time=02:07:34.11
> bitrate=5448.0kbits/s speed= 1x
> frame=191367 fps= 25 q=-1.0 size= 5090612kB time=02:07:34.63
> bitrate=5448.0kbits/s speed= 1x
> frame=191380 fps= 25 q=-1.0 size= 5090923kB time=02:07:35.15
> bitrate=5447.9kbits/s speed= 1x
> frame=191393 fps= 25 q=-1.0 size= 5091242kB time=02:07:35.67
> bitrate=5447.9kbits/s speed= 1x
> [http @ 0x25a6280] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x2413540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x2413540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> ...
>
But after a few hours, the multicast monitoring tool gives out:
> Nov 07 00:51:01: INFO: Bitrate: 30287 Kbit/s
> Nov 07 00:51:02: INFO: Bitrate: 9610 Kbit/s
> Nov 07 00:51:03: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:04: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:05: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:06: INFO: Bitrate: 36193 Kbit/s
> Nov 07 00:51:07: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:08: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:09: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:10: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:11: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:12: INFO: Bitrate: 12801 Kbit/s
> Nov 07 00:51:13: INFO: Bitrate: 10757 Kbit/s
> Nov 07 00:51:14: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:15: INFO: Bitrate: 0 Kbit/s
> Nov 07 00:51:16: INFO: Bitrate: 0 Kbit/s
>
and in the ffmpeg log I see fewer lines between
> Opening 'http://xxx/HLS/HD2.ts' for reading
>
:
[http @ 0x2765200] Opening 'http://xxx/HLS/HD0.ts' for reading
> frame=1845421 fps= 25 q=-1.0 size=49087105kB time=20:30:20.83
> bitrate=5447.3kbits/s speed= 1x
> [http @ 0x2888200] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x275c540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x275c540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> [http @ 0x2765200] Opening 'http://xxx/HLS/HD1.ts' for reading
> frame=1845545 fps= 25 q=-1.0 size=49090424kB time=20:30:25.79
> bitrate=5447.3kbits/s speed= 1x
> [http @ 0x2888200] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x275c540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x275c540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> [http @ 0x2765200] Opening 'http://xxx/HLS/HD2.ts' for reading
> frame=1845658 fps= 25 q=-1.0 size=49093442kB time=20:30:30.31
> bitrate=5447.3kbits/s speed= 1x
> frame=1845711 fps= 25 q=-1.0 size=49094883kB time=20:30:32.43
> bitrate=5447.3kbits/s speed= 1x
> frame=1845742 fps= 25 q=-1.0 size=49095669kB time=20:30:33.67
> bitrate=5447.3kbits/s speed= 1x
> [http @ 0x2888200] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x275c540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x275c540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> [http @ 0x2765200] Opening 'http://xxx/HLS/HD3.ts' for reading
> frame=1845775 fps= 25 q=-1.0 size=49096571kB time=20:30:34.99
> bitrate=5447.3kbits/s speed= 1x
> frame=1845840 fps= 25 q=-1.0 size=49098299kB time=20:30:37.59
> bitrate=5447.3kbits/s speed= 1x
> [http @ 0x2888200] Opening 'http://xxx/HLS/HD.m3u8' for reading
> [hls @ 0x275c540] Skip ('#EXT-X-VERSION:3')
> [hls @ 0x275c540] Skip ('#EXT-X-ALLOW-CACHE:NO')
> [http @ 0x2765200] Opening 'http://xxx/HLS/HD4.ts' for reading
> frame=1845919 fps= 25 q=-1.0 size=49100389kB time=20:30:40.75
> bitrate=5447.3kbits/s speed= 1x
> [http @ 0x2888200] Opening 'http://xxx/HLS/HD.m3u8' for reading
>
Restarting ffmpeg solves the issue for a few hours.
I tried different versions of ffmpeg from 2.5 to 4.3.1 with the same result.
What could be the reason for this behavior?
Thanks!
More information about the ffmpeg-user
mailing list