M
M
Magi2020-03-26 09:35:37
fmpeg
Magi, 2020-03-26 09:35:37

How to set up relaying of rtsp video stream from the camera from the internal network to the Internet?

Hello!

Tell me how to correctly compose a command for relaying a video stream to rtsp from an ip-camera from the internal network through a server with vlc.

Camera -> ubuntu server -> client with vlc

Url of video stream from camera rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif

Ubuntu server with external ip xxx. xxx.xxx.xxx The command that I run on the server.

cvlc -d rtsp://admin:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif --loop --repeat --sout-keep "#rtp{sdp=rtsp:/ /xxx.xxx.xxx.xxx:8080/test.sdp}";

On the vlc client I enter rtsp://xxx.xxx.xxx.xxx:8080/test.sdp - there is no broadcast. There are no errors, the log is empty. Tried ffmpeg:

ffmpeg -i 'rtsp://onvif:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif' -f rtsp -rtsp_transport tcp rtsp://xxx.xxx.xxx.xxx;
Input #0, rtsp, from 'rtsp://onvif:[email protected]:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif':
Metadata:
title : Media Server
Duration: N/A, start : 0.320000, bitrate: N/A
Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1280x720, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1: Data : none
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[swscaler @ 0x55ae26500a80] deprecated pixel format used, make sure you did set range correctly
[tcp @ 0x55ae26aa3ec0] Connection to tcp://xxx.xxx.xxx.xxx:554?timeout=0 failed: Connection refused
Could not write header for output file #0 (incorrect codec parameters ?): Connection refused
Error initializing output stream 0:0 --
Conversion failed!

In /etc/ffserver.conf ACL allow localhost xxx.xxx.xxx.xxx

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question