QuantumEntangledAndy / neolink

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

g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed #190

Open iam-TJ opened 7 months ago

iam-TJ commented 7 months ago

Coming back to using neolink for the first time in a couple of weeks and repeatedly seeing this error as soon as the client connects:

$ neolink_linux_x86_64_bullseye/neolink_linux_x86_64_bullseye$ neolink rtsp --config=$HOME/.config/neolink/argusPT.toml 
[2023-11-16T20:14:14Z INFO  neolink] Neolink 446387a3a0fd05f4be40ce7f0675069c824eb1db release
[2023-11-16T20:14:14Z INFO  neolink::rtsp] Starting RTSP Server at 10.254.1.66:8554
[2023-11-16T20:14:14Z INFO  neolink::rtsp] argusPT: Rtsp Staring
[2023-11-16T20:14:14Z INFO  neolink::utils] argusPT: Connecting to camera at UID: 95270004T22YP1W5
[2023-11-16T20:14:14Z INFO  neolink_core::bc_protocol] argusPT: Trying local discovery
[2023-11-16T20:14:14Z INFO  neolink_core::bc_protocol] argusPT: Local discovery success 95270004T22YP1W5 at 10.254.1.64:36389
[2023-11-16T20:14:14Z INFO  neolink::utils] argusPT: Logging in
[2023-11-16T20:14:15Z INFO  neolink::utils] argusPT: Connected and logged in
[2023-11-16T20:14:17Z INFO  neolink::common::camthread] argusPT: Camera time is already set: 2023-11-16 12:10:01.0 +08:00:00
[2023-11-16T20:14:19Z INFO  neolink::common::neocam] argusPT: Model Reolink Argus PT
[2023-11-16T20:14:19Z INFO  neolink::common::neocam] argusPT: Firmware Version v3.0.0.1045_22061301
[2023-11-16T20:14:20Z INFO  neolink::rtsp::stream] argusPT: Avaliable at /argusPT/main, /argusPT/Main, /argusPT/mainStream, /argusPT/MainStream, /argusPT/Mainstream, /argusPT/mainstream, /argusPT
[2023-11-16T20:14:21Z INFO  neolink::rtsp::stream] argusPT: Avaliable at /argusPT/sub, /argusPT/Sub, /argusPT/subStream, /argusPT/SubStream, /argusPT/Substream, /argusPT/substream

(neolink:2254026): GLib-GObject-CRITICAL **: 20:14:49.800: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed

(neolink:2254026): GStreamer-RTSP-Server-CRITICAL **: 20:14:49.800: could not create element

The client, on the same host, is doing (the usually working):

$ neolink_linux_x86_64_bullseye/neolink_linux_x86_64_bullseye$ gst-launch-1.0 -v playbin uri=rtsp://10.254.1.66:8554/argusPT/main uridecodebin0::source::latency=300
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: force-sw-decoders = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = rtsp://10.254.1.66:8554/argusPT/main
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: latency = 300
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstRTSPSrc\)\ source"
Progress: (open) Opening Stream
Pipeline is PREROLLED ...
Prerolled, waiting for progress to finish...
Progress: (connect) Connecting to rtsp://10.254.1.66:8554/argusPT/main
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source: Unhandled error
Additional debug info:
../gst/rtsp/gstrtspsrc.c(6795): gst_rtspsrc_send (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source:
Bad Request (400)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

I'm not entirely clear on where the problem is likely to be - client or server - not being too familiar with gstreamer internals.

michaelsage commented 4 months ago

Did you find a fix for this? I'm experiencing it on a fresh install on ubuntu 22.04.4 LTS

tonytaylor85 commented 4 months ago

I had 5.12 running on debian 11, and got these errors when I tried to compile 6.2. I just made a debian 12 VM and the binary release runs no problem. Note that he mentions libssl, but the package is libssl3 and is already installed.

QuantumEntangledAndy commented 2 months ago

Can't replicate this can you tell me if it is still an issue on latest?

anthonws commented 2 months ago

Hi Andy!!! So glad to see you active again!! A big thank you for your dedication and for sharing your intelect with us through this amazing project!

I've just tested the master branch and I am seeing this error.

2024-04-26T07:48:58Z INFO  neolink] Neolink d354b90976f3c542cc2bf061e44cc5d06da0b3bc release

[2024-04-26T07:48:58Z INFO  neolink::rtsp] tapas_hall: Rtsp Starting

