libonvif icon indicating copy to clipboard operation
libonvif copied to clipboard

How to fix 'duplicate media uri' issue?

Open adityapstar opened this issue 1 year ago • 4 comments

For some reason I haven't been able to connect to my onvif camera recently, when I go to the logs I see the following message which might be related:

gui.main:playMedia:328 - Duplicate media uri from 192.168.1.128 (PROFILE_17274) is blocking launch of new player

Do you know how I can try resolving it?

adityapstar avatar Dec 03 '24 19:12 adityapstar

This issue is caused by a failure of the system to close a camera stream gracefully. This might happen if the camera stops transmitting for some reason and the system attempts to close it and re-open a fresh stream. The most recent version of onvif-gui has a fix for this problem that should resolve the issue in most cases. Please check your version in the window title bar and if it is earlier than the most recent, 2.3.2, an upgrade should help.

If you installed using pip, the command from your virtual environment pip install onvif-gui --upgrade should install the latest version.

Please let me know if you continue to experience this issue. In the event that it does recur, it can be possible to clear the system stream buffers by using the Close All button on the Settings->General tab so that the camera streams can be re-started without closing the application. I do believe that the issue has been corrected in the 2.3.2 release, however it is possible that some unforeseen circumstances could cause the error that would require further troubleshooting.

sr99622 avatar Dec 04 '24 03:12 sr99622

I was able to reproduce this bug and found a better solution. The latest version 2.4.2 contains a fix that should definitely resolve the problem. To upgrade use the command pip install --upgrade onvif-gui.

sr99622 avatar Jan 08 '25 15:01 sr99622

Unfortunately I'm still experiencing the issue after updating to 2.4.2

Weird thing is it works fine when I installed it on another device, but it displays the same error on my main machine even after doing a fresh install

logs.txt

adityapstar avatar Jan 08 '25 17:01 adityapstar

Thank you so much for reaching out, this is a challenging issue. The logs are very helpful, although I do need to make some efforts at masking out the sensitive data, thank you for your patience with that. The program is actually working correctly in the respect that it is repeatedly trying to connect to the camera without having success. The camera is not shutting down gracefully, which is the cause of the duplicate uri, so the program is forcing the shutdown.

Things you could try to get a connection include rebooting the camera which you have probably already tried. If the camera is running at a high resolution, sometimes you can improve performance by reducing the resolution or by switching to the substream profile.

You can also try running the program in Server mode from the Settings -> Proxy panel. Even if you are not running clients, the proxy server has an interface that may be more robust that the Stand Alone configuration. You will get a window that pops up showing messages from the proxy server that may contain more detail regarding the communications.

I hope these hints are helpful, I greatly appreciate your feedback. Please let me know if there are further questions.

sr99622 avatar Jan 08 '25 18:01 sr99622