ffmpeg doesn't reconnect when capturing live connections
I capture live streams. When a stream drops ffmpeg stops capturing, doesn't reconnect, and keeps running after the time limit. For example: ffmpeg -i https://playerservices.streamtheworld.com/api/livestream-redirect/KUNMFM_32.... -t 180 -reconnect true -reconnect_streamed true -reconnect_on_network_error true -timelimit 180 -loglevel warning kunm_StarDate-20250111-1800.mp3 I used to use streamripper, which keeps on trying to reconnect for the time specified and quits when the time expires, but works only for icecast and shoutcast streams.
On 1/12/2025 7:28 AM, arthurpeabody wrote:
I capture live streams.
Please always include not only the complete command but the command output, it often contains quite useful info for debugging (see section 6 of https://www.ffmpeg.org/mailing-list-faq.html). z!
Quoth Carl Zwanzig: ' Please always include not only the complete command but the command output, it often contains quite useful info for debugging (see section 6 of https://www.ffmpeg.org/mailing-list-faq.html).' There was nothing until I terminated the processes with kill: [out#0/mp3 @ 0x2c31dc40] Error writing trailer: Immediate exit requested [out#0/mp3 @ 0x2c31dc40] Error closing file: Immediate exit requested [out#0/mp3 @ 0x1b8d3c40] Error writing trailer: Immediate exit requested [out#0/mp3 @ 0x1b8d3c40] Error closing file: Immediate exit requested
On 1/12/2025 11:27 AM, arthurpeabody wrote:
There was nothing until I terminated the processes with kill:
That's missing the entire banner and stream info - "Always show your actual, unscripted ffmpeg command and the complete, uncut console output from your command." (the first point in faq section 6.1) z!
Quoth Carl Zwanzig: 'That's missing the entire banner and stream info - "Always show your actual, unscripted ffmpeg command and the complete, uncut console output from your command." (the first point in faq section 6.1)' I showed the entire console output. Here's the command in my script: ffmpeg -i $URI -t $3 -reconnect true -reconnect_streamed true -reconnect_on_network_error true -timelimit $3 -loglevel warning $Target.$Extension &>> .ffmpeg.log There is no banner and stream.
On 1/12/2025 6:28 PM, arthurpeabody wrote:
There is no banner and stream.
Hmm, the originally-posted command ffmpeg -i https://playerservices.streamtheworld.com/api/livestream-redirect/KUNMFM_32.... -t 180 -reconnect true -reconnect_streamed true -reconnect_on_network_error true -timelimit 180 -loglevel warning kunm_StarDate-20250111-1800.mp3 didn't include the "&>> .ffmpeg.log" on the end as shown in the later email. Also, take out the "-loglevel warning" and let it use the default (on my system/build, using -loglevel was not producing any output, removed it and got the banner/etc). Anyway, run the command from the shell, without the redirect or -loglevel, then kill the process as you have been doing. This should produce a bunch of lines starting with the version and build info; paste all of that into the email reply, might be a couple hundred lines. Are you using a current ffmpeg? That's always recommended. z!
participants (2)
-
arthurpeabody -
Carl Zwanzig