View Dahua camera's rtsp stream with Raspberry Pi omxplayer

toastie

Getting comfortable
Joined
Sep 30, 2018
Messages
254
Reaction score
82
Location
UK
I want to use a RPi as a tool to help me install a Dahua IPC-HDW5231RP-ZE outside. The Dahua camera is already working with my Hikvision NVR and PC inside. I want an alternative to using a smart phone.

I've been using a RPi and monitor for installing Hikvision cameras. It's simple to take outside the RPi, monitor, POE switch, camera, then one command in the terminal and the camera's image is displayed.
The Hikvision stream is typically rtsp://admin:<password>@<IP address of camera >/h264/ch1/sub/av_stream. This does not work though for the Dahua camera.

(Incidentally using VLC the Hikvision NVR stream is rtsp://admin:<password@<NVR's IP>:554/Streaming/Channels/101 or 102 but would be less easy for me to take outside my desktop PC to view the Dahua camera)

None of the Dahua camera rtsp input lines I've seen have worked for my RPI's omxplayer.
What Dahua rtsp stream description might work with omxplayer?
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,681
Reaction score
14,043
Location
USA
Here is one of my omxplayer startup commands for a dahua camera.
Change subtype to 2 or 3 for sub streams.
Code:
omxplayer --lavfdopts probesize:25000 --no-keys --live --timeout 30 --aspect-mode stretch --nohdmiclocksync --avdict rtsp_transport:tcp --win "1440 0 1920 360" "rtsp://user:pass@192.168.0.39/cam/realmonitor?channel=1&subtype=1"
 

toastie

Getting comfortable
Joined
Sep 30, 2018
Messages
254
Reaction score
82
Location
UK
Many many thanks bp2008, your command works in the RPi's terminal to display my Dahua camera. I'm not certain yet why my original command line didn't work. So far it's a bit of a mystery.

Edit. I found the difference, for the Dahua camera to be displayed I need to include in quotation marks "rtsp://<user>:<password>@<camera IP>/cam/realmonitor?channel=1&subtype=1"
 
Last edited:

Nick6

n3wb
Joined
May 15, 2020
Messages
18
Reaction score
2
Location
EU
Hi guys, have you found a way to keep omxplayer running and restoring the feed after a disconnect?
 

toastie

Getting comfortable
Joined
Sep 30, 2018
Messages
254
Reaction score
82
Location
UK
Hi guys, have you found a way to keep omxplayer running and restoring the feed after a disconnect?
Sorry but no, my CCTV activities have been on hold for many many months, my new RV has occupied far more time than I ever expected, then we've had Covid-19. Currently I happy running 5 cameras feeding a Hikvision NVR and W10 BI. That said I'm now scoping out the installation of camera 6, probably the Dahua I have in stock, next year cameras 7 and 8 will be more to capture wildlife at the rear of our property.
 

smole

Young grasshopper
Joined
Dec 5, 2017
Messages
93
Reaction score
18
You can use rpisurv - SvenVD/rpisurv

It works great and will restart if you disconnect, even if a camera feed goes down it will continue to try and reconnect.
It's best to add a restart cron job if the Rpisurv is used 24/7.
 
Top