vlc.dotnet保存流

发布于 2025-02-04 17:33:58 字数 1138 浏览 2 评论 0 原文

亲爱的, 我正在检查vlc.dotnet lib(我是音频/视频流的新手),

static void Main(string[] args)
    {
        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"));

        var destination = Path.Combine(currentDirectory, "record.ts");

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

            var mediaOptions = new[]
            {
                ":sout=#file{dst=" + destination + "}",
                ":sout-keep"
            };

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

            mediaPlayer.Play();

            Console.WriteLine($"Recording in {destination}");
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }

我找不到有关可能的介质值的文档。我想了解是否可以在下载时更改采样率,甚至可以更改文件格式(可能是PCM)。 有可以提供帮助的链接吗? 谢谢

Dears,
I was checking VLC.Dotnet lib (I am new to audio/video streaming)

static void Main(string[] args)
    {
        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"));

        var destination = Path.Combine(currentDirectory, "record.ts");

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

            var mediaOptions = new[]
            {
                ":sout=#file{dst=" + destination + "}",
                ":sout-keep"
            };

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

            mediaPlayer.Play();

            Console.WriteLine(
quot;Recording in {destination}");
            Console.WriteLine("Press any key to exit");
            Console.ReadKey();
        }
    }

I cannot find documentation on the possible mediaOption values. I want to understand if it is possible to change sampling rate while downloading or even the file format (PCM possibly).
Any link that can help?
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

開玄 2025-02-11 17:33:58

vlc.dotnet已死,使用 libvlcsharp 而不是。

至于选项文档,请在此处找到该文档:

Vlc.DotNet is dead, use LibVLCSharp instead.

As for the options documentation, please find the documentation here : https://docs.videolan.me/vlc-user/3.0/en/advanced/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文