[FFmpeg-user] ffmpeg doesn't reconnect when capturing live connections
arthurpeabody
arthurpeabody at rickstewart.com
Fri Jan 31 07:39:23 EET 2025
It begins with:
ffmpeg -i https://listen.wruu.org/stream -t 3720 -reconnect true -reconnect_streamed true -reconnect_on_network_error true -timelimit 3720 -loglevel warning wruu_JoeFrank-20250130-2100.mp3
ffmpeg version 7.1 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 14.2.0 (GCC)
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-7.1/html --mandir=/usr/man --disable-debug --enable-shared --disable-static --enable-gpl --enable-version3 --arch=x86_64 --disable-encoder=aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libcdio --enable-frei0r --enable-openal --enable-libopus --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libmp3lame --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libpulse --enable-libsmbclient --enable-libxml2 --enable-librsvg --enable-vulkan --enable-libdrm --enable-libaom --enable-libdav1d --enable-libshaderc --enable-gcrypt --enable-libplacebo --enable-lcms2
libavutil 59. 39.100 / 59. 39.100
libavcodec 61. 19.100 / 61. 19.100
libavformat 61. 7.100 / 61. 7.100
libavdevice 61. 3.100 / 61. 3.100
libavfilter 10. 4.100 / 10. 4.100
libswscale 8. 3.100 / 8. 3.100
libswresample 5. 3.100 / 5. 3.100
libpostproc 58. 3.100 / 58. 3.100
Splitting the commandline.
Reading option '-i' ... matched as input url with argument 'https://listen.wruu.org/stream'.
Reading option '-t' ... matched as option 't' (stop transcoding after specified duration) with argument '3720'.
Reading option '-reconnect' ... matched as AVOption 'reconnect' with argument 'true'.
Reading option '-reconnect_streamed' ... matched as AVOption 'reconnect_streamed' with argument 'true'.
Reading option '-reconnect_on_network_error' ... matched as AVOption 'reconnect_on_network_error' with argument 'true'.
Reading option '-timelimit' ... matched as option 'timelimit' (set max runtime in seconds in CPU user time) with argument '3720'.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '48'.
Reading option 'wruu_JoeFrank-20250130-2100.mp3' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option timelimit (set max runtime in seconds in CPU user time) with argument 3720.
Applying option v (set logging level) with argument 48.
Successfully parsed a group of options.
Parsing a group of options: input url https://listen.wruu.org/stream.
Successfully parsed a group of options.
Opening an input file: https://listen.wruu.org/stream.
[AVFormatContext @ 0x36542540] Opening 'https://listen.wruu.org/stream' for reading
[https @ 0x365388c0] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
size= 9984KiB time=00:10:48.15 bitrate= 126.2kbits/s speed=0.0019x
[tcp @ 0x36542e00] Original list of addresses:
[tcp @ 0x36542e00] Address 165.227.18.155 port 443
[tcp @ 0x36542e00] Interleaved list of addresses:
[tcp @ 0x36542e00] Address 165.227.18.155 port 443
[tcp @ 0x36542e00] Starting connection attempt to 165.227.18.155 port 443
[tcp @ 0x36542e00] Successfully connected to 165.227.18.155 port 443
[https @ 0x365388c0] request: GET /stream HTTP/1.1
User-Agent: Lavf/61.7.100
Accept: */*
Range: bytes=0-
Connection: close
Host: listen.wruu.org
Icy-MetaData: 1
[mp3 @ 0x36542540] Format mp3 probed with size=4096 and score=51
[mp3 @ 0x36542540] Skipping 0 bytes of junk at 0.
[mp3 @ 0x36542540] Before avformat_find_stream_info() pos: 0 bytes read:7569 seeks:0 nb_streams:1
[https @ 0x365388c0] Metadata update for StreamTitle: - WRUU-WRUU
[mp3 @ 0x36542540] All info found
[mp3 @ 0x36542540] After avformat_find_stream_info() pos: 31744 bytes read:32000 seeks:0 frames:50
Input #0, mp3, from 'https://listen.wruu.org/stream':
Metadata:
icy-br : 192
icy-channels : 2
icy-name : WRUU 2022
icy-pub : 1
icy-samplerate : 44100
StreamTitle : - WRUU-WRUU
Duration: N/A, start: 0.000000, bitrate: 192 kb/s
Stream #0:0, 50, 1/14112000: Audio: mp3 (mp3float), 44100 Hz, stereo, fltp, 192 kb/s
Successfully opened the file.
Parsing a group of options: output url wruu_JoeFrank-20250130-2100.mp3.
Applying option t (stop transcoding after specified duration) with argument 3720.
Successfully parsed a group of options.
Opening an output file: wruu_JoeFrank-20250130-2100.mp3.
[out#0/mp3 @ 0x36888b80] No explicit maps, mapping streams automatically...
[aost#0:0/libmp3lame @ 0x36889c80] Created audio stream from input stream 0:0
[file @ 0x3689d1c0] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
Stream #0:0 -> #0:0 (mp3 (mp3float) -> mp3 (libmp3lame))
[aost#0:0/libmp3lame @ 0x36889c80] Starting thread...
[af#0:0 @ 0x36546c00] Starting thread...
[aist#0:0/mp3 @ 0x3655f340] [dec:mp3float @ 0x368786c0] Starting thread...
[in#0/mp3 @ 0x36542280] Starting thread...
Press [q] to stop, [?] for help
detected 4 logical cores
[graph_-1_in_0:0 @ 0x7fdb580022c0] Setting 'time_base' to value '1/44100'
[graph_-1_in_0:0 @ 0x7fdb580022c0] Setting 'sample_rate' to value '44100'
[graph_-1_in_0:0 @ 0x7fdb580022c0] Setting 'sample_fmt' to value 'fltp'
[graph_-1_in_0:0 @ 0x7fdb580022c0] Setting 'channel_layout' to value 'stereo'
[graph_-1_in_0:0 @ 0x7fdb580022c0] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:stereo
[format_out_#0:0 @ 0x7fdb58002c80] Setting 'sample_fmts' to value 's32p|fltp|s16p'
[format_out_#0:0 @ 0x7fdb58002c80] Setting 'sample_rates' to value '44100|48000|32000|22050|24000|16000|11025|12000|8000'
[format_out_#0:0 @ 0x7fdb58002c80] Setting 'channel_layouts' to value 'mono|stereo'
[AVFilterGraph @ 0x7fdb58001000] query_formats: 5 queried, 9 merged, 3 already done, 0 delayed
Output #0, mp3, to 'wruu_JoeFrank-20250130-2100.mp3':
Metadata:
icy-br : 192
icy-channels : 2
icy-name : WRUU 2022
icy-pub : 1
icy-samplerate : 44100
StreamTitle : - WRUU-WRUU
TSSE : Lavf61.7.100
Stream #0:0, 0, 1/44100: Audio: mp3, 44100 Hz, stereo, fltp, delay 1105
Metadata:
encoder : Lavc61.19.100 libmp3lame
[out#0/mp3 @ 0x36888b80] Starting thread...
Then there are thousands of entries like this:
out#0/mp3 @ 0x36888b80] sq: send 0 ts 0.0261224
[out#0/mp3 @ 0x36888b80] sq: receive 0 ts 0.0261224 queue head -1 ts N/A
[out#0/mp3 @ 0x36888b80] sq: send 0 ts 0.0522449
[out#0/mp3 @ 0x36888b80] sq: receive 0 ts 0.0522449 queue head -1 ts N/A
[out#0/mp3 @ 0x36888b80] sq: send 0 ts 0.0783673
Then thousands that look like this:
size= 54272KiB time=00:58:02.98 bitrate= 127.6kbits/s speed=0.679x
No error is reported. ffmpeg is still running after its specified time.
More information about the ffmpeg-user
mailing list