Publish RTSP Stream to VideoRoom Problem.

556 views
Skip to first unread message

He Allen

unread,
Jun 30, 2021, 5:30:38 AM6/30/21
to meetecho-janus
Hi, everyone!
I am trying to publish my local IP camera to JanusVideoRoom, but I can't get it work.
I am using this Python script(Thanks to the great JanusCon2019) to interact my RTSP stream with WebRTC and publish it to VideoRoom.

Here are the steps I am doing:
1. Configure JanusVideoRoom VideoCodec to h264, leave the profile-level-id to default;
2. Run the Python script: `python3 janusvideoroom.py --server ws://127.0.0.1:8188 LocalCamera201`;
3. Using my phone(or browser both tried Chrome & Safari) to join the room `1234`;
4. RTSP stream content never appears in the VideoRoom and no RTP package received at my Phone side.


I think the negotiation was good and so did the ICE exchange, 
any advice would be appreciated, thanks.

Alessandro Toppi

unread,
Jun 30, 2021, 6:08:53 AM6/30/21
to meetecho-janus
Are you successfully subscribing to the publisher's feed once joined the room?

Start by checking the publisher's connection:
- Inspect Admin API and look for statistics about incoming RTP packets and loss/jitter feedbacks
- if you are unsure about the incoming RTP, record the packets through the videoroom recording API, then post-process the mjr file with janus-pp-rec and inspect the generated mp4

Alessandro Toppi

unread,
Jun 30, 2021, 7:04:33 AM6/30/21
to meetecho-janus
Also I noticed that you are adding the wrong mid (0 in place of video0) to the candidates sent by gst, with the result that janus is ignoring all of them.
The connection still succeeds though, thanks to prflx candidates, so this is not the reason of your issue.

He Allen

unread,
Jun 30, 2021, 12:29:14 PM6/30/21
to meetecho-janus
Yes, I am. 
here is log from my phone.

Thanks for these great advice, I did the "record one", 
After I generated the recorded file to mp4, I can see the mp4 content is the same as the RTSP stream content.
So this could be the codec issue of the broswer?

When I tried to use the Safari(14.1.1) test VideoRoom it pop out:
"WebRTC error... Failed to set local answer sdp: Failed to set local video description recv parameters for m-section with mid='video'."
but no error at all when I use Chrome(91.0.4472.114).

Again, thanks for your helpful advice!

BTW, I am using these RTSP stream examples to test:


sergey radionov

unread,
Jun 30, 2021, 10:14:07 PM6/30/21
to meetecho-janus
Some time ago I've did the same task with C++. Maybe it could be helpful for you:
Sources: https://github.com/RSATom/JanusVideoroomStreamer
Binaries: https://snapcraft.io/janus-videoroom-streamer
Message has been deleted

He Allen

unread,
Jun 30, 2021, 10:53:39 PM6/30/21
to meetecho-janus
Excellent! 

Alessandro Toppi

unread,
Jul 1, 2021, 5:05:25 AM7/1/21
to meetecho-janus
That RTSP source is offering a 4.1 main profile h264, afaik that is not supported by the webrtc stack of common browsers.

Lorenzo Miniero

unread,
Jul 1, 2021, 6:05:43 AM7/1/21
to meetecho-janus
Advertising baseline in the SDP might fix it though, if that's the cause.

L.

He Allen

unread,
Jul 2, 2021, 6:54:20 AM7/2/21
to meetecho-janus
Hi, Alessandro, Lorenzo:
Thanks for your patience!

I changed my RTSP stream back to my local IP Camera, use the script(described in 1#) publish to VideoRoom,
---- no video show in the VideoRoom(Chrome).

But when I add the RTSP stream address to Streaming plugin,
---- the video is playing(Chrome).
I found the profile-level-id:
"64002A" --- Chrome offerd, "640015" --- Streaming answered.

please see the log file.

------------

I think the broswer did the same subscribe action in VideoRoom & Streaming,
but I don't understand the difference between the VideoRoom Plugin & Streaming Plugin behaviors.

Alessandro Toppi

unread,
Jul 2, 2021, 10:45:17 AM7/2/21
to meetecho-janus
compare the SDP offers
Reply all
Reply to author
Forward
0 new messages