User Tools

Site Tools


solutions:video_stream_using_rpi_as_proxy

This is an old revision of the document!


Intro

Nowadays, IP camera's manufacturers does not provide unauthorized access to video stream due to security reasons. To get video stream to WebHMI it should be without login/password to access.

The solution, is the shim web server in LAN, which will transcode H.264 to MJPEG. (e.g. Raspberry Pi)

Devices prerequisites

Any camera, that can show stream using rstp: or http: protocol. By default, cgi should be enabled manually in settings.
Hikvision: Configuration, Network, Advanced Settings, Enable Hikvision-CGI. Dahua: Configuration, Network, Advanced Settings, Enable Hikvision-CGI.

Tested devices list:

Dahua DH-IPC-K22

( link: http://login:password@ip-camera:80/cgi-bin/mjpg/video.cgi?channel=1&subtype=1 )

Hikvision DS-2CD2423G0-IW

( link: http://login:password@ip-camera:80/Streaming/channels/102/httpPreview )

VLC transcode

It can be done with Windows machine or Linux, e.g. Rapsbian on Raspberry Pi. Let's consider using Rapsberry Pi 3B+ powered Raspbian 10.

To do this, VLC player is preinstalled with Rapsbian. To start with, login to IP-camera and check the settings, if cgi enabled and test access via link using browser. Then, copy following link to terminal and test with -vvv argument.

In the end, create a .sh script and add to autorun

cvlc -vvv -Idummy rtsp://student:Hikvision@192.168.1.58:554/Streaming/Channels/102  --sout "#transcode{vcodec=MJPG}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"

The output should not have warning and unresolved errors such as no codecs finded Command to output and argument explanations

Dahua

 #full crop 
cvlc -Idummy http://admin:admin@192.168.1.101/cgi-bin/mjpg/video.cgi?channel=1&subtype=1 --sout "#transcode{vcodec=MJPG}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
cvlc -Idummy rtsp://admin:admin@192.168.1.101/cgi-bin/mjpg/video.cgi?channel=1&subtype=1 --sout "#transcode{vcodec=MJPG}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
 
#width crop 
cvlc -Idummy http://admin:admin@192.168.1.101/cgi-bin/mjpg/video.cgi?channel=1&subtype=1 --sout "#transcode{vcodec=MJPG,vfilter=canvas{width=640,height=480}}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
cvlc -Idummy rtsp://admin:admin@192.168.1.101/cgi-bin/mjpg/video.cgi?channel=1&subtype=1 --sout "#transcode{vcodec=MJPG,vfilter=canvas{width=640,height=480}}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"

Hikvision

#full 
cvlc -Idummy rtsp://student:Hikvision@192.168.1.58:554/Streaming/Channels/102  --sout "#transcode{vcodec=MJPG}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
cvlc -Idummy http://student:Hikvision@192.168.1.58:80/Streaming/channels/102/httpPreview --sout "#transcode{vcodec=MJPG}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
 
#width crop 
cvlc -Idummy rtsp://student:Hikvision@192.168.1.58:554/Streaming/Channels/102  --sout "#transcode{vcodec=MJPG,vfilter=canvas{width=640,height=480}}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
cvlc -Idummy http://student:Hikvision@192.168.1.58:80/Streaming/channels/102/httpPreview --sout "#transcode{vcodec=MJPG,vfilter=canvas{width=640,height=480}}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=192.168.1.192:8888/}"
solutions/video_stream_using_rpi_as_proxy.1627633399.txt.gz ยท Last modified: 2021/07/30 08:23 by atolstov

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki