QuantumEntangledAndy / neolink

An RTSP bridge to Reolink IP cameras
GNU Affero General Public License v3.0
297 stars 44 forks source link

timed out waiting to send media frame #117

Closed MicheleCardamone closed 11 months ago

MicheleCardamone commented 1 year ago

Hi! Neolink version 0.5.14 after a few hours of correct functioning, gives the following errors and the video stream does not restore until I close and reopen neolink. I am attaching my config.toml file

config.txt neolink 0 5 14

QuantumEntangledAndy commented 11 months ago

@skylord123 Everything seems fine on the neolink end. What is your client and how are you connecting? If you set the variable GST_DEBUG to 3 it will show the gstreamer logs which will show how far into the connection we get. Also if you use ffplay or ffprobe to get the stream I can understand error messages of those clients a bit easier since that is what I use for testng

MicheleCardamone commented 11 months ago

@MicheleCardamone you have a panic at the end there could you set the rust backtrace variable that it is recommending and try again and show me the log. That way I can know which line it is on

Thank you! How can I enable the rust backtrace?

QuantumEntangledAndy commented 11 months ago

It's an environmental variable. The method will be different for docker/max/windows/Linux. Which one are you using?

MicheleCardamone commented 11 months ago

It's an environmental variable. The method will be different for docker/max/windows/Linux. Which one are you using?

Windows

QuantumEntangledAndy commented 11 months ago

Are you starting neolink using powershell or cmd?

QuantumEntangledAndy commented 11 months ago

It would be easier to google this rather than me providing step-by-step until we get there. Environmental variables are quite standard

MicheleCardamone commented 11 months ago

Are you starting neolink using powershell or cmd?

Cmd

QuantumEntangledAndy commented 11 months ago
set RUST_BACKTRACE=1
QuantumEntangledAndy commented 11 months ago

Next test build is here . It tries to fix the likely suspects or your panic but if you can send the trace back it will help confim that

MicheleCardamone commented 11 months ago

Next test build is here . It tries to fix the likely suspects or your panic but if you can send the trace back it will help confim that

ok, I'll try in a few hours and update you

QuantumEntangledAndy commented 11 months ago

Next build is here

skylord123 commented 11 months ago

Next build is here

This build is working, I'll monitor it and see if any issues arise. Thanks!

QuantumEntangledAndy commented 11 months ago

Good to hear, this build has a new command neolink mqtt-rtsp --config=conffile.toml which starts both mqtt and rtsp.

Theres also a new mqtt topic neolink/config which you can publish to and it will update the internal configuration live. That means you can add or remove cameras and also disable/enable streams from the mqtt. Getting all that to work smoothly was one of the reasons the refactor was so long as eveything now watches the config for certain changes and starts/stops things as needed.

It needs a change to the toml to work though, as mqtt is defined globally now rather than individually:

[mqtt]
  server = "127.0.0.1"
  port = 1883
  credentials = ["username", "password"]

[[cameras]]
# Usual cam stuff
QuantumEntangledAndy commented 11 months ago

It also:

MicheleCardamone commented 11 months ago

Next build is here

it seems to work better than the previous one, but at least in blueiris, the streams are unusable. Low FPS in both Main and Sub streams Same config file: [[cameras]] name = "cam1" username = "admin" address = "192.168.3.30:9000" stream = "both" buffer_size = 120 use_smoothing = true splash = false

Screenshot 2023-09-16 165306 Screenshot 2023-09-16 165531

skylord123 commented 11 months ago

12 hours without any issues, so far so good. Nice job @QuantumEntangledAndy, appreciate the work you put into this!

it seems to work better than the previous one, but at least in blueiris, the streams are unusable. Low FPS in both Main and Sub streams

I'm not seeing this. I don't understand from your picture what is the FPS though since there are no column titles. For my cameras I have them set to 20 FPS for the main stream and 10 FPS for the sub stream and I am getting the full FPS through to Xeoma. image

Wonder if it has to do with your configuration in Blue Iris. I think you can use ffprobe that @QuantumEntangledAndy mentioned earlier to calculate the stream FPS for comparison.

MicheleCardamone commented 11 months ago

12 hours without any issues, so far so good. Nice job @QuantumEntangledAndy, appreciate the work you put into this!

it seems to work better than the previous one, but at least in blueiris, the streams are unusable. Low FPS in both Main and Sub streams

I'm not seeing this. I don't understand from your picture what is the FPS though since there are no column titles. For my cameras I have them set to 20 FPS for the main stream and 10 FPS for the sub stream and I am getting the full FPS through to Xeoma. image

Wonder if it has to do with your configuration in Blue Iris. I think you can use ffprobe that @QuantumEntangledAndy mentioned earlier to calculate the stream FPS for comparison.

I did an test, I noticed that the problem only occurs on cams with outdated firmware. It's possible? What firmware do you have on your cams? Mine are the B800s Firmware Firmware Screenshot 2023-09-17 130316

QuantumEntangledAndy commented 11 months ago

How much outdated? Most of the protocol was REd on v2 with the only real addition in the v3 protocol was newer encryption algorithms

QuantumEntangledAndy commented 11 months ago

Also

QuantumEntangledAndy commented 11 months ago

Can you try some basic tests like:

If I cannot narrow this down or replicated then I can't address the issue

QuantumEntangledAndy commented 11 months ago

I'm going to release the current work onto master, and maybe close this issue since I think the original issue has been addressed. Could you open a new issue about your FPS issues on certain firmwares where we can keep track of things seperatly

MicheleCardamone commented 11 months ago

I'm going to release the current work onto master, and maybe close this issue since I think the original issue has been addressed. Could you open a new issue about your FPS issues on certain firmwares where we can keep track of things seperatly

The firmware on the other cams is the factory one, I had updated the others to the latest one available for B800. I'll take a test; as you suggested, leaving only the 2 updated cams. I also read that in the master release 0.6.0 the buffer size, use smoothing and splash configurations were removed... so I think they should be removed from the config toml file, correct?

QuantumEntangledAndy commented 11 months ago

There's no harm to leaving them in the config. They are just ignored.