Page 1 of 1

Add marquee to RTSP stream

Posted: 16 Dec 2021 18:11
by Klamay
Hi experts!

I'm using libVlcSharp to stream video in RTSP mode.
I'm trying to add a marquee on-the-fly, but I fail.

What I'm doing is something like this:

Code: Select all

Core.Initialize(); var vlc = new LibVLC (); var mediaPlayer = new LibVLCSharp.Shared.MediaPlayer(vlc); Media media = new Media(vlc, @"test.mov"); media.AddOption(":sub-source=marq{marquee=TEST,position=5,color=0xFFFF00,size=50}"); media.AddOption(":sout=#rtp{sdp=rtsp://127.0.0.1:555/test.sdp}"); mediaPlayer.Play(media);

Video is correctly streamed, but the marquee is not shown.

I also tried this way:

Code: Select all

mediaPlayer.SetMarqueeInt(VideoMarqueeOption.Enable, 1); //enable marquee option mediaPlayer.SetMarqueeInt(VideoMarqueeOption.Size, 50); //set the font size mediaPlayer.SetMarqueeInt(VideoMarqueeOption.Position, 5); //set the position of text mediaPlayer.SetMarqueeInt(VideoMarqueeOption.X, 10); // margin X mediaPlayer.SetMarqueeInt(VideoMarqueeOption.Y, 10); // margin Y mediaPlayer.SetMarqueeInt(VideoMarqueeOption.Color, 16711680); // Color mediaPlayer.SetMarqueeInt(VideoMarqueeOption.Opacity, 250); // Opacity mediaPlayer.SetMarqueeString(VideoMarqueeOption.Text, "TEST"); //text mediaPlayer.Play(media);
Nope. The video is there but without marquee.

Does anyone know how to make it work?

Thanks! :wink:

Re: Add marquee to RTSP stream

Posted: 16 Dec 2021 20:50
by InTheWings
If you don't transcode, that's just useless options for display

Re: Add marquee to RTSP stream

Posted: 17 Dec 2021 17:39
by Klamay
Thanks for pointing out that I need to transcode.

So, I try to add the marquee on the client side, where I already transcode the stream.
So something like:

Code: Select all

Core.Initialize(); var vlc = new LibVLC (); var mediaPlayer = new LibVLCSharp.Shared.MediaPlayer(vlc); var media = new Media(_libVLC, @"rtsp://127.0.0.1:555/test.sdp", FromType.FromLocation, ":sout=#transcode{vcodec=h264,vb=6000,acodec=mp4a,aenc=fdkaac,ab=128}:file{dst=test.mp4"}", ":sout-keep"); media.AddOption(":sub-source=marq{marquee=TEST,position=5,color=0xFFFF00,size=50}"); mediaPlayer.Play(media);
Still, I get the transcoded file but I don't see any marquee :/

Any idea?

Thanks!