BreeeZe / rpos

Raspberry Pi Onvif Server
http://breeeze.github.io/rpos
MIT License
643 stars 146 forks source link

Using ONVIF with virtual video #108

Open EduardoRonchi opened 3 years ago

EduardoRonchi commented 3 years ago

Hello, I tested this project with a raspberry pi 3 and a raspicam v1 and it worked great. Right now I trying to use RPOS to stream via ONVIF a virtual video created with V4L2 Loopback.

With Python + OpenCV + V4L2 I dump the MJPEG video to /dev/video1 and with RPOS using the usbcam config. rpos USBCAM config: { "NetworkAdapters" : ["awdl0","eth0", "wlan0", "en0"], "IpAddress" : "192.168.0.10", "ServicePort" : 8081, "Username" : "admin", "Password" : "admin", "CameraType" : "usbcam", "CameraDevice" : "/dev/video1", "RTSPAddress" : "", "//":"Normally left blank. Used to set RTSP Server Address", "RTSPPort" : 8554, "RTSPName" : "h264", "MulticastEnabled" : false, "MulticastEnabledComment" : "## Multicast is not supported for USB ca$ "RTSPMulticastName" : "h264m", "MulticastAddress" : "224.0.0.1", "MulticastPort" : "10001", "RTSPServer" : 3, "RtspServerComment" : "## Select RTSP Server > 1:RPOS RTSP Server 2:V4L2 RTSP Se$ "PTZDriver" : "none", "PTZDriverComment": "## valid values are none,tenx,pelcod,visca and pan-tilt$ "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 }

Troubleshooting:

So the MJPEG stream seems Ok. I also ran ffplay /dev/video1 and the stream is OK.

Any ideas why this is not working? The virtual video resolution is 160x120 (it is a thermal cam via SPI video), that might be a problem?

EduardoRonchi commented 3 years ago

Update: I used the v4l2tools to encode the MJPEG video from /dev/video1 to h264 and output it to /dev/video2 with the command: sudo ./v4l2tools/v4l2compress_omx /dev/video1 /dev/video2 and usind ffplay /dev/video2 i get the following stream with some green stripe: image

When I tried to use rpos to stream with rstp option 3 from /dev/video2 I got nothing in the onvif device manager.

Any ideas or suggestions to get this stream working with onvif device manager?