QuantumEntangledAndy / neolink

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

Streaming stops after ~60 seconds. #27

Closed dkerr64 closed 1 year ago

dkerr64 commented 1 year ago

Installed Neolink into Ubuntu 22.04 and connected to Argus 3 Pro camera. It connects and starts streaming. However after a short period (looks to be consistently ~60 seconds) streaming stops and restarts. If VLC is connected at the time then it stops streaming, closes the connection and does not restart.

Console log...

root@neolink:~/neolink_linux_x86_64_ubuntu# ./neolink rtsp --config=neolink.toml
[2023-01-30T03:24:26Z INFO  neolink] Neolink 44675f25b41ece2acc2fb10f60f7395c59accc34 release
[2023-01-30T03:24:26Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `x264 (gst-plugins-ugly)` for `x264enc` element. Required to paused certain cameras
[2023-01-30T03:24:26Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h264` element. Required to paused certain cameras
[2023-01-30T03:24:26Z WARN  neolink::rtsp::gst] Missing the gstreamer plugin `libav (gst-libav)` for `avdec_h265` element. Required to paused certain cameras
[2023-01-30T03:24:26Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8554
[2023-01-30T03:24:26Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:24:29Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:24:29Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:24:30 -5
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:24:30Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:25:30Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:25:30Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:25:30Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:25:30Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:25:30Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:25:30Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:25:30Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:25:30Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:25:31Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:25:31Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:25:32 -5
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:25:32Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:26:27Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:26:27Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:26:27Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:26:27Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:26:27Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:26:27Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:26:27Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:26:27Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:26:28Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:26:28Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:26:29 -5
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:26:29Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:27:29Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:27:29Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:27:29Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:27:29Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:27:29Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:27:29Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:27:29Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:27:29Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:27:30Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:27:30Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:27:31 -5
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:27:31Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:28:32Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:28:32Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:28:32Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:28:32Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:28:32Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:28:32Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:28:32Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:28:32Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:28:33Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:28:33Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:28:34 -5
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:28:34Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
[2023-01-30T03:29:37Z WARN  neolink::rtsp::states::streaming] During drop: Main did not stop cleanly: Media Deserialization error

    Caused by:
        Parsing error
[2023-01-30T03:29:37Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:29:37Z WARN  neolink::rtsp::states::streaming] During drop: Panicked while streaming
[2023-01-30T03:29:37Z WARN  neolink::rtsp] Driveway: Retryable error: Camera has unexpectanely stopped the paused state
[2023-01-30T03:29:37Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp read poll aborted
[2023-01-30T03:29:37Z INFO  neolink::rtsp::states] Driveway: Connecting to camera at UID: [redacted]
[2023-01-30T03:29:37Z ERROR neolink_core::bc_protocol::connection::udpconn] Udp write poll aborted
[2023-01-30T03:29:37Z INFO  neolink::rtsp::states] Driveway: Logging in
[2023-01-30T03:29:38Z INFO  neolink::rtsp::states] Driveway: Successfully logged in
[2023-01-30T03:29:38Z INFO  neolink::rtsp::states] Driveway: Camera time is already set: 2023-01-29 22:29:39 -5
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states] Driveway: Camera reports firmware version v3.0.0.973_22051000
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states] Driveway: Starting stream
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Sub Stream (Fluent)
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Main Stream (Clear)
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states::streaming] Driveway: Starting video stream Extern Stream (Balanced)
[2023-01-30T03:29:39Z INFO  neolink::rtsp::states] Driveway: Successfully started streaming
QuantumEntangledAndy commented 1 year ago

Yes I've been working on this one for the past week with a rewrite of the udp layer. Hopefully I can figure it out.

QuantumEntangledAndy commented 1 year ago

I think I found where it was stopping, it seemed that we were not sending sufficient acknowledgment packets and the camera was dropping us for poor connectivity. Should be fixed in current master

dkerr64 commented 1 year ago

This is now fixed. Thank you.