Hello:
I want to download a video and save to local hard drive file using the library.
I have created one C# console project, and install 2 nuget packages:
PM> Install-Package LibVLCSharp -Version 3.5.1
PM> Install-Package VideoLAN.LibVLC.Windows
The following is my C# code, almost the same as the code sample:
using LibVLCSharp.Shared;
using System;
using System.IO;
using System.Reflection;
static void Main()
{
var currentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var destination = Path.Combine(currentDirectory, "record.ts");
Core.Initialize();
using var libvlc = new LibVLC();
using var mediaPlayer = new MediaPlayer(libvlc);
libvlc.Log += (sender, e) => Console.WriteLine($"[{e.Level}] {e.Module}:{e.Message}");
using (var media = new Media(libvlc, new Uri(Video1_URL),
":sout=#file{dst=" + destination + "}",
":sout-keep"))
{
mediaPlayer.Play(media);
}
Console.WriteLine($"Recording in {destination}");
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
}
I can compile my program, but when I run it, but after more than 30 minutes, the program has NOT finished, and the size of destination file is 0, until I stop debugging, I can see the size of destination file is about 172MB.
I think there may be some bug in the library, please investigate.
My OS: Windows 10 (Version 21H1), my IDE: Visual Studio 2019 (Version 16.10.4), C# console project target .NET 5.0.
Thanks,
Hello: I want to download a video and save to local hard drive file using the library. I have created one C# console project, and install 2 nuget packages: PM> Install-Package LibVLCSharp -Version 3.5.1 PM> Install-Package VideoLAN.LibVLC.Windows The following is my C# code, almost the same as the code sample: using LibVLCSharp.Shared; using System; using System.IO; using System.Reflection;
namespace LibVLCSharpRecordHLS { class Program { public const string Video1_URL = @"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4";
}
I can compile my program, but when I run it, but after more than 30 minutes, the program has NOT finished, and the size of destination file is 0, until I stop debugging, I can see the size of destination file is about 172MB. I think there may be some bug in the library, please investigate. My OS: Windows 10 (Version 21H1), my IDE: Visual Studio 2019 (Version 16.10.4), C# console project target .NET 5.0. Thanks,