LibVLCSharp on-demand

This forum is about all development around libVLC.
dansted
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2019 12:12

LibVLCSharp on-demand

Postby dansted » 27 Nov 2019 17:23

I would like to be able to stream media on-demand with the LibVLCSharp library for c#.

I've created a server and client application which are able to stream and receive media, but I can't figure out how to stream as on-demand.

Server:
Core.Initialize();
LibVLC vlc = new LibVLC();
MediaPlayer mediaPlayer = new MediaPlayer(vlc);
Media media = new Media(vlc, @"pathToMyFile", FromType.FromPath);
media.AddOption(":sout=#rtp{sdp=rtsp://:555/test}");
mediaPlayer.Play(media);


Client:
Core.Initialize();
LibVLC vlc = new LibVLC();
Media media = new Media(vlc, "rtsp://localhost:555/test", FromType.FromLocation);
MediaPlayer mediaPlayer = new MediaPlayer(vlc);
mediaPlayer.Play(media);

Do any of you have a small c# example for streaming on-damand ?

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: LibVLCSharp on-demand

Postby mfkl » 28 Nov 2019 03:45

No C# sample about this, but those links may help

https://wiki.videolan.org/Documentation:Streaming_HowTo/VLM/

http://blog.julien.org/2008/12/howto-setting-up-vod-server-with-vlc.html
https://mfkl.github.io

dansted
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2019 12:12

Re: LibVLCSharp on-demand

Postby dansted » 31 Dec 2019 14:46

I found a solution but it's not written in c#.
I've created a vlm config file and run some cmd commands:

# VLC config file (placed inside C:\Program Files (x86)\VideoLAN\VLC)
new test vod enabled
setup test input "C:\Test\test.mp4"

# CMD commands
cd "C:\Program Files (x86)\VideoLAN\VLC"
vlc -I telnet --telnet-password psw --vlm-conf playlist.vlm --rtsp-port 555



You can append "--sout-rtsp-user user1 --sout-rtsp-pwd user1psw" to the cmd command to password protect all the VOD streams.
But how do I create multiple user passwords ???

Is it possible to write the cmd command with the LibVLCSharp library?
I've tried this, but it doesn't work -> LibVLC VLC = new LibVLC(":I telnet --telnet-password psw --vlm-conf playlist.vlm --rtsp-port 555");

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: LibVLCSharp on-demand

Postby mfkl » 02 Jan 2020 03:20

Not sure that will work, but for libvlc options syntax info, see https://code.videolan.org/videolan/LibVLCSharp/blob/3.x/docs/libvlc_documentation.md#libvlc-options
https://mfkl.github.io

dansted
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2019 12:12

Re: LibVLCSharp on-demand

Postby dansted » 02 Jan 2020 15:22

I Will try and look into that. Do you have any idea about multiple user passwords?


Return to “Development around libVLC”

Who is online

Users browsing this forum: Google [Bot] and 12 guests