C# VLC可以读取内存流吗

C# VLC可以读取内存流吗,c#,asp.net-core,vlc,rtmp,libvlcsharp,C#,Asp.net Core,Vlc,Rtmp,Libvlcsharp,我想创建一个音频流服务器并动态更改播放列表。我解决这个问题的想法是使用libvlcsharp,将一个memorystream作为媒体放入mediaplayer,然后从libvlcsharp流到我的nginx RTMP服务器 以下是我的memorystream的代码: new Thread(delegate (object o) { var response = WebRequest.Create("http://listen.technobase

我想创建一个音频流服务器并动态更改播放列表。我解决这个问题的想法是使用libvlcsharp,将一个memorystream作为媒体放入mediaplayer,然后从libvlcsharp流到我的nginx RTMP服务器

以下是我的memorystream的代码:

new Thread(delegate (object o)
        {
            var response = WebRequest.Create("http://listen.technobase.fm/tunein-aacplus-pls").GetResponse();
            using (var stream = response.GetResponseStream())
            {
                byte[] buffer = new byte[65536];
                int read;
                while((read = stream.Read(buffer,0,buffer.Length)) > 0)
                {
                    var pos = ms.Position;
                    ms.Position = ms.Length;
                    ms.Write(buffer, 0, read);
                    ms.Position = pos;
                }
            }
        }).Start();
但是libvlcsharp中的媒体项不接受memorystream作为输入。这就是我所尝试的:

var media = new Media(_libVLC, ms);
_mp.Play(media);
将memorystream放入VLC是可行的还是有另一种可能来解决此问题?

问题已解决

media = new Media(_libVLC, new StreamMediaInput(ms));