solutions:video_stream_using_rpi_as_proxy
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
solutions:video_stream_using_rpi_as_proxy [2021/07/30 07:17] – atolstov | solutions:video_stream_using_rpi_as_proxy [2022/01/15 01:30] (current) – ↷ Links adapted because of a move operation 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Intro ==== | + | {{ network: |
+ | ====== Video stream proxy ====== | ||
- | Nowadays, IP camera' | + | ===== Intro ===== |
- | To get video stream to WebHMI it should be without login/ | + | |
+ | Nowadays, IP camera' | ||
- | The solution, is the shim web server in LAN, which will transcode H.264 to MJPEG. (e.g. Raspberry Pi) | + | The solution, is the shim web server in LAN, which will transcode H.264 to MJPEG. (e.g. Raspberry Pi). |
+ | Also, this could be a Linux or Windows powered machine. | ||
- | ==== Devices prerequisites ==== | + | ===== Devices prerequisites |
- | Any camera, that can show stream using rstp:// or http:// protocol | + | ==== IP Webcam testing app ==== |
- | By default, cgi should be enabled manually in settings.\\ | + | |
- | '' | + | |
- | Tested devices list: | + | If there is no IP camera at moment, you can use [[https:// |
- | **Dahua** DH-IPC-K22 | ||
- | **Hikvision** DS-2CD2423G0-IW < | + | Any IP camera, that can show stream using rtsp:// or http:// protocol. |
+ | You can see the links at IP Webcam app screen. When the IP Webcam server started, it has default cgi access via link < | ||
+ | |||
+ | ==== IP camera CGI setting ==== | ||
+ | By default, cgi should be enabled manually in settings.\\ | ||
+ | '' | ||
+ | '' | ||
+ | |||
+ | |||
+ | === Tested devices list: === | ||
+ | For example, there was a two different manufacturers devices tested. | ||
+ | **Dahua** DH-IPC-K22 | ||
+ | |||
+ | **Hikvision** DS-2CD2423G0-IW <code bash cgi-link> | ||
==== VLC transcode ==== | ==== VLC transcode ==== | ||
- | It can be done with Windows | + | * WebHMI with IP 192.168.1.1 |
+ | * IP Camera with IP 192.168.1.2 | ||
+ | * Broadcast server with IP 192.168.1.3 | ||
+ | |||
+ | Broadcast server | ||
Let's consider using Rapsberry Pi 3B+ powered Raspbian 10. | Let's consider using Rapsberry Pi 3B+ powered Raspbian 10. | ||
To do this, VLC player is preinstalled with Rapsbian. | 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. | + | If it is not present in the system, you can install it with |
- | Then, copy following link to terminal and test with -vvv argument. | + | <code bash> |
+ | To start with, login to IP-camera and check the settings, if cgi enabled and test access via link using browser. | ||
+ | Alternatively, if you want to test to possibility, | ||
- | In the end, create a .sh script | + | ===Command to output and argument explanations=== |
- | <code bash> | + | Access to IP cameras stream usually can be provided via RTSP or HTTP protocols. |
- | cvlc -vvv -Idummy | + | Put the link in the following example |
+ | |||
+ | |||
+ | <code bash example_stream> | ||
+ | cvlc -vvv http:// | ||
+ | </ | ||
+ | That should look like this: | ||
+ | <code bash test_stream> | ||
+ | cvlc -vvv rtsp:// | ||
</ | </ | ||
- | The output should not have warning | + | If you can see the image, so the IP camera settings done and now you can start configure transcoding. |
- | < | + | |
- | ... | + | |
+ | <code bash example_transcode_stream> | ||
+ | cvlc -vvv -Idummy http:// | ||
</ | </ | ||
- | Command | + | For example let's use login and password with IP camera' |
- | <code bash> | + | <code bash test_transcode_stream> |
+ | cvlc -vvv -Idummy rtsp:// | ||
+ | </code> | ||
- | #full | + | Let's take a closer look at the command. The source stream is: |
- | cvlc -Idummy | + | < |
- | cvlc -Idummy | + | Destination can be also set port only, and the IP will be IP of Raspberry Pi to get access |
+ | < | ||
+ | The output broadcast URL is | ||
+ | < | ||
- | #width crop | + | |
- | cvlc -Idummy rtsp://student:Hikvision@192.168.1.58:554/Streaming/Channels/102 | + | To test if it works, copy following link to terminal and run with '' |
- | cvlc -Idummy http://student:Hikvision@192.168.1.58:80/ | + | The output should not have warning and unresolved errors such as no codecs finded. |
+ | |||
+ | ==== Perfomance optimisation ==== | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | Do not forget to get rid of '' | ||
+ | </ | ||
+ | |||
+ | |||
+ | There are some variants to try to optimize performance | ||
+ | |||
+ | * Decrease IP camera stream resolution | ||
+ | * Lower transcode output resolution | ||
+ | |||
+ | === Lower picture resolution === | ||
+ | <code bash> | ||
+ | #full resolution | ||
+ | cvlc -Idummy http:// | ||
+ | cvlc -Idummy rtsp://http:// | ||
+ | |||
+ | #transcode to lower resolution | ||
+ | cvlc -Idummy http:// | ||
+ | cvlc -Idummy | ||
</ | </ | ||
+ | |||
solutions/video_stream_using_rpi_as_proxy.txt · Last modified: 2022/01/15 01:30 by 127.0.0.1