go2rtc icon indicating copy to clipboard operation
go2rtc copied to clipboard

Question: video freezes

Open RomchikL opened this issue 2 years ago • 16 comments

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.

RomchikL avatar Aug 28 '22 11:08 RomchikL

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

AlexxIT avatar Aug 28 '22 12:08 AlexxIT

When the camera freezes, these fields also freeze.

RomchikL avatar Aug 28 '22 13:08 RomchikL

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

AlexxIT avatar Aug 28 '22 14:08 AlexxIT

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.

RomchikL avatar Aug 28 '22 14:08 RomchikL

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

AlexxIT avatar Aug 28 '22 15:08 AlexxIT

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.

RomchikL avatar Aug 28 '22 16:08 RomchikL

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

AlexxIT avatar Aug 28 '22 16:08 AlexxIT

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).

RomchikL avatar Aug 28 '22 16:08 RomchikL

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

Oh. It's you again #7 :)

AlexxIT avatar Aug 28 '22 17:08 AlexxIT

@AlexxIT Yep, it's me again ;)

RomchikL avatar Aug 28 '22 17:08 RomchikL

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

AlexxIT avatar Aug 28 '22 17:08 AlexxIT

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.

RomchikL avatar Aug 28 '22 17:08 RomchikL

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

maxi1134 avatar Aug 30 '22 17:08 maxi1134

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

AlexxIT avatar Aug 30 '22 17:08 AlexxIT

Works perfectly in VLC!

maxi1134 avatar Aug 30 '22 18:08 maxi1134

You need to test all my examples.

AlexxIT avatar Aug 30 '22 18:08 AlexxIT

Is the problem still relevant?

AlexxIT avatar Nov 13 '22 11:11 AlexxIT

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

RomchikL avatar Nov 13 '22 11:11 RomchikL