This is an old revision of the document!
Table of Contents
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. Raspbian on 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.
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
...
Command to output and argument explanations
#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/}"