Convert to rtmp or hls

Skip to first unread message

yarek chmielewski

May 15, 2019, 11:53:53 AM5/15/19
to mediasoup
Any tricks or tips to transcode streams into hls or rtmp formats ?
This would be useful for old browsers or old os.

Ethan D

May 15, 2019, 10:07:13 PM5/15/19
to mediasoup
You could use GStreamer/FFmpeg to convert into HLS/RTMP.

1. Have Mediasoup forward the RTP stream to the GStreamer/FFmpeg endpoint.
2. Encode the stream for HLS/RTMP

You may need to encode the audio if you are using opus, if you're using H264 for video you should be able to get away without encoding..
Also with HLS you will need to consider fragments/playlist length etc.

May 16, 2019, 6:08:37 AM5/16/19
to mediasoup
use libmediasoupclient, add sink to mediatrack, then got the audio or video raw frame, encode them and muxed to hls or rtmp.  you can see the peerconnection example of webrtc native code about how to got video raw frame.
ffmpeg seems not process rtcp packets, so i think the stream quality was bad than that using webrtc native code.  gstreamer maybe ok.

May 16, 2019, 6:57:03 AM5/16/19
to mediasoup
sorry, i just see ffmpeg source code, it has logic sending pli or nack in rtpdec.c, so ffmpeg maybe ok with decoding or remux rtp stream.
Reply all
Reply to author
0 new messages