Stream to Kurento room using ffmpeg

600 views
Skip to first unread message

Maxim Solodovnik

unread,
Oct 28, 2018, 1:37:28 AM10/28/18
to kurento
Hello,

I'm investigating possibility to send audio/video stream to Kurento room using ffmpeg
This is helpful while testing and also allows to connect external video source cam/video file etc.

Kurento supports rtp so I have tried something like this:

ffmpeg -re -i Avengers2.mp4 -f rtp rtp://localhost:8888/5?test=test

doesn't work, rtp can only send 1 stream (audio or video)

This command:
ffmpeg -re -i Avengers2.mp4 -an -f rtp rtp://localhost:8888/5?test=test

produces no errors, ffmpeg streams as expected

Surprisingly my ObjectCreatedListener set up for ApplicationServer get no ObjectCreatedEvent 
(and no log entries in kurento docker instance)

Then I have tried to change protocol:
ffmpeg -re -i Avengers2.mp4 -preset ultrafast -f mpegts udp://localhost:8888/5?test=test

same effect: ffmpeg streaming without errors, but the stream seems to be invisible to Kurento 

Maybe it sort of configuration issue? Or some other listener need to be registered?


Maxim Solodovnik

unread,
Nov 6, 2018, 10:17:18 PM11/6/18
to kurento
Hello,

In my very first post on this forum I have asked regarding "sending external video"
And the answer was: "Yes, it is possible"

Could you share any example how this can be achieved?

Juan Navarro

unread,
Nov 7, 2018, 7:10:15 AM11/7/18
to kurento
Hi,

RTP encoder settings and Payload Type must match those negotiated with the RtpEndpoint via SDP Offer/Answer. You might want to install KMS locally to be able to fine tune the debug log components and levels to get more info from KMS:


The "basertpendpoint" together with higher levels for "rtpendpoint" might show some useful info.

In any case, I wrote multiple RTP sender command-line example programs, but based on the gst-launch tool from GStreamer, instead of FFmpeg:


You can follow some of those commands to build your own RTP sender program; alternatively, you can use any other RTP producer software such as FFmpeg or VLC, but then you need to understand every tiny bit of underlying requirements for RTP (such as, like mentioned, ensuring that the Payload Types match, that the video encoding profile is adequate, that the SDP CNAME description matches, etc.)

Maxim Solodovnik

unread,
Nov 7, 2018, 11:22:23 AM11/7/18
to kurento
Thanks a lot for the links and clarifications
Will try to implement implement streaming and will report back :)
Reply all
Reply to author
Forward
0 new messages