Giter Site home page Giter Site logo

onvif_srvd's People

Contributors

koynovstas avatar roleoroleo avatar stappersg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onvif_srvd's Issues

how to debug? which IDE?

hi Mr @KoynovStas
how can I debug this project,which IDE do you use?
would you give me the project files too?
as I told,I have to migrate this project to windows C#.net so I will appreciate if you give me a hand on it.

best regards

compile error

hi
when I compile on ubunto 20.04,then I got this error:

make release

[build] generated/soapC.o:
g++ -c generated/soapC.cpp -o generated/soapC.o -s -DDAEMON_NAME='"onvif_srvd"' -DDAEMON_MAJOR_VERSION=1 -DDAEMON_MINOR_VERSION=1 -DDAEMON_PATCH_VERSION=0 -DDAEMON_PID_FILE_NAME='"onvif_srvd.pid"' -DDAEMON_LOG_FILE_NAME='"onvif_srvd.log"' -DDAEMON_NO_CHDIR=1 -DDAEMON_NO_CLOSE_STDIO=0 -I./src -I./generated -I./gsoap-2.8/gsoap -I./gsoap-2.8/gsoap/custom -I./gsoap-2.8/gsoap/plugin -I./gsoap-2.8/gsoap/import -std=c++11 -O2 -Wall -pipe
^[[B^[[B^[[A^[[B^[[C^[[B^[[D{standard input}: Assembler messages:
{standard input}:954873: Warning: end of file not at end of a line; newline inserted
{standard input}:955331: Error: number of operands mismatch for `sub'
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
make: * [Makefile:156: generated/soapC.o] Error 1

any help would be great.

I need to start server using c#

I want use this into c# project how i can start working on it.
I want basicaly. When i call
OnvifServer.Start(); from c# should server start. So how i implement that OnvifServer in c#
If any other reference plz mention
Thank you in advance

Build error

./SDK/gsoap.zip.tmp 100%[===============================================================================================================>] 31.47M 10.6KB/s surplus 0s
Segmentation fault (core dumped)
make: *** [Makefile:216:generated/onvif.h] error 139

Unable to discover RPI 4 in Onvif device manager

Hello,
Thanks for making this opensource, I'm trying to utilize this template in RPI 4 model B, without any issues I compiled and and ran this as Daemon, but I did not seen any issues, but I didn't seen my RPI 4 device getting detected in Onvif Device Manager.

     Note that through out process I just changed IP address and WIFI interface Name.

What could be the issue?

Regards,
Nolan

Сборка отваливается на этапе скачивания gsoap

Клонирую репозиторий, запускаю make release, получаю вот такой результат.

pi-camera-3dp onvif_srvd (master) # make release
--2021-03-17 16:28:01--  https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_2.8.92.zip/download
Resolving sourceforge.net (sourceforge.net)... 216.105.38.13
Connecting to sourceforge.net (sourceforge.net)|216.105.38.13|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-03-17 16:28:03 ERROR 404: Not Found.

--2021-03-17 16:28:03--  https://sourceforge.net/projects/gsoap2/files/oldreleases/gsoap_2.8.92.zip/download
Resolving sourceforge.net (sourceforge.net)... 216.105.38.13
Connecting to sourceforge.net (sourceforge.net)|216.105.38.13|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-03-17 16:28:04 ERROR 404: Not Found.

--2021-03-17 16:28:04--  https://master.dl.sourceforge.net/project/gsoap2/oldreleases/gsoap_2.8.92.zip
Resolving master.dl.sourceforge.net (master.dl.sourceforge.net)... 216.105.38.12
Connecting to master.dl.sourceforge.net (master.dl.sourceforge.net)|216.105.38.12|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://downloads.sourceforge.net/project/gsoap2/oldreleases/gsoap_2.8.92.zip [following]
--2021-03-17 16:28:05--  https://downloads.sourceforge.net/project/gsoap2/oldreleases/gsoap_2.8.92.zip
Resolving downloads.sourceforge.net (downloads.sourceforge.net)... 216.105.38.13
Connecting to downloads.sourceforge.net (downloads.sourceforge.net)|216.105.38.13|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-03-17 16:28:06 ERROR 404: Not Found.

make: *** [Makefile:220: generated/onvif.h] Error 8

На sf доступен только https://sourceforge.net/projects/gsoap2/files/gsoap-2.8/gsoap_2.8.111.zip/download

PTZ is not showing up in ODM

Hello,
I'm working on RPI 4 Model B, I'm able to stream USB camera connected to RPI, in ONVIF Device Manager, but I can't able to see settings to control PTZ.

This is what I'm getting now

SRVD

But this is what I'm expecting

PTZ

So how to configure to enable PTZ control.

Regards,
Nolan

support for h265

hi, I use your server for several cameras and it works great, but some of them only support h265 and I can’t use there onvif_srvd.
Are you planning to add support for h265? :)

Compilation Issue on Raspberry Pi

Hi,

I'm trying to create a RPi based Onvif camera, but ran into some issues during compilation. Basically the compilations get stuck at :
[build] generated/soapC.o: g++ -c generated/soapC.cpp -o generated/soapC.o -s -DDAEMON_NAME='"onvif_srvd"' -DDAEMON_MAJOR_VERSION=1 -DDAEMON_MINOR_VERSION=1 -DDAEMON_PATCH_VERSION=0 -DDAEMON_PID_FILE_NAME='"onvif_srvd.pid"' -DDAEMON_LOG_FILE_NAME='"onvif_srvd.log"' -DDAEMON_NO_CHDIR=1 -DDAEMON_NO_CLOSE_STDIO=0 -I./src -I./generated -I./gsoap-2.8/gsoap -I./gsoap-2.8/gsoap/custom -I./gsoap-2.8/gsoap/plugin -I./gsoap-2.8/gsoap/import -std=c++11 -O2 -Wall -pipe
I'm suspecting it's because the RPi ran out of ram (only 1GB). Do you have any idea how to resolve this problem? I have tried playing around with the memory splitting and swap file size, but nothing seems to work. Is the compilation process multi- threaded or single threaded?

Thanks

Error getting file gsoap_2.8.55.zip from SF

Hi !

There is a problem in getting the file gsoap_2.8.55.zip from the resource sourceforge.net
Do you know the alternative ? Or can you put this file to yourself ?

TNX !

compile on windows

hi
thanks for your good project
how can i compile it on windows?
and after that how can I feed a video stream to it?
for example I feed it a movie ,and nvr device(client) play move as onvif camera main stream!

best regards

Error: "Connection refused" using iSpy Agent DVR

I'm coding with VSCode on Ubuntu (18.04) on a VM.
I downloaded the latest Version of your repo and from gsoap (2.8.122).

I have a IP based Camera with an RTSP and HTTP Stream and want to make it ONVIF compatible through onvif_srvd.

After compiling and trying to get a connection to the Camera via the iSpy Agent DVR I got the following error:

[00007f51a00060e0] live555 demux error: Failed to connect with rtsp://10.50.8.121:1026/
[00007f51a0008b10] main stream error: connection failed: Connection refused
[00007f51a0008b10] satip stream error: Failed to connect to RTSP server 10.50.8.121:1026
[00007f51a0008b10] main stream error: connection failed: Connection refused
[00007f51a0008b10] access_realrtsp stream error: cannot connect to 10.50.8.121:1026
[00007f51a0008b10] main stream error: Connection failed
[00007f51a0008b10] main stream error: VLC could not connect to "10.50.8.121:1026".
[00007f5190072010] main input error: Your input can't be opened
[00007f5190072010] main input error: VLC is unable to open the MRL 'rtsp://10.50.8.121:1026/'. Check the log for details.
Error: SourceError: Camera 1: CoreLogic.Sources.Combined.VlcStream:Source Error

I also tried using HTTP, but the following errors come up:

[00007f6284009760] access stream error: HTTP connection failure
[00007f6284009760] main stream error: connection failed: Connection refused
[00007f6284009760] http stream error: cannot connect to 10.50.8.121:80
[00007f622000d9c0] main input error: Your input can't be opened
[00007f622000d9c0] main input error: VLC is unable to open the MRL 'http://10.50.8.121:80/camera.mjpeg'. Check the log for details.
Error: SourceError: Camera 1: CoreLogic.Sources.Combined.VlcStream:Source Error

I am using the S90onvif_srvd script, to start the DEAMON with the following arguments:

DAEMON_ARGS="$DAEMON_ARGS --ifs enp0s3"
DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/name/TestDev"
DAEMON_ARGS="$DAEMON_ARGS --scope onvif://www.onvif.org/Profile/S"
DAEMON_ARGS="$DAEMON_ARGS --name Cam1_RTSP --width 1920 --height 1080 --url rtsp://%s:1026/ --type JPEG"
DAEMON_ARGS="$DAEMON_ARGS --name Cam1_HTTP --width 1920 --height 1080 --url http://%s:80/camera.mjpeg --type JPEG"

The IP from my System is: 10.50.8.121
Config from ServiceContext: (I also tried it with a user and pw, it didn't change anything)
port ( 3000 ),
user ( "" ),
password ( "" ),

//Device Information
manufacturer ( "me" ),
model ( "my_cam" ),
firmware_version ( "1.0" ),
serial_number ( "1.0" ),
hardware_id ( "1.0" ),

This is what the log says:

14:54:33 | intervals: Camera 1: Reconnecting
14:54:33 | vlc start
14:54:33 | intervals: Camera 1: Reconnect Exit
14:54:33 | Discovery: Camera 1: ONVIF v2.0
14:54:33 | Discovery: Camera 1: Using Media Version 1
14:54:33 | vlc started
14:54:33 | SourceError: Camera 1: CoreLogic.Sources.Combined.VlcStream:Source Error
14:54:33 | Error: SourceError: Camera 1: CoreLogic.Sources.Combined.VlcStream:Source Error
14:54:33 | VLC stopped
14:54:33 | SourcePlayingFinished: Camera 1: Playing finished (SourceError)
14:54:33 | Reconnect: Camera 1: Reconnecting in 30s

I am searching for the error but I can't find it.
I hope that you can help me. If you need any more information, please let me know.

Thank you so much! :)

All client applications fails at GetProfiles

Hi,

I successfully compiled this application for MIPS and it runs fine too. But all onvif client applications fail to register my ipcamera with error "Failed in decoding device's response for ONVIF command: GetProfiles".

I could see some "NAN" values mentioned in Ranges, is that an issue?

Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">SOAP-ENV:Header<wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.onvif.org/ver10/media/wsdl/GetProfiles</wsa5:Action></SOAP-ENV:Header>SOAP-ENV:Bodytrt:GetProfilesResponse<trt:Profiles token="Profile_0" fixed="true">tt:NameProfile_0</tt:Name><tt:VideoSourceConfiguration token="Profile_0">tt:Name</tt:Name>tt:UseCount0</tt:UseCount>tt:SourceTokenProfile_0</tt:SourceToken><tt:Bounds x="0" y="0" width="1920" height="1080"></tt:Bounds></tt:VideoSourceConfiguration><tt:VideoEncoderConfiguration token="Profile_0">tt:NameProfile_0</tt:Name>tt:UseCount0</tt:UseCount>tt:EncodingH264</tt:Encoding>tt:Resolutiontt:Width1920</tt:Width>tt:Height1080</tt:Height></tt:Resolution>tt:QualityNAN</tt:Quality>tt:RateControltt:FrameRateLimit0</tt:FrameRateLimit>tt:EncodingInterval0</tt:EncodingInterval>tt:BitrateLimit0</tt:BitrateLimit></tt:RateControl>tt:H264tt:GovLength40</tt:GovLength>tt:H264ProfileMain</tt:H264Profile></tt:H264>tt:Multicasttt:Addresstt:TypeIPv4</tt:Type></tt:Address>tt:Port0</tt:Port>tt:TTL0</tt:TTL>tt:AutoStartfalse</tt:AutoStart></tt:Multicast>tt:SessionTimeoutPT0S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:PTZConfiguration token="PTZCfgToken" MoveRamp="0" PresetRamp="0" PresetTourRamp="0">tt:NamePTZCfg</tt:Name>tt:UseCount0</tt:UseCount>tt:NodeTokenPTZNodeToken</tt:NodeToken>tt:DefaultAbsolutePantTiltPositionSpacehttp://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace</tt:DefaultAbsolutePantTiltPositionSpace>tt:DefaultAbsoluteZoomPositionSpacehttp://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace</tt:DefaultAbsoluteZoomPositionSpace>tt:DefaultRelativePanTiltTranslationSpacehttp://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace</tt:DefaultRelativePanTiltTranslationSpace>tt:DefaultRelativeZoomTranslationSpacehttp://www.onvif.org/ver10/tptz/ZoomSpaces/TranslationGenericSpace</tt:DefaultRelativeZoomTranslationSpace>tt:DefaultContinuousPanTiltVelocitySpacehttp://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace</tt:DefaultContinuousPanTiltVelocitySpace>tt:DefaultContinuousZoomVelocitySpacehttp://www.onvif.org/ver10/tptz/ZoomSpaces/VelocityGenericSpace</tt:DefaultContinuousZoomVelocitySpace>tt:DefaultPTZSpeed<tt:PanTilt x="NAN" y="NAN" space="http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace"></tt:PanTilt><tt:Zoom x="NAN" space="http://www.onvif.org/ver10/tptz/ZoomSpaces/ZoomGenericSpeedSpace"></tt:Zoom></tt:DefaultPTZSpeed>tt:DefaultPTZTimeoutPT00H00M05S</tt:DefaultPTZTimeout>tt:PanTiltLimitstt:Rangett:URIhttp://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace</tt:URI>tt:XRangett:MinNAN</tt:Min>tt:MaxNAN</tt:Max></tt:XRange>tt:YRangett:MinNAN</tt:Min>tt:MaxNAN</tt:Max></tt:YRange></tt:Range></tt:PanTiltLimits>tt:ZoomLimitstt:Rangett:URIhttp://www.onvif.org/ver10/tptz/ZoomSpaces/PositionGenericSpace</tt:URI>tt:XRangett:MinNAN</tt:Min>tt:MaxNAN</tt:Max></tt:XRange></tt:Range></tt:ZoomLimits>tt:Extensiontt:PTControlDirectiontt:EFliptt:ModeOFF</tt:Mode></tt:EFlip>tt:Reversett:ModeOFF</tt:Mode></tt:Reverse></tt:PTControlDirection></tt:Extension></tt:PTZConfiguration></trt:Profiles></trt:GetProfilesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

I have attched the complete log here. Any help is highly appreciated.

Thanks,
Dinesh
onvif_log.txt

Build failure due to missing fcntl.h include

On Apline Linux build fails due to missing fcntl.h include. After adding missing include into daemon.c build succeeds:

#include <fcntl.h>

g++ -c src/daemon.c -o src/daemon_debug.o -DDEBUG -g -DDAEMON_NAME='"onvif_srvd"' -DDAEMON_MAJOR_VERSION=1 -DDAEMON_MINOR_VERSION=1 -DDAEMON_PATCH_VERSION=0 -DDAEMON_PID_FILE_NAME='"onvif_srvd.pid"' -DDAEMON_LOG_FILE_NAME='"onvif_srvd.log"' -DDAEMON_NO_CHDIR=1 -DDAEMON_NO_CLOSE_STDIO=1 -I./src -I./generated -I./gsoap-2.8/gsoap -I./gsoap-2.8/gsoap/custom -I./gsoap-2.8/gsoap/plugin -I./gsoap-2.8/gsoap/import -std=c++11 -O2 -Wall -pipe
src/daemon.c: In function 'int redirect_stdio_to_devnull()':
src/daemon.c:170:28: error: 'O_RDWR' was not declared in this scope
170 | fd = open("/dev/null", O_RDWR);
| ^~~~~~
src/daemon.c:170:10: error: 'open' was not declared in this scope; did you mean 'popen'?
170 | fd = open("/dev/null", O_RDWR);
| ^~~~
| popen
src/daemon.c: In function 'int create_pid_file(const char*)':
src/daemon.c:204:30: error: 'O_RDWR' was not declared in this scope
204 | fd = open(pid_file_name, O_RDWR | O_CREAT, 0644);
| ^~~~~~
src/daemon.c:204:39: error: 'O_CREAT' was not declared in this scope
204 | fd = open(pid_file_name, O_RDWR | O_CREAT, 0644);
| ^~~~~~~
src/daemon.c:204:10: error: 'open' was not declared in this scope; did you mean 'popen'?
204 | fd = open(pid_file_name, O_RDWR | O_CREAT, 0644);
| ^~~~
| popen
make: *** [Makefile:162: src/daemon_debug.o] Error 1

Getting Started

I downloaded this project but I was not able to get it working immediately. I eventually got it working and thought I'd share how I did to save other people time and effort. Perhaps these suggestions can be added to the README or code.

To get the code to compile, I had to modify the Makefile and append chrono_time_point.cpp to the SOAP_SRC variable:

SOAP_SRC = ... $(GSOAP_CUSTOM_DIR)/chrono_time_point.cpp

To be able to test with Lingodigit ONVIF Device Tool I had to specify my computers IP (e.g. 192.168.1.99) as well as the port number used by onvif_srvd (i.e. 1000) in the Add dialog:

URI: http://192.168.1.99:1000/onvif/device_service

When starting Lingodigit ONVIF Device Tool it pops up a dialog:

Please check wsdd is in /usr/local/bin/wsdd

I put the wsdd executable in /usr/local/bin/ and I also tried /usr/local/bin/wsdd/. I still get the error. I don't know why it doesn't work or how to fix it. At first I thought this might be why I couldn't connect to onvif_srvd but it doesn't seem to be needed. Once I added the port number, it worked.

WS-Security Isn't working [I did compiled with WSSE_ON=1]

Hi!
I compiled this program with the flag make WSSE_ON=1 for WS-Security

onvid_srvd is started with user and password options :

1466 root ./onvif_srvd --pid_file /var/run/onvif_srvd.pid --model
MJSXJ02CM --manufacturer Xiaomi --firmware_ver 3.4.2_0062 --ifs wlan0
--port 5000 --scope onvif://www.onvif.org/Profile/S --name HD --width 
1920 --height 1080 --url rtsp://192.168.1.47:8554/mainstream --type H264
--user XXXXX --password YYYYYY --ptz --move_left eval echo pan forward 5 
 /mnt/sdcard/hacks/motor_control/event --move_right eval echo pan reverse 5 > /mnt/sdcard/hacks/motor_control/event --move_up eval echo tilt forward 5 > /mnt/sdcard/hacks/motor_control/event --move_down eval echo tilt reverse 5 > /mnt/sdcard/hacks/motor_control/event

But still, If I use onvifer on my phone, I did not configure any account
and password and I'm still able to access the webcam.

Here is my fork of this repo
https://github.com/thewh1teagle/onvif_srvd

Thanks!

How to create users through Onvif in RPI

Hello,
I'm trying to Implement CreateUsers, still did not get how to create users using CreateUsers in ServiceDevice.cpp and soap_new_set_tt__User.
Can anyone help one how to create users?

Regards,
Nolan

How to add soapPTZBindingService

Hi,

I am trying to add the APPLY(PTZBindingService, soap) in onvif_srvd.c, i am getting the error as below

src/onvif_srvd.c:146:9: error: ‘PTZBindingService’ was not declared in this scope
APPLY(PTZBindingService, soap)
^
src/onvif_srvd.c:171:40: note: in definition of macro ‘DECLARE_SERVICE’
#define DECLARE_SERVICE(service, soap) service service ## _inst(soap);
^
src/onvif_srvd.c:424:5: note: in expansion of macro ‘FOREACH_SERVICE’
FOREACH_SERVICE(DECLARE_SERVICE, soap)
^
src/onvif_srvd.c:146:9: error: ‘PTZBindingService_inst’ was not declared in this scope
APPLY(PTZBindingService, soap)
^
src/onvif_srvd.c:174:26: note: in definition of macro ‘DISPATCH_SERVICE’
else if (service ## _inst.dispatch() != SOAP_NO_METHOD) {
^
src/onvif_srvd.c:441:9: note: in expansion of macro ‘FOREACH_SERVICE’
FOREACH_SERVICE(DISPATCH_SERVICE, soap)
^
Makefile:160: recipe for target 'src/onvif_srvd_debug.o' failed
make: *** [src/onvif_srvd_debug.o] Error 1

How can i resolve this issue

wsdl2h generation stage

hi Mr @KoynovStas

how did u combine .wsdl and .xsd file to generate corresponding .h file with generated wsdl2h.exe(at previos stage) ?

abviously these wsdl generate those .h:
devicemgmt.wsdl ---> "soapDeviceBindingService.h"
media.wsdl ---> "soapMediaBindingService.h"
ptz.wsdl ---> "soapPTZBindingService.h"

I saw in make file:

---- gSOAP ----

$(GENERATED_DIR)/onvif.h:
@$(build_gsoap)
@mkdir -p $(GENERATED_DIR)
$(WSDL2H) -d -t ./wsdl/typemap.dat -o $@ $(WSDL_FILES)
$(WSSE_IMPORT)
........
......
and in typemap.dat:

OASIS recommended prefixes

wsnt = http://docs.oasis-open.org/wsn/b-2
wsntw = http://docs.oasis-open.org/wsn/bw-2
wsrfbf = http://docs.oasis-open.org/wsrf/bf-2
wsrfr = http://docs.oasis-open.org/wsrf/r-2
wsrfrw = http://docs.oasis-open.org/wsrf/rw-2
wstop = http://docs.oasis-open.org/wsn/t-1

the available xsd file in your project are mentioned there!

but i didnt understand the relation between them

best regards

Access from outside network

If the Onvif device has the IP address 192.168.30.111 and my computer's IP address is 192.168.30.99, then everything works fine. However, when my computer's IP is changed to 208.127.237.84, I am unable to receive the video stream from the Onvif device. I suspect there may be a setting that allows for access from outside of the network. Can anyone offer assistance in locating this setting?

wrong license

This project was originally licensed by me under the license of BSD-3-Clause.
But we use gsoap in this project. And we use the free version. According to the gsoap license,
we must license our project under the GPLv2 license.
We have the right to leave the license of files licensed under the BSD-3-Clause license unchanged!

Since BSD-3-Clause is compatible with the GPLv2 license see: The Free-Libre/Open Source Software (FLOSS) License Slide

So I'm gona change the license of the entire project to GPLv2 and leave the files with the BSD license unchanged.
These outside the project files (separately from the project) can be used under the license of the BSD.
Whereas the entire project is still licensed under GPLv2.

Look for a similar request for my wsdd project, there is a dialogue between me and the representatives of the gsoap.

with WSSE_ON=1 compilation failed

If whit WSSE_ON=1 compilation failed. The makefile should be modified to add this information.

SOAP_SRC += $(GSOAP_DIR)/stdsoap2.cpp
$(GSOAP_DIR)/dom.cpp
$(GSOAP_CUSTOM_DIR)/duration.c
$(GSOAP_CUSTOM_DIR)/struct_timeval.c \

memory peak

Help! I find when the program run for a long time, memory increase infinitely. Is anybody have this situation? Thanks!

Cross Compile

Hello! First of all, thank you for sharing the project. While doing the project I wanted to cross-compile and make this project available on my embedded board(arm7l). However, I am having a hard time figuring this out. Do you know or is there a specific command for cross-compiling in this project?

Adding UniFi cameras to external DVR

Hello!
I want to add UniFi cameras running via UniFi Protect application on UniFi Dream Machine Pro to external DVR - HQvision HQ-THD3204A-720P, that allows to add Hikvision or ONVIF cameras only (UniFi cameras have RTSP stream only). While searching for a way to connect these cameras, I found this project. I cross compiled onvif_srvd binary for UniFi Dream Machine Pro (arm64 architecture) with WSSE_ON=1 flag. I run daemon on UDM with this flags:
onvif_srvd --ifs br0 --scope onvif://www.onvif.org/name/cam-loc-pp-a --scope onvif://www.onvif.org/Profile/Streaming --name RTSP --width 1024 --height 576 --url rtsp://%s:7447/key --type H264
After starting, I can view a stream from a camera on Windows computer using ONVIF Device Manager. But on the DVR I can add camera and it shows as online, but stream doesn't appear. I tried some changes (better/worse quality, other stream type), but still it's not possible to view stream from UniFi cameras (also in some cases it was not possible to view stream in ONVIF Device Manager). Are there any other ways to run these streams on the DVR?

Broadcast

Hi
I am trying to setup Onvif server on broadcast, could you help

Onvif Device Manager can't 'discover' this device?

GREAT template! I just have a simple question.
I have the sample server (onvif_srvd) running on my linux device address 192.168.200.2 by running the provided script 'S90onvif_srvd start'

I can talk to the onvif_srvd using the other linux client sample by running the command ./ipconvif 192.168.200.2:1000

But when I run the suggested Onvif Device Manager on windows, I cannot 'discover' the device that's running onvif_srvd. What should I do to make the device discoverable?

on_worker_error : "SOAP-ENV:Sender"

Hi,

When i run ONVIF_SRVD_DEBUG on My PC it work fine without any error with the onvif-device-tool_16.05-20160518_Xenial_amd64 tool, and the same code is cross compiled and ONVIF_SRVD_DEBUG ported to NXP processor and if i run the ONVIF_SRVD_DEBUG, i am getting below error in the debug prints of onvif-device-tool_16.05-20160518_Xenial_amd64 tool,

Test HTTP digest...
initDevice: HTTP digest support: 0
device support GetServices (ONVIF v2.x)
unhandled service: http://www.onvif.org/ver10/device/wsdl
address: http://127.0.0.1:4000
media service: http://127.0.0.1:4000
on_worker_error : "SOAP-ENV:Sender"
wsdd: probe_done
on_pushButton_probe_clicked
on_listWidget_Devices_currentRowChanged: -1
WSDDThread::probe
addDevice : "http://192.168.36.75:4000" , manual: true
"[Manual]\nsanthosh\nAddress: 192.168.36.75\nFirmware: 1.1\nLocation: "
on_listWidget_Devices_currentRowChanged: 0
on_listWidget_Devices_currentRowChanged: row 0 => manual 0
initDevice: time skew 171311744 sec
now = Mon Jun 24 21:14:16 2019

Test HTTP digest...
initDevice: HTTP digest support: 0
device support GetServices (ONVIF v2.x)
unhandled service: http://www.onvif.org/ver10/device/wsdl
address: http://127.0.0.1:4000
media service: http://127.0.0.1:4000
on_worker_error : "SOAP-ENV:Sender"
wsdd: probe_done

How to resolve this

the onvif_srvd is not detected by NVR

hi again Mr @KoynovStas
I compiled it successfully
and run this command:

~/onvif_srvd-master$ onvif_srvd --ifs eth0 --scope onvif://www.onvif.org/name/TestDev --scope onvif://www.onvif.org/Profile/S --name RTSP --width 800 --height 600 --url rtsp://%s:554/unicast --type JPEG"

but the onvif camera is not discovered buy testing application neither able to manually add by its ip ant its port!!
(by the way I connect by wifi not ethernet)
whats the problem?

best regard

Media2 Service support

@KoynovStas
When will you provide the support of Media2(ver20) Service in your repository and Is there any other repository which will provide the support of it?

Build error on arm-64 board

Thanks for this project.

Problem describe:
I build this project on arm-64 board locally, using the system gSOAP.
The print info shows it did find gSOAP paths, but at next step it throws an error that can't open file "custom/duration.h".

Board info:
Hardware: RK3588, armv8.
OS: Debian 11, Linux 5.10.160.
gSOAP version: 2.8.104-3 arm64

Operate steps:
(1) on board, apt update, apt install gsoap libgsoap-dev, apt install flex bison byacc make cmake m4.
(2) on PC, download the master branch zip, then unzip it and copy it to board.
(3) on board, make.

Build logs:

root@lubancat:/home/onvif_srvd-master# cmake -B build . -DUSE_SYSTEM_GSOAP=1
-- Generator is set to: Unix Makefiles
-- No CMAKE_BUILD_TYPE specified, force set to: Release
-- The CXX compiler identification is GNU 10.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Searching gSOAP
-- GSOAP_VERSION         = 2.8.104
-- GSOAP_INCLUDE_DIR     = /usr/include
-- GSOAP_CUSTOM_DIR      = /usr/share/gsoap/custom
-- GSOAP_IMPORT_DIR      = /usr/share/gsoap/import
-- GSOAP_PLUGIN_DIR      = /usr/share/gsoap/plugin
-- GSOAP_WS_DIR          = /usr/share/gsoap/WS
-- GSOAP_C_LIBRARY       = /usr/lib/aarch64-linux-gnu/libgsoap.so
-- GSOAP_CK_C_LIBRARY    = /usr/lib/aarch64-linux-gnu/libgsoapck.so
-- GSOAP_SSL_C_LIBRARY   = /usr/lib/aarch64-linux-gnu/libgsoapssl.so
-- GSOAP_CXX_LIBRARY     = /usr/lib/aarch64-linux-gnu/libgsoap++.so
-- GSOAP_CK_CXX_LIBRARY  = /usr/lib/aarch64-linux-gnu/libgsoapck++.so
-- GSOAP_SSL_CXX_LIBRARY = /usr/lib/aarch64-linux-gnu/libgsoapssl++.so
-- GSOAP_SOAPCPP2        = /bin/soapcpp2
-- GSOAP_WSDL2H          = /bin/wsdl2h
-- Found gSOAP: /usr/lib/aarch64-linux-gnu/libgsoap.so  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/onvif_srvd-master/build
root@lubancat:/home/onvif_srvd-master# cmake --build build
Scanning dependencies of target generate_version
[  0%] Built target generate_version
[  6%] Creating gSOAP binding file
Saving /home/onvif_srvd-master/build/generated/onvif.h


**  The gSOAP WSDL/WADL/XSD processor for C and C++, wsdl2h release 2.8.104
**  Copyright (C) 2000-2020 Robert van Engelen, Genivia Inc.
**  All Rights Reserved. This product is provided "as is", without any warranty.
**  The wsdl2h tool and its generated software are released under the GPL.
**  ----------------------------------------------------------------------------
**  A commercial use license is available from Genivia Inc., [email protected]
**  ----------------------------------------------------------------------------

Reading type definitions from type map "/home/onvif_srvd-master/wsdl/typemap.dat"
Reading '/home/onvif_srvd-master/wsdl/b-2.xsd'...
Done reading '/home/onvif_srvd-master/wsdl/b-2.xsd'
Reading '/home/onvif_srvd-master/wsdl/bf-2.xsd'...
Done reading '/home/onvif_srvd-master/wsdl/bf-2.xsd'
Reading '/home/onvif_srvd-master/wsdl/common.xsd'...
Done reading '/home/onvif_srvd-master/wsdl/common.xsd'
Reading '/home/onvif_srvd-master/wsdl/devicemgmt.wsdl'...
Done reading '/home/onvif_srvd-master/wsdl/devicemgmt.wsdl'
Reading '/home/onvif_srvd-master/wsdl/media.wsdl'...
Done reading '/home/onvif_srvd-master/wsdl/media.wsdl'
Reading '/home/onvif_srvd-master/wsdl/onvif.xsd'...
  Reading schema '/home/onvif_srvd-master/wsdl/common.xsd'...
  Done reading '/home/onvif_srvd-master/wsdl/common.xsd'
Done reading '/home/onvif_srvd-master/wsdl/onvif.xsd'
Reading '/home/onvif_srvd-master/wsdl/ptz.wsdl'...
Done reading '/home/onvif_srvd-master/wsdl/ptz.wsdl'
Reading '/home/onvif_srvd-master/wsdl/t-1.xsd'...
Done reading '/home/onvif_srvd-master/wsdl/t-1.xsd'

Note: option -p auto-enabled to generate wrappers for built-in types derived from xsd__anyType to support polymorphism in XML by (de)serializing any derived type of xsd:anyType (or xsd:anySimpleType) as elements annotated by xsi:type attributes in XML, use option -P to suppress and disable this feature

To finalize code generation, execute:
> soapcpp2 /home/onvif_srvd-master/build/generated/onvif.h
Or to generate C++ proxy and service classes:
> soapcpp2 -j /home/onvif_srvd-master/build/generated/onvif.h

[ 13%] Creating gSOAP stubs and glue code

**  The gSOAP code generator for C and C++, soapcpp2 release 2.8.104
**  Copyright (C) 2000-2020, Robert van Engelen, Genivia Inc.
**  All Rights Reserved. This product is provided "as is", without any warranty.
**  The soapcpp2 tool and its generated software are released under the GPL.
**  ----------------------------------------------------------------------------
**  A commercial use license is available from Genivia Inc., [email protected]
**  ----------------------------------------------------------------------------

Critical error: Cannot open file "custom/duration.h" to import: No such file or directory
Hint: use option -I<path> (for example -Igsoap:gsoap/import:gsoap/custom:.)
gmake[2]: *** [CMakeFiles/onvif_srvd.dir/build.make:81:generated/soapC.cpp] 错误 1
gmake[1]: *** [CMakeFiles/Makefile2:151:CMakeFiles/onvif_srvd.dir/all] 错误 2
gmake: *** [Makefile:103:all] 错误 2

Extra info:
(1) The system gSOAP files did exist:

root@lubancat:/# find -name "*duration.h"
find: ‘./run/user/1000/gvfs’: 权限不够
find: ‘./proc/2603378’: 没有那个文件或目录
./usr/share/gsoap/custom/chrono_duration.h
./usr/share/gsoap/custom/duration.h
root@lubancat:/# cat /usr/share/gsoap/custom/duration.h
/*
        duration.h

        Custom serializer for xsd:duration stored in a LONG64 with millisecond
        (ms) precision.

        LONG64 is equivalent to long long int and int64_t

        Millisecond resolution (1/1000 sec) means 1 second = 1000.

        The `xsd__duration` type is a 64 bit signed integer that can represent
        106751991167 days forward (positive) and backward (negative), with
        increments of 1 ms (1/1000 second).

        Durations that exceed a month are always output in days, rather than
        months to avoid days-per-month conversion inacurracies.

        Durations that are received in years and months instead of total number
        of days from a reference point are not well defined, since there is no
        accepted reference time point (it may or may not be the current time).
        The decoder simple assumes that there are 30 days per month. For
        example, conversion of "P4M" gives 120 days. Therefore, the durations
        "P4M" and "P120D" are assumed to be identical, which is not necessarily
        true depending on the reference point in time.

        Rescaling of the duration value by may be needed when adding the
        duration value to a `time_t` value, because `time_t` may or may not
        have a seconds resolution, depending on the platform and possible
        changes to `time_t`.

        #import this file into your gSOAP .h file

        To automate the wsdl2h-mapping of xsd:duration to LONG64, add this
        line to the typemap.dat file:

        xsd__duration = #import "custom/duration.h" | xsd__duration

        The typemap.dat file is used by wsdl2h to map types (wsdl2h option -t).

        When using soapcpp2 option -q<name> or -p<name>, you must change
        duration.c as follows:

                #include "soapH.h"  ->  #include "nameH.h"

        Compile and link your code with custom/duration.c

gSOAP XML Web services tools
Copyright (C) 2000-2009, Robert van Engelen, Genivia Inc., All Rights Reserved.
This part of the software is released under ONE of the following licenses:
GPL or the gSOAP public license.
--------------------------------------------------------------------------------
gSOAP public license.

The contents of this file are subject to the gSOAP Public License Version 1.3
(the "License"); you may not use this file except in compliance with the
License. You may obtain a copy of the License at
http://www.cs.fsu.edu/~engelen/soaplicense.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the License.

The Initial Developer of the Original Code is Robert A. van Engelen.
Copyright (C) 2000-2009, Robert van Engelen, Genivia, Inc., All Rights Reserved.
--------------------------------------------------------------------------------
GPL license.

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA

Author contact information:
[email protected] / [email protected]

This program is released under the GPL with the additional exemption that
compiling, linking, and/or using OpenSSL is allowed.
--------------------------------------------------------------------------------
A commercial use license is available from Genivia, Inc., [email protected]
--------------------------------------------------------------------------------
*/

extern typedef long long xsd__duration; /* duration in ms (1/1000 sec) */

(2) I've tried git clone this project on board directly, and it occurs the same error.

Memory leak

I noticed some memory leaks after long use.
Using only the basic stream and snapshot functions the problem is not evident but, after implementing event management, growth is rapid.
If you wanto to test it, I'm able to replicate the problem using onvif device test tool and running Device Management - Capabilities group. Every run increases memory by approximately 4 KB.
I patched the last lines of onvif_srvd.c and it seems working:

        else
        {
            DEBUG_MSG("Unknown service\n");
        }
        soap_destroy(soap);
        soap_end(soap);
    }
    soap_free(soap);

    return EXIT_SUCCESS; // good job (we interrupted (finished) main loop)
}

Add other parameters...

Hi, I have devices that need "frame rate" and "quality" and "birate" fields. Without these fields do not work ... :(
Is there a possibility to add thi fields?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.