AlexxIT / go2rtc

Ultimate camera streaming application with support RTSP, RTMP, HTTP-FLV, WebRTC, MSE, HLS, MP4, MJPEG, HomeKit, FFmpeg, etc.
https://github.com/AlexxIT/Blog
MIT License
4.91k stars 396 forks source link

Question: video freezes #20

Closed RomchikL closed 1 year ago

RomchikL commented 2 years ago

Hello!

Are there any restrictions (from the go2rtc server, browsers, or other platforms) on continuous video viewing from the server?

I can view a continuous video for a minute or two. Then the video freezes. At the same time, the log is good.

AlexxIT commented 2 years ago

Check info page about your stream. If send/receive fields updates in time.

RomchikL commented 2 years ago

When the camera freezes, these fields also freeze.

AlexxIT commented 2 years ago

Well. I think the camera stops sending data. Probably thinks no one's connected to it. First, try to use ffmpeg in copy mode:

streams:
  camera1: ffmpeg:{link}#video=copy
RomchikL commented 2 years ago

Now the camera works continuously, but there are freezes for a few seconds. About twice a minute the camera freezes (and the send/receive fields also freeze), but then (after 5-20 sec) the camera continues to work without my help.

AlexxIT commented 2 years ago

Well. Maybe ffmpeg reconnects to your camera continuously. Have you check it in some other software? VLC maybe.

RomchikL commented 2 years ago

Ya, VLC: there are short friezes (~0.5-1 sec), but streaming latency is ~2 sec. The stream works for 0.5-3 minutes and the program stops the stream at all (the info page is "null").

Picture Entity card in HA: Here camera works as in the latter comment (a lot of friezes for 2-10 sec). The latency is minimal.

AlexxIT commented 2 years ago

What camera model we talking about? Is it has brand mobile app?

RomchikL commented 2 years ago

Laxihub M3-TY with root, app - Smart life (Tuya). But the camera does not have internet access. I can't view the picture in this app. As a test, I can turn on internet access, but the stream will be through Tuya's server (not rtsp).

AlexxIT commented 2 years ago

All of the camera hacks, I've looked at, have very awful RTSP protocol implementation...

Oh. It's you again #7 :)

RomchikL commented 2 years ago

@AlexxIT Yep, it's me again ;)

AlexxIT commented 2 years ago

Can you send direct link to hack, not to author profile? Maybe some article about it.

RomchikL commented 2 years ago

The direct link , but here are just the differences. The main hack is described here

add: I didn't change the firmware, I just got root and turned on onvif.

maxi1134 commented 2 years ago

I experience similar issues with my streams.

It happens on the following devices, with a Reolink RLC-423 (https://reolink.com/us/product/rlc-423/) Samsung S7 FE (Wifi 6) Samsung a7 lite (Wifi 5) My computer (Ryzen 3900X, 1gbps, 2080s)

I can tell on the tablet, by using the GPU logs, that the gpu usage drops to 0 when the stream freeze, as if no more data is received.

I will be happy to provide logs and debugging time

AlexxIT commented 2 years ago

@maxi1134 Test your RTSP in other programms first. VLC, default Hass stream without WebRTC, ffmpeg copy mode.

maxi1134 commented 2 years ago

Works perfectly in VLC!

AlexxIT commented 2 years ago

You need to test all my examples.

AlexxIT commented 1 year ago

Is the problem still relevant?

RomchikL commented 1 year ago

For me the problem is not relevant. After the update everything works fine, thanks!