Open onyx82 opened 1 month ago
Good day!
Depending on how you built the tool, it may not use the system's gstreamer packages. On startup, onvifmgr will print this information on the consol. Here's an example:
INFO 24-10-21 16:27:27.264145 133465758131136 onvif-mgr.c:40: Using Gstreamer Version : 1.24.5.0
INFO 24-10-21 16:27:27.264179 133465758131136 gst_plugin_utils.c:224: Initializing Gstreamer plugins...
INFO 24-10-21 16:27:27.264193 133465758131136 gst_plugin_utils.c:229: Loading static plugins...
DEBUG 24-10-21 16:27:27.561464 133465758131136 gst_plugin_utils.c:436: Gstreamer plugins initialized...
INFO 24-10-21 16:27:27.561544 133465758131136 onvif-mgr.c:45: **** Video decoders *******
INFO 24-10-21 16:27:27.561563 133465758131136 gst_plugin_utils.c:485: * video/x-h264 decoders ***
INFO 24-10-21 16:27:27.564272 133465758131136 gst_plugin_utils.c:494: * avdec_h264[256]
INFO 24-10-21 16:27:27.564302 133465758131136 gst_plugin_utils.c:494: * openh264dec[64]
INFO 24-10-21 16:27:27.564341 133465758131136 gst_plugin_utils.c:485: * video/x-h265 decoders ***
INFO 24-10-21 16:27:27.565351 133465758131136 gst_plugin_utils.c:494: * avdec_h265[256]
INFO 24-10-21 16:27:27.565375 133465758131136 gst_plugin_utils.c:494: * libde265dec[128]
INFO 24-10-21 16:27:27.565411 133465758131136 gst_plugin_utils.c:485: * image/jpeg decoders ***
INFO 24-10-21 16:27:27.566338 133465758131136 gst_plugin_utils.c:494: * jpegdec[256]
INFO 24-10-21 16:27:27.566359 133465758131136 gst_plugin_utils.c:494: * avdec_mjpeg[64]
INFO 24-10-21 16:27:27.566394 133465758131136 gst_plugin_utils.c:485: * video/x-av1 decoders ***
INFO 24-10-21 16:27:27.567612 133465758131136 gst_plugin_utils.c:499: * None
INFO 24-10-21 16:27:27.567668 133465758131136 onvif-mgr.c:50: ****************************
INFO 24-10-21 16:27:27.567683 133465758131136 onvif-mgr.c:52: **** Audio decoders *******
INFO 24-10-21 16:27:27.567696 133465758131136 gst_plugin_utils.c:485: * audio/x-mulaw decoders ***
INFO 24-10-21 16:27:27.568624 133465758131136 gst_plugin_utils.c:494: * mulawdec[256]
INFO 24-10-21 16:27:27.568667 133465758131136 gst_plugin_utils.c:485: * audio/x-alaw decoders ***
INFO 24-10-21 16:27:27.569576 133465758131136 gst_plugin_utils.c:494: * alawdec[256]
INFO 24-10-21 16:27:27.569618 133465758131136 gst_plugin_utils.c:485: * audio/mpeg decoders ***
INFO 24-10-21 16:27:27.570400 133465758131136 gst_plugin_utils.c:494: * avdec_aac[256]
INFO 24-10-21 16:27:27.570416 133465758131136 gst_plugin_utils.c:494: * avdec_aac_fixed[256]
INFO 24-10-21 16:27:27.570425 133465758131136 gst_plugin_utils.c:494: * avdec_aac_latm[64]
INFO 24-10-21 16:27:27.570434 133465758131136 gst_plugin_utils.c:494: * avdec_mp1float[64]
INFO 24-10-21 16:27:27.570442 133465758131136 gst_plugin_utils.c:494: * avdec_mp2float[64]
INFO 24-10-21 16:27:27.570452 133465758131136 gst_plugin_utils.c:494: * avdec_mp3[64]
INFO 24-10-21 16:27:27.570460 133465758131136 gst_plugin_utils.c:494: * avdec_mp3float[64]
INFO 24-10-21 16:27:27.570468 133465758131136 gst_plugin_utils.c:494: * fdkaacdec[64]
INFO 24-10-21 16:27:27.570507 133465758131136 onvif-mgr.c:56: ****************************
The following line tells me that it's using provided static gstreamer libraries instead of the system:
INFO 24-10-21 16:27:27.264193 133465758131136 gst_plugin_utils.c:229: Loading static plugins...
That being said, Timeout while waiting for server response
is self-explanatory.
Snippet from your logs:
ERROR 24-10-21 19:47:33.737028 138050328158336 gstrtspplayer.c:741: Error received from element [9] rtspsrc: Nu se poate citi din resursă.
ERROR 24-10-21 19:47:33.737104 138050328158336 gstrtspplayer.c:742: Debugging information: ../subprojects/gst-plugins-good/gst/rtsp/gstrtspsrc.c(6822): gst_rtsp_src_receive_response (): /GstPipeline:onvif-pipeline/GstRTSPSrc:rtspsrc:
ERROR 24-10-21 19:47:33.737104 138050328158336 gstrtspplayer.c:742: Could not receive message. (Timeout while waiting for server response)
Does the camera works using the follow command: (Don't forget to use your own user/password)
gst-launch-1.0 rtspsrc location="rtsp://192.168.100.94:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif" user-id="INSERT-YOUR-USERID" user-pw="INSERT-YOUR-PASSWORD" ! fakesink
The command won't show anything visual because of fakesink
.
It's only to test if the camera is setting up the stream correctly.
The Imou camera has the default user "admin", and I created a second user "admin2" with Administrator rights. Both users have the same password. What seems strange to me: When I try to log into Onvif Device Manager with the "admin" user, it doesn't work, but if I use the user I created, "admin2", it logs into Onvif Device Manager successfully. I tried the command: gst-launch-1.0 rtspsrc location="rtsp://192.168.100.94:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif" user-id="admin" user-pw="mypass" ! fakesink If I use the "admin" user, it gives me an error:
Unauthorized (401) ERROR: The pipeline does not want to preload. Setting pipeline to NULL... Releasing pipeline...
If I use the "admin2" user that I created, no error appears; it says: Redistributing latency... (and a timer runs)
alex:~$ gst-launch-1.0 rtspsrc location="rtsp://192.168.100.94:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif" user-id="admmin2" user-pw="mypass" ! fakesink
Setting the pipeline to PAUSE ...
The pipeline is "live" and does not require PRELOADING ...
Progress: (open) Opening Stream
The pipeline is PRELOADING ...
Pre-rolled, waiting for progress completion...
Progress: (connect) Connecting to rtsp://192.168.100.94:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
Progress: (open) Retrieving server options
Progress: (open) Retrieving media info
Progress: (request) SETUP stream 0
Progress: (request) SETUP stream 1
Progress:
(request) SETUP stream 2
Progress: (open) Opened Stream
Setting
the pipeline to PLAYING ...
New clock: GstSystemClock
Progress: (request) Sending PLAY request
Redistributing latency...
Redistributing latency...
Redistributing latency...
Redistributing latency...
Redistributing latency...
Progress: (request) Sending PLAY request
Redistributing latency...
Progress: (request) Sent PLAY request
Redistributing latency...
Redistributing latency...
Redistributing latency...
Redistributing latency...
Redistributing latency...
Redistributing latency...
^Chandling interrupt.
Interrupt: Stopping the pipeline ...
Execution ended after 0:00:07.972021118
Setting the pipeline to NULL ...
Releasing the pipeline...
alex:~$
In VLC, I use the address rtsp://admin:password@192.168.100.94:554/cam/realmonitor?channel=1&subtype=0, and it works perfectly, regardless of whether I use "admin" or "admin2". However, if I use the address: rtsp://admin:password@192.168.100.94:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif with the "admin" user, it doesn't work, but with the user I created, "admin2", the live stream runs perfectly.
I am using an Imou Bullet Lite 4MP camera. When accessing its web interface, I've attempted to locate a setting for UNICAST transmission but was only able to find MULTICAST, which is currently activated. Both the default 'admin' user and the custom 'admin2' user have ONVIF enabled.All settings are at their default values.
Okay, the first issue at hand is that onvifmgr is unable to connect, but I suspect it might just be a timeout setting a little bit too low. I could add an option to adjust it in the application settings.
Could you try the following?
gst-launch-1.0 rtspsrc location="rtsp://192.168.100.94:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif" user-id="INSERT-YOUR-USERID" user-pw="INSERT-YOUR-PASSWORD" latency=0 teardown-timeout=0 do-retransmission=true is-live=true tcp-timeout=1000000 protocols=4 ! fakesink
This should simulate the rtspsrc configuration within gstrtspplayer.c. If it fails, we now have a good hint about a faulty configuration.
If it is successful, you can try to run the application with Gstreamer debug enabled:
GST_DEBUG=4 onvifmgr > onvfmgr.log 2>&1
This will generate a large amount of logs from gstreamer, giving additional insight about the failure.
In regards to user permissions, that would heavily depends on the device's implementation. I can only imagine that ONIVF related features are considered for "administrator" while some regular user can connect to other RTSP streams.
In this case, it has different RTSP stream parameters (proto=Onvif) which I assume leads to different permissions validations. (e.g. Administrators could have 4K with regular users at 720p)
I find it a little odd, since I do own a Imou Ranger 2C and I don't experience those permission issues.
I ran the first command, and no error appeared; a timer started running. I also ran the second command, and it created the file onvfmgr.log, which I uploaded to GitHub. onvfmgr.log
I really don't see anything other than the camera not responding, but that's just gstreamer's message. It is possible that some exchange occurs, but the handshake fails to complete.
We can try to increase log level a bit to see actual rtsp message exchanged:
GST_DEBUG=*:4,rtsp*:7 onvifmgr > onvfmgr.log 2>&1
The new section rtsp*:7
should show RTSP message log (OPTIONS, DESCRIBE, SETUP, PLAY) and a lot more.
You can always try to use your system's gstreamer instead of the static linked latest version. You can simply rebuild the tool without "enable-latest" argument:
make distclean
./autogen.sh
make -j$(nproc)
./onvifmgr
After authentication, the screen is black, but on the left, next to the camera name and IP, you can see the screenshot taken by the camera. The one that is written in the terminal after authentication