Git Product home page Git Product logo

rpos's Introduction

rpos

Node.js based ONVIF Camera/NVT software that turns a Raspberry Pi, Windows, Linux or Mac computer into an ONVIF Camera and RTSP Server. It implements the key parts of Profile S and Profile T (http://www.onvif.org). It has special support for the Raspberry Pi Camera and Pimoroni Pan-Tilt HAT.

RPOS won an award in the 2018 ONVIF Open Source Challenge competition.

History and Contributors

The initial goal (by @BreeeZe) was to provide a ONVIF Media service which is compatible with Synology Surveillance Station to allow the Raspberry Pi to be used as a surveillance camera without the need for adding any custom camera files to your Synology NAS.

This version uses a patched version of the "node-soap" v0.80 library (https://github.com/vpulim/node-soap/releases/tag/v0.8.0) located @ https://github.com/BreeeZe/node-soap

The next goal (by @RogerHardiman) was to implement more of the ONVIF standard so that RPOS could be used with a wide range of CCTV systems and with ONVIF Device Manager and ONVIF Device Tool. Additional ONVIF Soap commands were added including the PTZ Service with backend drivers that control the Raspberry Pi Pan-Tit HAT or emit various RS485 based PTZ protocols including Pelco D and Sony Visca.

Oliver Schwaneberg added GStreamer gst-rtsp-server support as third RTSP Server option.

Casper Meijn added Relative PTZ support

Johnny Wan added some USB Camera support for GStreamer RTSP server.

If I've forgotten to put you in the list, please post an Issue Report and I can add you in.

Features:

  • Implements the ONVIF Standard for a CCTV Camera and NVT (Network Video Transmitter)
  • Streams H264 video over RTSP from the Official Raspberry Pi camera (the one that uses the ribbon cable) and some USB cameras
  • Uses hardware H264 encoding using the GPU on the Pi
  • Implements Camera control (resolution and framerate) through ONVIF
  • Can set other camera options through a web interface.
  • Discoverable (WS-Discovery) on Pi/Linux by CCTV Viewing Software
  • Works with ONVIF Device Manager (Windows) and ONVIF Device Tool (Linux)
  • Works with other CCTV Viewing Software that implements the ONVIF standard including Antrica Decoder, Avigilon Control Centre, Bosch BVMS, Milestone, ISpy (Opensource), BenSoft SecuritySpy (Mac), IndigoVision Control Centre and Genetec Security Centre (add camera as ONVIF-BASIC mode)
  • Implements ONVIF Authentication
  • Implements Absolute, Relative and Continuous PTZ and controls the Pimononi Raspberry Pi Pan-Tilt HAT
  • Can also use the Waveshare Pan-Tilt HAT with a custom driver for the PWM chip used but be aware the servos in their kit do not fit so we recommend the Pimoroni model
  • Also converts ONVIF PTZ commands into Pelco D and Visca telemetry on a serial port (UART) for other Pan/Tilt platforms (ie a PTZ Proxy or PTZ Protocol Converter)
  • Can reference other RTSP servers, which in turn can pull in the video via RTSP, other ONVIF sources, Desktop Capture, MJPEG allowing RPOS to be a Video Stream Proxy
  • Implements Imaging service Brightness and Focus commands (for Profile T)
  • Implements Relay (digital output) function
  • Supports Unicast (UDP/TDP) and Multicast using mpromonet's RTSP server
  • Supports Unicast (UDP/TCP) RTSP using GStreamer
  • Works as a PTZ Proxy
  • Also runs on Mac, Windows and other Linux machines but you need to supply your own RTSP server. An example to use ffserver on the Mac is included.
  • USB cameras supported via the GStreamer RTSP server with limited parameters available. Tested with JPEG USB HD camera

Picture of RPOS running on a Pi with the PanTiltHAT and Pi Camera Picture of RPOS running on a Pi 3 with the PiMoroni PanTiltHAT and Official Pi Camera

How to Install on a Raspberry Pi:

STEP 1 - CONFIG RASPBERRY PI

Windows/Mac/Linux users can skip this step

STEP 1.a - ENABLE RASPBERRY PI CAMERA

(For Raspberry PI camera) Pi users can run ‘raspi-config’ and enable the camera and reboot

STEP 1.b - ADJUST GPU MEMORY

(For USB camera, and need to use hardware encoding acceleration) Add ‘gpu_mem=128’ in /boot/bootconf.txt and reboot

STEP 2 - INSTALL NODEJS AND NPM

[This step was tested in Raspberry Pi OS from June 2021. Older Pis may need some manual steps] On the Pi you can install nodejs (ver10) and npm (5.8.0) with this command

sudo apt install nodejs npm

Next we install 'n', a node version manager and install Node v12 and NPM v6

sudo npm install -g n
sudo n install 12

Log out and log back in for the Path changes to take effect. You should now have Node v12 (check with node -v) and NPM v6 (check with npm -v)

STEP 2.1.b - OTHER METHODS

Windows and Mac users can install Node from the nodejs.org web site.

Older Raspbian users (eg those running Jessie) can install NodeJS and NPM with these commands

  curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  sudo apt-get install nodejs

STEP 3 - GET RPOS SOURCE, INSTALL DEPENDENCIES

git clone https://github.com/BreeeZe/rpos.git
cd rpos
npm install

STEP 4 - COMPILE TYPESCRIPT(.ts) TO JAVASCRIPT(.js) using GULP

4.1.a

Use the npx command to run the 'gulp' script: (works for NPM 5.2 and higher)

npx gulp

STEP 5 - PICK YOUR RTSP SERVER

Select & setup an RTSP option for your platform.

RTSP Server options for Pi / Linux:

  1. RPOS comes with a pre-compiled ARM binary for a simple RTSP server. The source is in the ‘cpp’ folder. (option 1)
  2. mpromonet RTSP Server (option 2)
  3. GStreamer RTSP Server (option 3)

RTSP Server options 2 & 3 offer more features, but require additional setup. See instructions below. Currently USB camera is only supported by GStreamer RTSP Server

Windows users will need to run their own RTSP Server. Mac users can use the ffserver script.

Note: The choice of RTSP Server is made in rposConfig.json

STEP 5.a - OPTION 1: USING PRE-COMPILED ARM BINARY (deprecated)

This option is not recommended now. Please use Option 2 or Option 3 RPOS comes with a pre-compiled ARM binary for a simple RTSP server. The source is in the ‘cpp’ folder. No action required to use, this is pre-selected in rposConfig.json

Note that this option can be unstable, recommend option 2 or 3.

STEP 5.b - OPTION 2: USING MPROMONET RTSP SERVER

Raspberry Pi and Linux users will probably prefer the mpromonet RTSP server, as it has more options and supports multicasting.

Install dependencies and run setup script:

sudo apt-get install liblivemedia-dev
sh setup_v4l2rtspserver.sh

STEP 5.c - OPTION 3: USING GSTREAMER RTSP SERVER

Install the precompiled packages using apt, or compile them yourself for latest version.
Installing the packages using apt saves a lot of time, but provides a rather old gstreamer version.

5.c.1a - INSTALL GSTREAMER USING APT:

We will install lots of GStreamer Libraries and then the Python and GIR libraries (GIR allow other languages to access the GStreamer C API) If you only use USB cameras, some may not be needed but for simplicity I'll install them all here.

sudo apt install git gstreamer1.0-plugins-base \
 gstreamer1.0-plugins-bad  gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \
 gstreamer1.0-tools libgstreamer1.0-dev libgstreamer1.0-0-dbg \
 libgstreamer1.0-0 libgstrtspserver-1.0.0 \
 libgstreamer-plugins-base1.0-dev gtk-doc-tools \
 gstreamer1.0-omx-rpi gstreamer1.0-omx

You can check it is verson 1.14 with gst-launch-1.0 --version

Then install Python Binding, GIR Files (GObjectIntrospection Repository - makes APIs from C libraries)

sudo apt-get install python-gi gir1.2-gst-plugins-base-1.0 gir1.2-gst-rtsp-server-1.0
5.c.1b - INSTALL GST-RPICAMSRC FROM SOURCE

Currently Raspberry Pi OS installs GStreamer 1.14 which does not include the 'rpicamsrc' module so we will build it from source.

(starting in /rpos root directory)

cd ..
git clone https://github.com/thaytan/gst-rpicamsrc.git
cd gst-rpicamsrc
./autogen.sh
make
sudo make install
cd ..

Check successful plugin installation by executing

gst-inspect-1.0 rpicamsrc

Note: You do not need to load V4L2 modules when using rpicamsrc (option 3).

5.c.2 - INSTALL GST-RTSP-SERVER FROM SOURCE

No longer required. Raspberry Pi OS in June 2021 is shipping with GStreamer 1.14 and the Gst RTSP Server library is included

STEP 6 - EDIT CONFIG

Go back to the 'rpos' folder

Rename or copy rposConfig.sample-*.json to rposConfig.json. (Choosing the appropriate sample to start with)

  • Add a Username and Password for ONVIF access
  • Change the TCP Port for the Camera configuration and the ONVIF Services
  • Change the RTSP Port
  • Enable PTZ support by selecting Pan-Tilt HAT or RS485 backends (Visca and Pelco D)
  • Enable multicast
  • Switch to the mpromonet or GStreamer RTSP servers
  • Hardcode an IP address in the ONVIF SOAP messages

STEP 6 - CONFIG DETAILS

The Configuation is split into several sections

IP Address and Login Permissions

  • Network Adapters - Used by RPOS to probe network interfaces to try and work out its own IP Address
  • IPAddress - This can be used to override the auto detected IP address found by probing the Network Adapters list
  • Service Port - This is the TCP Port that RPOS listens on for ONVIF Connections
  • Username - The username used to connect to RPOS with
  • Password - The Password used to connect to RPOS with

Camera Source

This section helps RPOS know where to get live video from

  • Camera Type - Used to help RPOS automatically configure itself. Valid optins are "picam", "usbcam", "filesrc", "testsrc". 'picam' will select the Raspberry Pi camera on the ribbon cable, 'usbcam' will select a USB camera, 'filesrc' will open a JPEG or PNG video file and 'testsrc' displays a bouncing ball with clock overlay
  • CameraDevice - Provides extra information to go with the Camera Type. For 'usbcam' use the Video4Linux address of the camera, eg /dev/video0. For the 'filesrc' camera type, use the full path and filename of the jpeg or PNG file eg /home/pi/image.jpg

RTSP Server

This section helps RPOS know how to share the video via RTSP with viewers ... ...

STEP 7 - RUN RPOS.JS

First run (Skip with USB camera)

If you're using RTSP option 1 or 2, before you run RPOS for the first time you'll need to load the Pi V4L2 Camera Driver:

sudo modprobe bcm2835-v4l2

Initial setup is now complete!

Launch RPOS

To start the application:

node rpos.js

STEP 8 - EXTRA CONFIGURATION ON PAN-TILT HAT (Pimononi)

The camera on the Pan-Tilt hat is usually installed upside down. Goto the Web Page that runs with rpos http://<CameraIP>:8081 and tick the horizontal and vertial flip boxes and apply the changes.

Camera Settings

You can set camera settings by browsing to : http://CameraIP:Port/ These settings are then saved in a file called v4l2ctl.json and are persisted on rpos restart. The default port for RPOS is 8081. (Note that a lot of camera settings are now ignored by USB camera)

Known Issues

  • 1920x1080 can cause hangs and crashes with the original RTSP server. The mpromonet one may work better.
  • 1920x1080 can cause encoding issue with USB camera pipeline. 1280x720 is recommended now.
  • Not all of the ONVIF standard is implemented.

ToDo's (Help is Required)

  • Add MJPEG (implemented in gst-rtsp-server but still needs to return the correct ONVIF XML for MJPEG)
  • Support more parameters for USB cameras with GStreamer RTSP server [work underway by RogerHardiman. Help needed]
  • Support USB cameras with the Pi's Hardware H264 encoder (OMX) and the mpromonet RTP server (see https://github.com/mpromonet/v4l2tools)
  • Implement more ONVIF calls (Events, Analytics)
  • Test with ONVIF's own test tools (need a sponsor for this as we need to be ONVIF members to access the Test Tool)
  • Add GPIO digital input
  • Add two way audio with ONVIF back channel. We understand GStreamer has some support for this now.
  • and more...

rpos's People

Contributors

bendrexl avatar bradh avatar breeeze avatar caspermeijn avatar johnnyxwan avatar pistonov avatar rogerhardiman avatar schwaneberg avatar sunnyworm avatar swissarmybud avatar tminecola avatar wryun avatar zxp86021 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  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

rpos's Issues

Fix for incorrect SOAP envelope - causes ONVIF Device Manager to fail

Hi there
I'm new to NodeJS but have lots of ONVIF experience.

I tried rpos with ONVIF Device Manager on Windows
ONVIF Device Manager reports a SOAP error with a mis-match between SOAP2003 and SOAP2001 envelopes.

The workaround is to edit rpos/node_modules/soap/lib/server.js and to make this one line change

//  "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" " +
    "<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" " +

This lets ONVIF Device Manager receive SOAP messages.
There are still problems with the ONVIF messages but this fixes the first problem.

Roger

PTZ emulation/status

It would be awesome if this ONVIF server can show a virtual camera with its current orientation, changed by PTZ commands. Debugging PTZ-based apps would be made so much easier.

RPi newbie struggling to get this to work

I'm struggling to get this to work. I've worked through the read.me instructions and installed everything correctly (I think). I get some error messages when I run the sudo node rpos.js command.
I'm using an RPi3 with a RPi Camera module v1.3.

Problem with discovery probe message for tds:Device

Hi,

I am trying to change the part of discovery_service.ts to respond not as NetworkVideoTransmitter but as Device. In if statement of parseString function I changed NetworkVideoTransmitter to Device, as well as in SOAP message I replaced <d:Types>dn:NetworkVideoTransmitter</d:Types> to be <d:Types>tds:Device</d:Types>.

I am testing that with Onvif Test Tool 17 and seems this tool is sending first Device and then NetworkVideoTransmitter probe. While I can see that the message with my changes is replied - I am unable to discover the device with the tool. With NetworkVideoTransmitter it is working.

Can anyone give some hint how to fix that ?

Regards,
Krzysztof

Stream times out & start on boot?

Help would be greatly appreciated, relatively new to ONVIF streaming.

Setup has gone well, executed commands:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install npm
sudo npm install -g npm@latest
sudo apt-get install git
git clone https://github.com/BreeeZe/rpos.git
cd rpos
npm install
npx gulp or ./node_modules/gulp/bin/gulp.js
sudo apt-get install liblivemedia-dev
sh setup_v4l2rtspserver.sh
sudo raspi-config (enabled camera & ssh from menu)
sudo nano /etc/modules --> add this line for load drive at boot --> modprobe bcm2835-v4l2
node rpos.js

node.js starts like:
`Read IP address 192.168.1.236 from wlan0
Manufacturer : RPOS Raspberry Pi
Model : Model_PiZeroW_Revision_1.1
HardwareId :
SerialNumber : 00000000xxxxxxx
FirmwareVersion : 2.0.4
Starting camera settings webserver on http://192.168.1.236:8081/
Binding DeviceService to http://192.168.1.236:8081/onvif/device_service
Binding MediaService to http://192.168.1.236:8081/onvif/media_service
Binding PTZService to http://192.168.1.236:8081/onvif/ptz_service
Binding ImagingService to http://192.168.1.236:8081/onvif/imaging_service
discovery_service started
device_service started
Starting Live555 rtsp server
media_service started
ptz_service started
imaging_service started
rtspServer: Streaming on URL "rtsp://192.168.1.236:8554/h264"

(RTSP-over-HTTP tunneling is not available.)
`
VLC:
I open stream "rtsp://192.168.1.236:8554/h264", loads okay but stops after about 10 seconds.
The RPi Camera led lights up and goes off coinciding with the above.

Hikvision NVR:
The NVR discovers the camera all on its own and its a one click add.
Initially all seems fine but somehow the stream stops and can't be recovered and just says 'no link'.
The RPi Camera led stays on all the time.
Maybe it is something with the protocol, RSP, TDP, UDP, not sure what should be selected?

Boot:
Also how do I get this to start on boot for headless operation? I tried a number of tutorials but none of them worked out?

Is it possible to pull the stream twice from the camera, don't need to but just noticed I needed to make sure either VLC or the NVR was off as this seemed to cause the streaming to stop also.

Any other advice appreciated.

Thanks

The lastest version raspberry

Hello,
I RPOS 0.1.0 and I run rpos.js all goes well
I tried the latest release of RPOS and impossible to launch (with ts-node?), I to a file not found error typing main.d.ts
How to launch the latest release of RPOS on Raspberry with PICAM?
Thank you.

rtspServer error and no video

I installed rpos on a Raspberry Pi and although it is discovered by the Dahua NVR, the video is not generated. After approximately 30 seconds, the NVR stops trying to access the Raspberry Pi camera module. The current setup is the following;

Raspbian 9.6 - Stretch
Raspberry Pi 3 Model B Rev 1.2
Raspberry Pi Camera Module V2 - 8 Megapixel, 1080p

*** Changes made to rposConfig.json ***

"IpAddress" : "192.168.1.147", (this is the Raspberry Pi IP address)
"Username" : "admin",
"Password" : "admin",
"RTSPAddress" : "", "//":"Normally left blank. Used to set RTSP Server Address",
"RTSPPort" : 554, (get the same results even when set to default 8554)
"RTSPServer" : 2,
"Model" : "3 B",
"HardwareId" : "BCM2835"

pi@raspberrypi:~/rpos $ node rpos.js
Read IP address 192.168.1.147 from wlan0
Manufacturer : RPOS Raspberry Pi
Model : Model_B_PI_3
HardwareId : BCM2835
SerialNumber : 00000000d05f7f42
FirmwareVersion : 2.0.4
Starting camera settings webserver on http://192.168.1.147:8081/
Binding DeviceService to http://192.168.1.147:8081/onvif/device_service
Binding MediaService to http://192.168.1.147:8081/onvif/media_service
Binding PTZService to http://192.168.1.147:8081/onvif/ptz_service
Binding ImagingService to http://192.168.1.147:8081/onvif/imaging_service
discovery_service started
imaging_service started
ptz_service started
device_service started
Starting Live555 rtsp server
media_service started
rtspServer error: Error: spawn v4l2rtspserver ENOENT
(node:1232) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.


Additionally, the following error generated on a few occasions although the username and password was correct;

Invalid username/password with GetVideoEncoderConfiguration

Should the username and password in the rposConfig.json file be the same as the Raspberry Pi username and password? Also, the camera settings (http://192.168.1.147:8081/) have been set back to the default settings since none of the changes helped with this issue.

If anyone can tell me how to fix this issue, I would appreciate it.

Added suppport for USB Camera

I just realised that this didn't use USB camera. As right now I get

child_process.js:484
    throw err;
    ^

Error: Command failed: sudo v4l2-ctl --set-fmt-video=pixelformat=4

    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at Function.utils.execSync (/home/pi/rpos-0.1.0/lib/utils.js:94:66)
    at execV4l2 (/home/pi/rpos-0.1.0/lib/v4l2ctl.js:173:22)
    at Object.SetPixelFormat (/home/pi/rpos-0.1.0/lib/v4l2ctl.js:277:9)
    at Camera.setupCamera (/home/pi/rpos-0.1.0/lib/camera.js:129:27)
    at new Camera (/home/pi/rpos-0.1.0/lib/camera.js:44:14)
    at Object.<anonymous> (/home/pi/rpos-0.1.0/rpos.js:23:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

Any possibility that this could be added? It is apparantly not common for people to use USB Cameras as quick security cameras and everyone just uses the camera modules 😦

no method execSync

Hi, Im trying to start rpos with node using "node rpos.js", but I get an error message after few seconds

/home/pi/rpos-0.1.0/lib/utils.js:94 return utils.notPi() ? "" : require('child_process').execSync(cmd) ^ TypeError: Object #<Object> has no method 'execSync' at Function.utils.execSync (/home/pi/rpos-0.1.0/lib/utils.js:94:66) at Camera.loadDriver (/home/pi/rpos-0.1.0/lib/camera.js:126:15) at new Camera (/home/pi/rpos-0.1.0/lib/camera.js:41:14) at Object.<anonymous> (/home/pi/rpos-0.1.0/rpos.js:23:14) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16)

multiple video sources, multiple instances...

Could rpos have multiple instances running on alternate ports? (and is a pi3 capable of 2,3,4,x streams?)

this goes with my other post, if a pi can act as a proxy for other RTSP sources that don't support ONVIF, and it can handle at least a few, then rpos would be a pretty slick package!

thanks.

gulp compile fails; node 8.x

pi@raspberrypi:~/rpos $ npx gulp
[17:23:05] Using gulpfile ~/rpos/gulpfile.js
[17:23:05] Starting 'default'...
[17:23:05] Starting 'typings'...
[17:23:11] Finished 'typings' after 5.89 s
[17:23:11] Starting 'compile'...
/home/pi/rpos/typings/main/ambient/ip/index.d.ts(8,1): error TS1084: Invalid 'reference' directive syntax.
[17:23:25] TypeScript: 1 syntax error
[17:23:25] TypeScript: emit succeeded (with errors)
[17:23:25] Finished 'compile' after 15 s
[17:23:25] Finished 'default' after 20 s
pi@raspberrypi:~/rpos $ node --version
v8.11.1
pi@raspberrypi:~/rpos $ npm --version
6.1.0

XML for Fault Codes

Hi tried some of the unimplemented methods and verified them with the XML validity checker in SoapUI.

I think the fault responses are incorrect and should be like this (plus extra error codes for the future)
Even so, this is not 100% correct. It needs a lang='en' attribute on the Text field

var SENDER_NOT_AUTHORIZED = {
  Fault: {
    Code: {
      Value: "soap:Sender",
      Subcode: {
        Value: "soap:NotAuthorized",
      }
    },
    Reason: {
      Text: "Sender not authorized"
    }
  }
};


var UNKNOWN_ACTION = {
  Fault: {
    Code: {
      Value: "soap:Sender",
      Subcode: {
        Value: "soap:UnknownAction",
      }
    },
    Reason: {
      Text: "Unknown Action"
    }
  }
};

var NOT_IMPLEMENTED = {
  Fault: {
    Code: {
      Value: "soap:Sender",
      Subcode: {
        Value: "soap:ActionNotSupported"
      }
    },
    Reason: {
      Text: "Optional Action Not Implemented"
    }
  }
};

two-way audio

Hi- Could you please let me know how two-way audio is supported? Tnx

getting errors trying to install and configure

RogerHardiman if you are out there I could use some help. I've gone through the rpos install twice and am having a few minor problems. I feel as though all of the components are installed correctly but am unable to view the stream. I'm stuck. My end goal is to set up a RTSP camera on raspberry and link it into my Geovision Recording server as a RTSP feed across my network. I am unable to browse the feed in ONVIF Device Manager.

GetScopes failed, and with error msg string not xml/wsdl

I'm testing rpos with node-onvif module https://github.com/agsh/onvif
Some functions works but some failed.

I found these might be 3 bugs:

  1. GetScopes failed
  2. HTTP 200 OK
  3. Response should be wsdl, but it's returning error message string.

the following functions are OK:
/onvif/device_service:
GetCapabilities
/onvif/media_service
GetProfiles
GetVideoSources

But this Failed:
/onvif/device_service
GetScopes

The content POST to rpos:
POST-to-RPOS.txt

The content Responed from rpos:
Response-from-RPOS.txt

resolution or framerate is not controlled via ONVIF device manager

Now, I'm trying to use rpos in my RPI board and PI cam. During my testing, I used rpos control webpage and ONVIF device manager to control camera. The streaming is OK in VLC and ONVIF device manager.
I can control camera setting using default control webpage but I cannot find resolution or framerate in there. So I tried them in the ONVIF device manager but I failed. They are not controlled via ONVIF device manager. The resolution list is shown in the dropdown list but my selection is not applied.
How can I solve this?

npm install

pi@raspberrypi:~/rpos $ sudo npm install
(node:8782) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm WARN package.json [email protected] No license field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No license field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.14.71-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/rpos
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/rpos/npm-debug.log
npm ERR! not ok code 0

Can only watch 2 seconds of video

Successful installation to the Raspberry Pi but only about 2 seconds of video can be seen through ONVIF, there will be "NO SIGNAL", I don't know where there is a problem, this is Google Translate, I hope you can understand my meaning

Device not detected correctly from Milestone

Im not able to add the device to Milestone (2018 R3) i get pass the first step to add new hardware and it finds the correct hardware model text. But the next step fails with error message:

--
It was not possible to connect to or receive information from the hardware '192.168.123.110'.
Verify that the following is correct: address, port, user name, password and hardware driver.
Alternatively use auto-detection to find the hardware.

Im using the built in rtsp and the pi camera. I can access the RTSP url from VLC.

Any ideas?

This is the last debug output i get:

DeviceService - Calltype : info, Data : Handling POST on /onvif/device_service
DeviceService - Calltype : received, Data :
<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:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:tt="http://www.onvif.org/ver10/schema"
xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns:wsa5="http://www.w3.org/2005/08/addressing">
SOAP-ENV:Body
tds:GetNetworkInterfaces</tds:GetNetworkInterfaces>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

DeviceService - Calltype : info, Data : Attempting to bind to /onvif/device_service
DeviceService - Calltype : info, Data : Trying Device from path
DeviceService received request GetNetworkInterfaces
DeviceService - Calltype : replied, Data :
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:i0="http://www.onvif.org/ver10/device/wsdl"
xmlns:tns="http://tempuri.org/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns:tt="http://www.onvif.org/ver10/schema">
soap:Body
<tds:GetNetworkInterfacesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
xmlns="http://www.onvif.org/ver10/device/wsdl">
<tds:NetworkInterfaces token="lo"
xmlns:tt="http://www.onvif.org/ver10/schema">
tt:Enabledtrue</tt:Enabled>
tt:Info
tt:Namelo</tt:Name>
tt:HwAddress00-00-00-00-00-00</tt:HwAddress>
tt:MTU1500</tt:MTU>
</tt:Info>
tt:IPv4
tt:Enabledtrue</tt:Enabled>
tt:Config
tt:Manual
tt:Address127.0.0.1</tt:Address>
tt:PrefixLength8</tt:PrefixLength>
</tt:Manual>
tt:DHCPfalse</tt:DHCP>
</tt:Config>
</tt:IPv4>
</tds:NetworkInterfaces>
<tds:NetworkInterfaces token="eth0"
xmlns:tt="http://www.onvif.org/ver10/schema">
tt:Enabledtrue</tt:Enabled>
tt:Info
tt:Nameeth0</tt:Name>
tt:HwAddressb8-27-eb-d0-b0-81</tt:HwAddress>
tt:MTU1500</tt:MTU>
</tt:Info>
tt:IPv4
tt:Enabledtrue</tt:Enabled>
tt:Config
tt:Manual
tt:Address192.168.123.110</tt:Address>
tt:PrefixLength24</tt:PrefixLength>
</tt:Manual>
tt:DHCPfalse</tt:DHCP>
</tt:Config>
</tt:IPv4>
</tds:NetworkInterfaces>
</tds:GetNetworkInterfacesResponse>
</soap:Body>
</soap:Envelope>

--

onvif client sends GetProfiles producing error in onvif server

Hi,

I have an IP camera that uses ONVIF protocol. I am running your ONVIF server and when the IP camera sends GetProfiles the ONVIF server throws this error.

DeviceService - Calltype : error, Data : TypeError: Cannot read property 'output' of undefined
    at Object.p.onopentag (/home/pi/rpos-0.1.0/node_modules/soap/lib/wsdl.js:1255:40)
    at emit (/home/pi/rpos-0.1.0/node_modules/soap/node_modules/sax/lib/sax.js:639:35)
    at emitNode (/home/pi/rpos-0.1.0/node_modules/soap/node_modules/sax/lib/sax.js:644:5)
    at openTag (/home/pi/rpos-0.1.0/node_modules/soap/node_modules/sax/lib/sax.js:839:5)
    at Object.write (/home/pi/rpos-0.1.0/node_modules/soap/node_modules/sax/lib/sax.js:1278:15)
    at WSDL.xmlToObject (/home/pi/rpos-0.1.0/node_modules/soap/lib/wsdl.js:1381:5)
    at Server._process (/home/pi/rpos-0.1.0/node_modules/soap/lib/server.js:151:21)
    at IncomingMessage.<anonymous> (/home/pi/rpos-0.1.0/node_modules/soap/lib/server.js:124:14)
    at emitNone (events.js:67:13)
    at IncomingMessage.emit (events.js:166:7)

I would be great if you can give me some pointers how to solve this.

Regards,
Martin

Cannot connect to camera ip on port 8081

Hello, I believe I have everything installed correctly after having issues with node. I load the camera driver per instructions and run rpos.js. I cannot connect to the interface using 127.0.01:8081 or 192.168.1.xx on a different computer on the network. I really can't confirm that the service is running, not sure how to. Is there a step i'm missing here?

ERR_SERVER_ALREADY_LISTEN on running rpos.js

I'm trying to get this to work on a Raspberry Pi Zero W. But when I run the final command (sudo node rpos.js) I get this error. Does anybody have an idea how to resolve this?

Read IP address 192.168.1.130 from wlan0
Manufacturer : Raspberry Pi
Model : Zero W
HardwareId :
SerialNumber : 000000002d926624
FirmwareVersion : 2.0.0
Starting camera settings webserver on http://192.168.1.130:8081/
Binding DeviceService to http://192.168.1.130:8081/onvif/device_service
Binding MediaService to http://192.168.1.130:8081/onvif/media_service
Uncaught Exception... : Error [ERR_SERVER_ALREADY_LISTEN]: Listen method has been called more than once without closing.
at Server.listen (net.js:1446:11)
at MediaService.SoapService.start (/home/pi/rpos/lib/SoapService.js:26:24)
at Object. (/home/pi/rpos/rpos.js:32:15)
at Module._compile (module.js:641:30)
at Object.Module._extensions..js (module.js:652:10)
at Module.load (module.js:560:32)
at tryModuleLoad (module.js:503:12)
at Function.Module._load (module.js:495:3)
at Function.Module.runMain (module.js:682:10)
at startup (bootstrap_node.js:191:16)

RTSP server : latency of video

I use VLC or some DVR (for example https://geniusvision.net/ ) test on your software and I see that the quality isn't good, sometimes video is delayed.
I tested with another rtsp on PI https://github.com/mpromonet/h264_v4l2_rtspserver
with video 720/1280 (15 to 30fps) it seems better (no delay)
I suggest that maybe you should switch to this library or do you have any idea?
(In my opinion, you called execution file from nodejs)
I'm researching a library support RTSP, ONVIF, discovery for Raspberry to build a smart camera from Pi, the final target is integrating Raspberry smart camera to any DVRs or NVRs.
I hope get some advises from you.
Regards
Bao

ONVIF Manager

It works, but ONVIF manager does not discover it on the network?

Unable to install

Hi

I'm having issues getting this installed. Running the latest release of Raspian and when I run the npm install from the rpos directory I get the following items logged. I'm running everything under su.

image

Any ideas?

error TS2307: Cannot find module 'ip'.

I was following the steps and when I ran ./node_modules/gulp/bin/gulp.js I receive the following output:
[17:12:24] Using gulpfile ~/rpos/gulpfile.js
[17:12:24] Starting 'default'...
[17:12:24] Starting 'typings'...
[17:12:26] Finished 'typings' after 2.09 s
[17:12:26] Starting 'compile'...
services/device_service.ts(10,21): error TS2307: Cannot find module 'ip'.
[17:12:38] TypeScript: 1 semantic error
[17:12:38] TypeScript: emit succeeded (with errors)
[17:12:38] Finished 'compile' after 12 s
[17:12:38] Finished 'default' after 14 s

Any ideas on how to resolve this error?

Installation instructions?

I found this project because I want to have a few Raspberries (preferably Zero W's) with Pi camera's around my house, connected to Surveillance Station on my SynologyDS1511+. I am fairly new to Linux.

But the installation instructions confuse me. I find something here, but also here. Do I have to combine these or use only one of them?

Problem setting bitrate through web interface

While using rpos, I noticed that when setting video_bitrate through the web interface, the value is not preserved. The value always reads '0' in the v4l2ctl.json settings file. I tracked this down to what I think is a RegExp bug in v4l2ctl.ts

In the ReadControls() function, we take the control name and append the variable regexPart to create a RegExp that is matched against the output of v4l2-ctl -l command.

The problem shows when two different controls start the same way: in this case video_bitrate_mode and video_bitrate. The regex will match video_bitrate_mode for both controls. So, when you attempt to set video_bitrate, it takes affect and even gets written to file correctly. But anytime the file is read, the value of video_bitrate_mode will be captured for both controls.

To fix, you could change

var regexPart = ".*value=([0-9]*)";

to

var regexPart = "\\s.*value=([0-9]*)";

This will require whitespace after the control name, which will limit the RegExp to only match the correct control.

sudo node rpos.js

Read IP address 192.168.1.196 from eth0 Manufacturer : Raspberry Pi Model : 2 B HardwareId : SerialNumber : 0000000099774564 FirmwareVersion : 2.0.0 Starting camera settings webserver on http://192.168.1.196:8081/ Binding DeviceService to http://192.168.1.196:8081/onvif/device_service Binding MediaService to http://192.168.1.196:8081/onvif/media_service Uncaught Exception... : Error [ERR_SERVER_ALREADY_LISTEN]: Listen method has bee n called more than once without closing. at Server.listen (net.js:1425:11) at MediaService.SoapService.start (/home/pi/rpos/lib/SoapService.js:26:24) at Object.<anonymous> (/home/pi/rpos/rpos.js:32:15) at Module._compile (internal/modules/cjs/loader.js:654:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) at Module.load (internal/modules/cjs/loader.js:566:32) at tryModuleLoad (internal/modules/cjs/loader.js:506:12) at Function.Module._load (internal/modules/cjs/loader.js:498:3) at Function.Module.runMain (internal/modules/cjs/loader.js:695:10) at startup (internal/bootstrap/node.js:201:19)

how to solved the problem?

raspberry pi streaming with python picamera

I have successfully install the RPOS and able to run it on raspberry Pi.
For rasberry Pi, the python library Picamera support output the video to file and stream at same time, i.e.

camera.start_recording('1.h264', splitter_port=1) 
camera.start_recording(stream, format='h264', splitter_port=2

I am wondering how the above codes can be combined with the RPOS, i.e. RPOS open a stdin stream and the above script output h264 to the stream. Thx.

multiple video sources

The code seems to default to /dev/video0. When I plugged in an additional usb camera it became /dev/video0 and the RPi cam became /dev/video1. The program then gave me the error message that pixelformat was was an invalid argument.
So this is not a bug, but so that if anyone else has a similar problem with more than one camera, you need a way to change the /dev/video#.
It would be nice to be able to hang more than one camera off the RPi and serve them via this webpage.

Milestone issue

Hi! New to both raspian and github here. Having some issues with getting my camera into Milestone. Have everything installed (?) according to readme, but can't get it to work. Shows up and is discovered with hardware and everything in Milestone, can also connect but shows "no video". Had a couple of blips with video when I look at recording, but unfortuneately cannot identify what exacly I did differently then. If anyone can help, highly appreciated.

This is what i get when node rpos.js (launching driver with modprobe first)

pi@raspberrypi:~/rpos $ Read IP address 10.0.212.200 from eth0
Manufacturer : RPOS Raspberry Pi
Model : Model_PiZeroW_Revision_1.1
HardwareId :
SerialNumber : 0000000005115329
FirmwareVersion : 2.0.4
Starting camera settings webserver on http://10.0.212.200:8081/
Binding DeviceService to http://10.0.212.200:8081/onvif/device_service
Binding MediaService to http://10.0.212.200:8081/onvif/media_service
Binding PTZService to http://10.0.212.200:8081/onvif/ptz_service
Binding ImagingService to http://10.0.212.200:8081/onvif/imaging_service
discovery_service started
ptz_service started
imaging_service started
device_service started
Starting Live555 rtsp server
media_service started
--LAST LINE, nothing more happens--

My rposConfig.json:

"NetworkAdapters" : ["awdl0","eth0", "wlan0", "en0"],
"IpAddress" : "10.0.212.200",
"ServicePort" : 8081,
"Username" : "pi",
"Password" : "xxxx",
"RTSPAddress" : "", "//":"Normally left blank. Used to set RTSP Server Address",
"RTSPPort" : 8554,
"RTSPName" : "h264",
"MulticastEnabled" : false,
"RTSPMulticastName" : "h264m",
"MulticastAddress" : "224.0.0.1",
"MulticastPort" : "10001",
"RTSPServer" : 2, "RtspServerComment" : "## Select RTSP Server > 1:RPOS RTSP Server 2:V4L2 RTSP Server by mpromonet (auto selected if MulticastEnabled=true)",
"PTZDriver" : "none", "PTZDriverComment": "## valid values are none,tenx,pelcod,visca and pan-tilt-hat",
"PTZOutput" : "none", "PTZOutputComment": "## values are none (eg Tenx), serial and tcp",
"PTZSerialPort" : "/dev/ttyUSB0",
"PTZSerialPortSettings" : { "baudRate":2400, "dataBits":8, "parity":"none", "stopBits":1 },
"PTZOutputURL": "127.0.0.1:9999",
"PTZCameraAddress": 1,
"DeviceInformation" : {
"Manufacturer" : "Raspberry Pi",
"Model" : "2 B",
"HardwareId" : ""
},
"logLevel" : 3, "logLevelComment": "## LogLevels are > 1:Error 2:Warning 3:Info 4:Debug",
"logSoapCalls" : false
}

pi@raspberrypi:/rpos $ npm -v
6.7.0
pi@raspberrypi:
/rpos $ node -v
v10.15.0

Camera:
PiNoir, working fine with raspistill

EDIT: it is working with server alternative 1, but not mpromonet (2/3)

ERR_SERVER_ALREADY_LISTEN

Read IP address 10.168.1.40 from eth0
Manufacturer : Banana Pi
Model : M2+
HardwareId :
SerialNumber : 02c000812232c635
FirmwareVersion : 0.2.1
Binding DeviceService to http://10.168.1.40:8880/onvif/device_service
Binding MediaService to http://10.168.1.40:8880/onvif/media_service
net.js:1372
throw new ERR_SERVER_ALREADY_LISTEN();
^

Error [ERR_SERVER_ALREADY_LISTEN]: Listen method has been called more than once without closing.
at Server.listen (net.js:1372:11)
at MediaService.SoapService.start (/root/rpos-gateway-0.2.1/lib/SoapService.js:26:24)
at Object. (/root/rpos-gateway-0.2.1/rpos-gateway.js:42:15)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)

Cannot start up rpos.js

Hi,
I followed the instructions shown in text file. I used the following to start raspivid

root@raspberrypi:/home/pi/live/raspi# raspivid -o - -fps 25 -t 0 -b 800000 -n -w 1280 -h 720 | ./testRaspi

"h264" stream, from the file "stdin"
Play this stream using the URL "rtsp://192.168.1.123:8554/h264"

(We use port 80 for optional RTSP-over-HTTP tunneling.)

After this, I ran rpos.js. I have been losing my head over this for two days now. When i ran raspivid, it does not create /dev/video0 device as well.

root@raspberrypi:/home/pi/rpos-0.1.0# sudo node rpos.js
execSync('sudo cat /proc/cpuinfo')
Read IP address from awdl0 failed
Read IP address 192.168.1.123 from eth0
Manufacturer : Raspberry Pi
Model : 2 B
HardwareId : 
SerialNumber : 00000000f212401e
FirmwareVersion : 0.1.0
execSync('sudo modprobe bcm2835-v4l2')
Starting camera settings webserver on http://192.168.1.123:8081/
execSync('sudo v4l2-ctl --set-fmt-video=pixelformat=4')
Failed to open /dev/video0: No such file or directory
child_process.js:484
    throw err;
    ^

Error: Command failed: sudo v4l2-ctl --set-fmt-video=pixelformat=4
Failed to open /dev/video0: No such file or directory

    at checkExecSyncError (child_process.js:441:13)
    at Object.execSync (child_process.js:481:13)
    at Function.utils.execSync (/home/pi/rpos-0.1.0/lib/utils.js:94:66)
    at execV4l2 (/home/pi/rpos-0.1.0/lib/v4l2ctl.js:173:22)
    at Object.SetPixelFormat (/home/pi/rpos-0.1.0/lib/v4l2ctl.js:277:9)
    at Camera.setupCamera (/home/pi/rpos-0.1.0/lib/camera.js:129:27)
    at new Camera (/home/pi/rpos-0.1.0/lib/camera.js:44:14)
    at Object.<anonymous> (/home/pi/rpos-0.1.0/rpos.js:23:14)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

rtspServer

i get the following message. Is it possible to publish the source code of rtspServer, I assume its a modified live555proxy. That runs fine without this message.

rtspServer: Streaming on URL "rtsp://a.a.a.a:8554/h264"

(RTSP-over-HTTP tunneling is not available.)

Also any luck with implementing login ID and password

rtspServer vs v4l2rtspserver / DVR multi-view screen issues

We recently got RPOS up and running on both a Raspberry Pi Zero W and a Pi 3.

When using rtspServer ("RTSPServer" : 1 in rposConfig.json) we would get
errors including: "rtspServer: StreamParser::afterGettingBytes() warning: read 4294967295 bytes: expected no more than 15000"

We then switched over to using v4l2rtspserver ("RTSPServer" : 2 in rposConfig.json) and started getting a nice stable image without any errors.

But there is a new issue on the other end of things at the Security Camera DVR, we cannot see the Raspberry Pi's video feed in any multi view screen (where you can see 4 or more cameras at once). We can only see the video feed in single view (just viewing our Raspberry Pi camera). (Note: Tested on two different models of DVR with the same results.)

Has anyone had this issue before? Is there another setting needed for v4l2rtspserver?

Focus commands are not transmitted

When I send the zoom in/out onvif commands to the RPI, the zoom command is transmitted to the RS232 port.
I get on the rs232 following code (Pelco D):
FF 01 00 20 00 00 21
FF 01 00 40 00 00 41
When I send the focus near/far onvif commands to the RPI, the focus commands are not transmitted to the RS232 port.
But I get the STOP command when I send focus near/far. See code (Pelco D):
FF 01 00 00 00 00 01 - it is not right !
I should to get:
FF 01 00 80 00 00 81
FF 01 01 00 00 00 02

ONVIF support keyboard can't connect to rpos

Hi,
I used C400-I from MYTECH. I had a couple of ONVIF supported camera different model/manuf manage to connect to C400 keyboard but RPOS failed to connect. I check SOAP request from the keyboard controller,

"<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"><s:Header><wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tplt="http://www.onvif.org/ver10/plus/schema" xmlns:tpl="http://www.onvif.org/ver10/plus/wsdl">wsse:UsernameTokenwsse:Usernameusername1</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">fctLh7e3HR6fKUc4qB6/ihbjoh8=</wsse:Password>wsse:Nonce5FWQrVNVT1MjvLR5mVfXPQ==</wsse:Nonce>wsu:Created2010-01-01T00:19:17Z</wsu:Created></wsse:UsernameToken></wsse:Security></s:Header><s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"></s:Body></s:Envelope>"

the request used s:Envelopve and s:Body instead of soap:Envelope / soap:Body.
can this be the problem why RPOS failed to connect?

I have another DVR manage to connect to RPOS and control everything. The request is below

"DeviceService - Calltype : received, Data :
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema">
soap:Header
<wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-35" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
wsse:Usernameadmin</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">xi2ZdakrUDkgOpA4ROWIE/5EIDI=</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">Jy3sZ5N9TOudLga1rlu/RA==</wsse:Nonce>
wsu:Created2018-08-26T16:04:28Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
soap:Body
tds:SetSystemDateAndTime
tds:DateTimeTypeManual</tds:DateTimeType>
tds:DaylightSavingsfalse</tds:DaylightSavings>
tds:TimeZone
tt:TZCST-8</tt:TZ>
</tds:TimeZone>
tds:UTCDateTime
tt:Time
tt:Hour16</tt:Hour>
tt:Minute5</tt:Minute>
tt:Second2</tt:Second>
</tt:Time>
tt:Date
tt:Year2018</tt:Year>
tt:Month8</tt:Month>
tt:Day26</tt:Day>
</tt:Date>
</tds:UTCDateTime>
</tds:SetSystemDateAndTime>
</soap:Body>
</soap:Envelope>
"

Pls advice thanks.

RTSP Server 3 Option - gstreamer issues

Hi - I've worked through the install using a Raspbi Zero W with the NoIR camera module. My objective is to move away from flaky VLC streaming to something more elegant - I'm going to pick up the stream with SecuritySpy.

I'm not very experienced with this sort of thing, so excuse me if this is a dumb question. How can I fix this error in the python that refers to the get-rtsp-launch? I'm pretty confident that the install went OK, but this has me stumped.

The readme suggests that it's an option on the "RTSP Server" line but there are only comments for options 1 and 2, so I kind of assumed that it was 3.

pi@raspicam:~/rpos $ node rpos.js
Read IP address 192.168.0.134 from wlan0
Manufacturer : RPOS Raspberry Pi
Model : Model_PiZeroW_Revision_1.1
HardwareId : 
SerialNumber : 00000000fbfaae5f
FirmwareVersion : 2.0.4
Starting camera settings webserver on http://192.168.0.134:8081/
Binding DeviceService to http://192.168.0.134:8081/onvif/device_service
Binding MediaService to http://192.168.0.134:8081/onvif/media_service
Binding PTZService to http://192.168.0.134:8081/onvif/ptz_service
Binding ImagingService to http://192.168.0.134:8081/onvif/imaging_service
discovery_service started
device_service started
Starting Live555 rtsp server
media_service started
ptz_service started
imaging_service started
rtspServer: Traceback (most recent call last):

rtspServer:   File "./python/gst-rtsp-launch.py", line 44, in <module>
    import gi
ImportError: No module named gi

rtspServer exited with code: 1

EDIT: Just running through the install of this now: https://www.npmjs.com/package/gi
EDIT 2: Didn't make any difference to the error. But this is the snippet:

# --------------------------------------------------------------------------- # 
# Use gi to import GStreamer functionality
# --------------------------------------------------------------------------- # 
import gi
gi.require_version('Gst','1.0')
gi.require_version('GstRtspServer','1.0')
gi.require_version('GstVideo','1.0')
from gi.repository import GObject, Gst, Gio, GstVideo, GstRtspServer, GLib

from threading import Thread, Lock
cam_mutex = Lock()
# -------------------

Present mjpeg stream instead of h264

I have a project where I would like to present the video as mjpeg over http. I know the info is in the Onvif standard how to do this. But its alot of info to go thru.
Perhaps someone here could point out some directions or fill in some additional info?

Installation on Stretch

On a pi zero W with Raspbian GNU/Linux 9 stretch, nodejs version 4.8.2, I receive the following errors when following the installation instructions (note that previous steps completed OK):

pi@raspberrypi:~/onvif/rpos $ sudo npm install
npm WARN deprecated [email protected]: Typings is deprecated in favor of NPM @types -- see README for more information
npm WARN deprecated [email protected]: Use uuid module instead
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'gulp-sourcemaps/map-sources' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'gulp-sourcemaps'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 4.9.41+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/onvif/rpos
npm ERR! node -v v4.8.2
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR! fetch failed https://registry.npmjs.org/update-notifier/-/update-notifier-0.6.3.tgz
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
-
> [email protected] install /home/pi/onvif/rpos/node_modules/serialport
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v46-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v46 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/onvif/rpos/node_modules/serialport/build'
  CXX(target) Release/obj.target/serialport/src/serialport.o
  CXX(target) Release/obj.target/serialport/src/serialport_unix.o
  CXX(target) Release/obj.target/serialport/src/serialport_poller.o
  SOLINK_MODULE(target) Release/obj.target/serialport.node
  COPY Release/serialport.node
make: Leaving directory '/home/pi/onvif/rpos/node_modules/serialport/build'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/onvif/rpos/npm-debug.log
npm ERR! not ok code 0


pi@raspberrypi:~/onvif/rpos $ ./node_modules/gulp/bin/gulp.js
module.js:327
    throw err;
    ^

Error: Cannot find module 'gulp-sourcemaps'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/pi/onvif/rpos/gulpfile.js:8:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

Access to Service

Hi,

I started your application with sudo node rpos.js and its started well and without error.
When Im trying to access the DeviceService and MediaServer, which are avaible on x.x.x.x:8081/onvif/device_service x.x.x.:8081/onvif/media_service I just become a empty page.

use as a gateway for RTSP streams?

How easily might it be to use rpos to pull an RTSP stream from another device instead of using video0?

There are a few cameras out there (a couple geovision, but mostly the ubiquiti UVC line) that doesn't support ONVIF despite being a decent h264 1080p camera.

I'd love to put a Pi in acting as a proxy and offering up those RTSP streams via an ONVIF interface.

onvif not working through openvpn address

Hi,
I am using GST-RTSP-SERVER (server option 3) on the Raspberry Pi, the network adapter is set to eth0.
on the Mac I use SecuritySpy and the address is set to same address as eth0(192.168.1.99) and the connection is built successfully.
I tried
`sudo tcpdump -i any port 8554
and got the traffics.

However, when I change the network adapter from eth0 to tun1 (openVPN) on Pi, and on the Mac I set the address to the same address as tun1(10.8.0.156), the connection failed.
I tried
`sudo tcpdump -i any port 8554
but got nothing.

Then, I try to connect the rtsp server by tun1 address, i.e. rtsp://10.8.0.156:8554/h264 and it works. (through VLC player)

I am wondering which part goes wrong?

rposConfig.json:

{
"NetworkAdapters" : ["tun1"],
"IpAddress" : "",
"ServicePort" : 8081,
"Username" : "pi",
"Password" : "pi",
"RTSPAddress" : "", "//":"Normally left blank. Used to set RTSP Server Address",
"RTSPPort" : 8554,
"RTSPName" : "h264",
"MulticastEnabled" : false,
"RTSPMulticastName" : "h264m",
"MulticastAddress" : "224.0.0.1",
"MulticastPort" : "10001",
"RTSPServer" : 3, "RtspServerComment" : "## Select RTSP Server > 1:RPOS RTSP Server 2:V4L2 RTSP Server by mpromonet (auto selected if MulticastEnabled=true)",
"PTZDriver" : "none", "PTZDriverComment": "## valid values are none,tenx,pelcod,visca and pan-tilt-hat",
"PTZOutput" : "none", "PTZOutputComment": "## values are none (eg Tenx), serial and tcp",
"PTZSerialPort" : "/dev/ttyUSB0",
"PTZSerialPortSettings" : { "baudRate":2400, "dataBits":8, "parity":"none", "stopBits":1 },
"PTZOutputURL": "127.0.0.1:9999",
"PTZCameraAddress": 1,
"DeviceInformation" : {
"Manufacturer" : "Raspberry Pi",
"Model" : "2 B",
"HardwareId" : ""
},
"logLevel" : 4, "logLevelComment": "## LogLevels are > 1:Error 2:Warning 3:Info 4:Debug",
"logSoapCalls" : false
}

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.