[2024-04-26T07:48:58Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8888

[2024-04-26T07:48:58Z INFO  neolink::utils] tapas_hall: Connecting to camera at Address: 192.168.1.216:9000

[2024-04-26T07:48:58Z INFO  neolink_core::bc_protocol] tapas_hall: Trying TCP discovery

[2024-04-26T07:48:58Z INFO  neolink_core::bc_protocol] tapas_hall: TCP Discovery success at 192.168.1.216:9000

[2024-04-26T07:48:58Z INFO  neolink::utils] tapas_hall: Logging in

[2024-04-26T07:48:59Z INFO  neolink::utils] tapas_hall: Connected and logged in

[2024-04-26T07:49:01Z INFO  neolink::common::camthread] tapas_hall: Camera time is already set: 2024-04-26 8:49:01.0 +00:00:00

[2024-04-26T07:49:03Z INFO  neolink::common::neocam] tapas_hall: Model E1 Pro

[2024-04-26T07:49:03Z INFO  neolink::common::neocam] tapas_hall: Firmware Version v3.0.0.2356_23062004

(neolink:8): GLib-GObject-CRITICAL **: 07:49:04.572: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed

(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 07:49:04.572: could not create element

(neolink:8): GLib-GObject-CRITICAL **: 07:49:04.575: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed

(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 07:49:04.575: could not create element

(neolink:8): GLib-GObject-CRITICAL **: 07:49:14.553: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed

(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 07:49:14.553: could not create element

(neolink:8): GLib-GObject-CRITICAL **: 07:49:14.598: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed

(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 07:49:14.598: could not create element

[2024-04-26T07:49:19Z INFO  neolink::rtsp::stream] tapas_hall: Available at /tapas_hall/sub, /tapas_hall/Sub, /tapas_hall/subStream, /tapas_hall/SubStream, /tapas_hall/Substream, /tapas_hall/substream, /tapas_hall

Event though it informs that the stream is available, Frigate doesn't pick up anything (says camera not available). Let me know if I should test a different branch.

Cheers, anthonws.

QuantumEntangledAndy commented 2 months ago

could not create element is quite worrying it usually means that one of the gstreamer elements is failing to be added to the pipeline. Are you building this yourself? What version of gstreamer do you have?

QuantumEntangledAndy commented 2 months ago

Also are you using this commit https://github.com/QuantumEntangledAndy/neolink/commit/d354b90976f3c542cc2bf061e44cc5d06da0b3bc? Seems to be a few weeks old. Just use the tip of the master 96e994512e8123e0c30531be28aa0d413829ab55 to start with and I'll make a new branch from that if we still have issues

anthonws commented 2 months ago

I tried also the fix_argus branch and now I re-downloaded the docker image from master (saw it was updated like 4 hours ago). Here's the log output:

Running: /bin/sh -c /usr/local/bin/neolink "${NEO_LINK_MODE}" --config /etc/neolink.toml
[2024-04-26T13:54:15Z INFO  neolink] Neolink e8aca0ee105a2869740f93cfb238d19baf9a3362 release
[2024-04-26T13:54:16Z INFO  neolink::rtsp] tapas_hall: Rtsp Starting
[2024-04-26T13:54:16Z INFO  neolink::rtsp] Starting RTSP Server at 0.0.0.0:8888
[2024-04-26T13:54:16Z INFO  neolink::utils] tapas_hall: Connecting to camera at Address: 192.168.1.216:9000
[2024-04-26T13:54:16Z INFO  neolink_core::bc_protocol] tapas_hall: Trying TCP discovery
[2024-04-26T13:54:16Z INFO  neolink_core::bc_protocol] tapas_hall: TCP Discovery success at 192.168.1.216:9000
[2024-04-26T13:54:16Z INFO  neolink::utils] tapas_hall: Logging in
[2024-04-26T13:54:16Z INFO  neolink::utils] tapas_hall: Connected and logged in
[2024-04-26T13:54:18Z INFO  neolink::common::camthread] tapas_hall: Camera time is already set: 2024-04-26 14:54:18.0 +00:00:00
[2024-04-26T13:54:20Z INFO  neolink::common::neocam] tapas_hall: Model E1 Pro
[2024-04-26T13:54:20Z INFO  neolink::common::neocam] tapas_hall: Firmware Version v3.0.0.2356_23062004
(neolink:8): GLib-GObject-CRITICAL **: 13:54:22.409: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed
(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 13:54:22.409: could not create element
(neolink:8): GLib-GObject-CRITICAL **: 13:54:22.417: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed
(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 13:54:22.417: could not create element
(neolink:8): GLib-GObject-CRITICAL **: 13:54:32.419: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed
(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 13:54:32.420: could not create element
(neolink:8): GLib-GObject-CRITICAL **: 13:54:32.425: g_object_force_floating: assertion 'G_IS_OBJECT (object)' failed
(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 13:54:32.426: could not create element
[2024-04-26T13:54:36Z INFO  neolink::rtsp::stream] tapas_hall: Available at /tapas_hall/sub, /tapas_hall/Sub, /tapas_hall/subStream, /tapas_hall/SubStream, /tapas_hall/Substream, /tapas_hall/substream, /tapas_hall
[2024-04-26T13:54:42Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:54:51Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:54:51Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:54:52Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:54:52Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:54:52Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:54:58Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:54:58Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:54:58Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:54:58Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:02Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:55:08Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:08Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:08Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:08Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:12Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:55:18Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:18Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:18Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:18Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:22Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:55:32Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:32Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:32Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:32Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:32Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:55:38Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:38Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:38Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:38Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:42Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:55:52Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:52Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:52Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:52Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:52Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:55:58Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:58Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:55:58Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:55:58Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:56:02Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:56:08Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:56:08Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:56:08Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:56:08Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:56:12Z INFO  neolink::rtsp::factory] buffer_size: 40960, bitrate: 163840
[2024-04-26T13:56:18Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:56:18Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T13:56:18Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T13:56:18Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
QuantumEntangledAndy commented 2 months ago

Any chance you can do it with GST_DEBUG set to 3. Should help me know which element is failing to be built in gstreamer

anthonws commented 2 months ago

No more GStream Critical errors using the build you shared.

I only see these errors now:

[2024-04-26T14:23:47Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T14:23:47Z ERROR neolink::rtsp::stream] r: Err(App source is closed)
[2024-04-26T14:23:47Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc
[2024-04-26T14:23:47Z ERROR neolink::rtsp::stream] Exiting send_to_appsrc

But Frigate can't open the stream:

2024-04-26 14:26:05.829612155  [2024-04-26 14:26:05] frigate.video                  ERROR   : tapas_hall: Unable to read frames from ffmpeg process.
2024-04-26 14:26:05.830337312  [2024-04-26 14:26:05] frigate.video                  ERROR   : tapas_hall: ffmpeg process is not running. exiting capture thread...
2024-04-26 14:26:10.401244766  [2024-04-26 14:26:10] watchdog.tapas_hall            ERROR   : Ffmpeg process crashed unexpectedly for tapas_hall.
2024-04-26 14:26:10.409919522  [2024-04-26 14:26:10] watchdog.tapas_hall            ERROR   : The following ffmpeg logs include the last 100 lines prior to exit.
2024-04-26 14:26:10.409941765  [2024-04-26 14:26:10] ffmpeg.tapas_hall.detect       ERROR   : [rtsp @ 0x55647f05b100] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size
2024-04-26 14:26:10.409944239  [2024-04-26 14:26:10] ffmpeg.tapas_hall.detect       ERROR   : Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
2024-04-26 14:26:10.409946244  [2024-04-26 14:26:10] ffmpeg.tapas_hall.detect       ERROR   : Output file #0 does not contain any stream
fleaz commented 1 month ago

Hey, I also started to see this problem since a few weeks. Started with GST_DEBUG=3 and get thousasnds of these mesages:

(neolink:8): GStreamer-RTSP-Server-CRITICAL **: 13:05:08.282: could not create element
97:36:43.306043082     8 0x7ff43800a980 ERROR             rtspclient rtsp-client.c:1095:find_media: client 0x7ff44800a4e0: can't create media
97:36:43.306076351     8 0x7ff43800a980 ERROR             rtspclient rtsp-client.c:3412:handle_describe_request: client 0x7ff44800a4e0: no media
97:36:53.307636930     8 0x7ff43800a980 WARN                GST_RUST element_factory.rs:259:gstreamer::element_factory::ElementBuilder::build::{{closure}}: element factory 'fallbackswitch' not found

Frigate is throwing HTTP400 while in this state:

ERROR   : rtsp://localhost:8888/Hof/main: Server returned 400 Bad Request
ERROR   : Hof: Unable to read frames from ffmpeg process.