2
我想在運行Windows IOT的Raspberry pi 2上製作網絡攝像頭廣播應用程序。Windows物聯網廣播網絡攝像頭
正如我們在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方法,刷新流並在循環中執行,但是。
我只是想知道,你能使用比那些由微軟receommended以外的任何其他USB UVC攝像頭? – Arash