我正在尝试找出 vlcsharp 的正确 addoption 以使用 addoptionon 向 avalonia 控件添加徽标

发布于 2025-01-12 11:40:01 字数 888 浏览 4 评论 0原文

我正在为 Avalonia 构建一个应用程序,它可以在树莓派上播放视频并显示图像。我可以在图像底部显示日期/时间等文本,但不能在 libvlc 控件上显示(目前)。我看到了这方面的悬而未决的问题,所以想出了一个如果我可以在底部添加一个“徽标”可能会起作用的黑客。我的想法是编写一个图像,然后使用“添加选项”将该图像作为徽标加载。
Libvlc 允许使用 addoption 添加“命令行选项”。它不受支持,但这是我尝试的唯一选择。我可以在命令行上看到我想做的事情是有效的。当我尝试时,我的代码看起来像:

public void PlayVideo(string path)
    {
        if (view.MediaPlayer != null)
        {
            
            using var media = new Media(libVLC, new System.Uri(path));
            view.IsVisible = true;
            view.MediaPlayer.SetAudioOutput("Built-in Audio Digital Stereo");
            mediaPlayer.Fullscreen = true;
            mediaPlayer.EnableHardwareDecoding = true;                
            media.AddOption("--logo-file=c:\\testfooter.png");
            view.MediaPlayer.Play(media);

        }
    }

这似乎不起作用。我看到一些语法用“:”而不是“--”,但我不清楚为什么。有人知道我的 addoption 语法是否正确,或者目前正在这样做吗?

I'm building an app for Avalonia which plays videos and shows images on a raspberry pi. I'm able to show text such as the date/time on the bottom of an image, but not on a libvlc control (for now). I see open issues on that, so came up with a hack that might work if I can add a 'logo' to the bottom. My idea is I'd write an image, then load that image in as a logo using 'add option'.
Libvlc allows addoption to be used to add 'command line options'. It's not supported but is my only option to try. I can see that on the command line what I want to do works. When I try it my code looks like:

public void PlayVideo(string path)
    {
        if (view.MediaPlayer != null)
        {
            
            using var media = new Media(libVLC, new System.Uri(path));
            view.IsVisible = true;
            view.MediaPlayer.SetAudioOutput("Built-in Audio Digital Stereo");
            mediaPlayer.Fullscreen = true;
            mediaPlayer.EnableHardwareDecoding = true;                
            media.AddOption("--logo-file=c:\\testfooter.png");
            view.MediaPlayer.Play(media);

        }
    }

that doesn't seem to work. I see some syntax with ":" instead of "--" but I'm not clear on why. Anyone know if my syntax for addoption is right, or are currently doing this?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文