I am trying to start a capture of the webcam, transcode it and output it to RTSP
but I cannot view the stream when I view: rtsp://127.0.0.1:53211
I get a log in my VLC player saying:
Your input can't be opened:
VLC is unable to open the MRL 'rtsp://127.0.0.1:53211'. Check the log for Your input can't be opened:
VLC is unable to open the MRL 'rtsp://127.0.0.1:53211'. Check the log for details.
I don't see any logs in C# side and I see my webcam lights up so I assume it's accessing the webcam.
using System;
using LibVLCSharp.Shared;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Core.Initialize();
using var libVlc = new LibVLC();
using var mediaPlayer = new MediaPlayer(libVlc);
mediaPlayer.EndReached += (_, x) =>
{
Environment.Exit(1);
};
var media = new Media(libVlc, "v4l2:///dev/video0", FromType.FromLocation);
media.AddOption(":v4l2-standard=ALL :live-caching=300");
media.AddOption(":chroma=mp2v --v4l2-width 1280 --v4l2-height 720");
media.AddOption(":sout=#transcode{vcodec=mp2v,acodec=mpga,fps=30}:rtp{mux=ts,sdp=rtsp://:53211}");
media.AddOption(":sout-keep");
mediaPlayer.Play(media);
Console.ReadKey();
}
}
}