Ip cam in Live streaming 24h for research institute

I want to summarize the problem I encounter with peertube during a 24-hour live streaming of an IP cam.
The IP cameras are from research centers that monitor Italian volcanoes and/or the Venice lagoon.
The ffmpeg code I use is the following:

~/…/…/usr/local/bin/ffmpeg -re -rtsp_transport tcp -i rtsp://xxx.xxx.xxx.xxx:7447/vSbhbI6tpvCkc821
-c:v libx264 -preset ultrafast -b:v 2500k -maxrate 3000k -bufsize 3000k -g 60
-f flv -flvflags no_duration_filesize
-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 4
-err_detect explode
-recovery_wait_time 1 rtmp://garr.tv:1935/live/e215e9a5-9dae-45cd-81ff-5be870213de9

A cron code checks the process every 20 min:

*/20 * * * * cd ~/…/…/usr/local/bin && ./riavvia-tutto.sh >/dev/null 2>&1

the verification code is this:

processes=(« garrtv-ptfeast.sh »)

for process in « ${processes[@]} »; do
ESEC=$(pgrep -fl « $process » | grep -v « grep » | wc -l)

if [ "$ESEC" -eq 0 ]; then
    ~/../../usr/local/bin/"$process" &
    echo "Il processo $process è stato avviato"
    echo "Il processo $process è già attivo"


everything works, up to a certain point where the live instance of peertube seems to reject the incoming stream:

warn[14/12/2023, 19:28:34] Video 3707ff0c-bf7b-4733-8529-8808c97013aa has already a live session. Refusing stream 2c443728-24fd-4953-b19b-ae31a8f74e53. { « tags »: [ « live », « NVBA1Z20 », « 3707ff0c-bf7b-4733-8529-8808c97013aa » ] }

when this happens, I also tried to launch streaming with OBS, but even in this case I get the same error.

do you have any ideas regarding this problem?

This is an important activity for our research centers. IP cams often use radio links, being found in uninhabited and remote areas. In the case of the Venice lagoon the cams are placed on marine platforms and in the case of volcanoes they are in areas not served by the internet

Etna - GARR.tv - Thermal cameras in Etna Vulcano

Live test ptfeast 2 - GARR.tv - Camera in Venezia Lagoon

CNR ISMAR sette martiri - GARR.tv - Camera in Venezia

can you help me?


First please try to upgrade to 6.0.2 as we fixed a bug in 6.0 when a live stays broken forever: Release v6.0.0 · Chocobozzz/PeerTube · GitHub

Then, can you check in the logs why the stream ends? Is it related to network issues? And do you have a Max live duration set in PeerTube admin config?

almost always the live ends due to connection problems.
Live is set to « no limit »

I will try to update to 6.0.2

Thank you

Okay thanks, then restarting ffmpeg after a fews seconds after the network issue should work with 6.0.2.