【问题标题】:Windows IOT Broadcast WebcamWindows IOT 广播网络摄像头
【发布时间】:2016-02-15 07:54:16
【问题描述】:

我想在运行 Windows IOT 的 Raspberry pi 2 上制作一个网络摄像头广播应用程序。

正如我们在 Windows IOT samples 中看到的,您可以录制视频,但不能

在网络上播放视频(作为 wifi)。 在这段代码中,我使用 MediaCapture 类来获取视频流。

            // this._mediaCapture is a MediaCapture variable, initialized
        // there is a MediaElement item to see the video
        InMemoryRandomAccessStream stream = new InMemoryRandomAccessStream();
        MediaEncodingProfile profile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Auto);

        // starting recording to stream
        await this._mediaCapture.StartRecordToStreamAsync(profile,stream);
        // stopping recording to access the stream
        await this._mediaCapture.StopRecordAsync();
        //linking the stream to a MediaElement item to see the video
        await stream.FlushAsync();
        MediaElement.SetSource(stream, "video / mp4");
        MediaElement.Play();
        return stream;

问题是我们必须调用 StopRecordAsync 方法来访问流。 使用计时器,我们可以录制 5 秒(例如)视频,调用 StopRecordAsync 方法,刷新流并循环执行。

【问题讨论】:

  • 我只是想知道,除了微软推荐的那些之外,你还能使用其他 USB UVC 相机吗?

标签: c# .net windows uwp iot


【解决方案1】:

我没有详细的解决方案,但有一个提示。我认为录音不是你想要的。您只想从 veiwfinder 抓取并上传预览流。为此,您需要将预览流发送到自定义接收器。在您的情况下,这将是一个从媒体捕获接收并将它们发送到服务器的循环缓冲区。

你应该检查方法:

MediaCapture.StartPreviewToCustomSinkAsync()

【讨论】:

    猜你喜欢
    • 2014-08-17
    • 2014-11-24
    • 1970-01-01
    • 2014-08-23
    • 1970-01-01
    • 2020-09-16
    • 2020-01-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多