I have a local .mp4 file that I would need to stream over WebRTC. For streaming I believe I first need to get .mp4 file into RTP packets from which I know how to transfer them over WebRTC. I'm looking at library LibVLCSharp with which I can send rtp packets directly to an IP but I am unable to get these packages in code from where I could do stuff with them (send them over with WebRTC)?
My code looks like this:
public void StartStreaming(string filePath)
{
var rtsp = new Media(mRecorderNode.VlcLib, filePath, FromType.FromPath);
rtsp.AddOption(":sout=#duplicate" +
"{dst=display{noaudio}," +
"dst=rtp{mux=ts,dst=192.168.128.188,port=8080,sdp=rtsp://192.168.128.188:8080/go.sdp}");
var mediaPlayer = new MediaPlayer(mRecorderNode.VlcLib);
mediaPlayer.Play(rtsp);
var mediaPlayer2 = new MediaPlayer(mRecorderNode.VlcLib);
mediaPlayer2.Mute = true;
var media = new Media(mRecorderNode.VlcLib, "rtsp://192.168.128.188:8080/go.sdp", FromType.FromLocation);
mediaPlayer2.Play(media);
}
The library also plays mp4 files locally which is not needed for my use case. I only need to stream them. How could I get around this issue? Can something like this be achieved with VLC?