Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

how to stream video from vlc in c#

 class Program
{
    static void Main(string[] args)
    {
        FileInfo file = new FileInfo(@"C:UsersJmanVideoMaker.avi");

        var currentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
        // Default installation path of VideoLAN.LibVLC.Windows
        var libDirectory =
            new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));

        using (var mediaPlayer = new Vlc.DotNet.Core.VlcMediaPlayer(libDirectory))
        {

            var mediaOptions = new[]
            {
                ":sout=#rtp{sdp=rtsp://192.168.1.162:8008/test}",
                ":sout-keep"
            };

            //mediaPlayer.SetMedia(new Uri("http://hls1.addictradio.net/addictrock_aac_hls/playlist.m3u8"),
            //    mediaOptions);

            mediaPlayer.SetMedia(file, mediaOptions);

            mediaPlayer.Play();

            Console.WriteLine("Streaming on rtsp://192.168.1.162:8008/test");
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: unity for loop array 
Csharp :: c# builder pattern fluent example 
Csharp :: c# guid from string 
Csharp :: unity vector3 initialization 
Csharp :: 405 - HTTP verb used to access this page is not allowed 
Csharp :: how to make rabbitmq start and stop base on c# services 
Csharp :: Get a list of distinct values in List 
Csharp :: c# file to byte array 
Csharp :: factorial of number 
Csharp :: c# timer single tick 
Csharp :: display none asp.net 
Csharp :: unity3d gameobject follow path 
Csharp :: C# Async Function simple 
Csharp :: unity normalize 
Csharp :: c# faker 
Csharp :: c# mysql select into datatable 
Csharp :: list to ilist c# 
Csharp :: c# console.writeline 
Csharp :: how to add arrays in c# 
Csharp :: c# reflection create generic type 
Csharp :: create a file in the directory of the exe and write to it c# 
Csharp :: c# convert datetime to timespan 
Csharp :: logical operators in c# 
Csharp :: what does focusbale do in listview WPF 
Csharp :: c#, get a embedded resx file 
Csharp :: c# different getter setter types 
Csharp :: unity transparent sprite 
Csharp :: actual vector3 object unity 
Csharp :: sortdescriptions wpf 
Csharp :: add RowDefinition from cs xamarin 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =