Reputation: 321
I am trying to use ffmpeg and janus-gateway to stream video in the local network. I am piping the h264 video directly in to ffmpeg and from there it gets transferred to janus as an rtp stream. Janus then does the rest.
The problem is, that when I try to open the stream using the streamingtest html page included in janus, I can select the stream, but I never get to see anything. On the console where I started janus, it throws multiple errors starting with: "SDP missing mandatory information"
Apparently the SDP is missing some authorization like this:
a=ice-ufrag:?
a=ice-pwd:?
I guess that it is an issue of the javascript on the demo page.
When I load the page and click the start button, it does everything as it is supposed to and there are no errors yet. It populates the list of available streams with my stream and when using the network analyzer in firefox I can see, that janus is sending the correct SDP to the javascript of the page. That SDP contains the correct info about the stream and also the ice authorization info.
When I then select the stream and click on the start button, the javascript sends a request containing an SDP to janus, but this SDP is completely different from the one received earlier and is indeed missing the ice authorization info. It also has a bunch of completely wrong info in it. For example this SDP is for VP8 video, while my stream and also the correct SDP received earlier are actually H264 video.
Can someone post a easy example for receiving just a single webrtc video stream from janus, please?
I have been searching for an example for a while, but haven't found anything apart from the demo thats not working for me and completely unrelated webrtc videoconference or chatroom examples, that are not of any use for me.
All I am trying to do is getting a signle H264 video stream with as little latency as possible or even zero latency from a raspberry pi to a html webpage locally hosted from the same raspberry pi.
I have tried using hls, but that is just too much latency and someone suggested to use webrtc...
Upvotes: 2
Views: 4178
Reputation: 126
I had a similiar problem
After a "one day fight" - I got it working with reolink webcam on my janus-webrtc installation tvbox-based UserLAnd (https://github.com/virtimus/tinyHomeServer):
in reolink web admin (settings/recording/encode):
janus.plugin.streaming.jcfg:
reolink-rtp: {
type = "rtp"
id = 999
description = "Reolink RTP"
audio = true
audioport = 5051
audiopt = 111
audiortpmap = "opus/48000/2"
video = true
videoport = 5052
videopt = 96
videortpmap = "H264/90000"
videofmtp = "profile-level-id=42e028;packetization-mode=1"
#videofmtp = "profile-level-id=420032;packetization-mode=1"
}
ffmpeg command (dual forward video/audio):
ffmpeg -i 'rtsp://admin:[password]@192.168.2.148:554/h264Preview_01_main' -an -c:v copy -flags global_header -bsf dump_extra -f rtp rtp://localhost:5052 -vn -codec:a libopus -f rtp rtp://localhost:5051
Upvotes: 3
Reputation: 321
Never mind.
I have now switched to using uv4l for both the video stream and hosting the actual webpage that displays the video stream.
This worked pretty much right out of the box and was relatively easy to implement.
Upvotes: 0