I'm trying to send my webcam screen by rtsp to other device. (ex: send hololens camera screen to pc program) I checked the vlcMinimalPlayback.cs and modified the script.
streaming http url is ok. I send this media by this script and get it by vlc media player.
Core.Initialize(Application.dataPath);
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
_libVLC = new LibVLC(enableDebugLogs: true);
_libVLC.Log += (s, e) => UnityEngine.Debug.Log(e.FormattedLog); // enable this for logs in the editor
_mediaPlayer = new MediaPlayer(_libVLC);
var mediaOptions = new[]
{
":sout=#rtp{sdp=rtsp://10.177.71.111:554/}",
":sout-keep"
};
string url = "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
url = "rtsp://210.99.70.120:1935/live/cctv002.stream";
_mediaPlayer.Media = new Media(new Uri(url),mediaOptions);
_mediaPlayer.Play();
but when i tried to send my webcam screen, it didn't work
Core.Initialize(Application.dataPath);
Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None);
_libVLC = new LibVLC(enableDebugLogs: true);
_libVLC.Log += (s, e) => UnityEngine.Debug.Log(e.FormattedLog); // enable this for logs in the editor
_mediaPlayer = new MediaPlayer(_libVLC);
string url = "dshow://";
_mediaPlayer.Media = new Media(new Uri(url));
_mediaPlayer.Media.AddOption(":sout=#transcode{vcodec=VP80,vb=2000,acodec=vorb,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{sdp=rtsp://10.177.71.111:8554/mycam} :no-sout-all :sout-keep");
_mediaPlayer.Play();
tons of this error message 'main Warning: resetting master clock: decreasing ts: system: -2839048, stream: -2839048' is keep coming out. and vlc player cannot open the rtsp address.