I was looking into the MediaCapture
class, however it doesn't seem to expose what I'm looking for. I want the live Stream
from the web cam - not to record it or preview it. I'm working on the Microsoft Cognitive Services Emotion API and I want to follow this example, but instead of getting a local video stream from the file system - I want to get a Stream
from a web cam.
Asked
Active
Viewed 2,607 times
6

David Pine
- 23,787
- 10
- 79
- 107
-
MediaCapture.StartRecordToStreamAsync( MediaEncodingProfile encodingProfile, IRandomAccessStream stream ) ? – pijemcolu Jun 21 '16 at 13:11
-
@pijemcolu, that records the stream but does **not** expose it. I specifically mention that this is *not* going to work for me in my question. – David Pine Jun 21 '16 at 13:20
-
Have a look at this [example](https://msdn.microsoft.com/windows/uwp/audio-video-camera/capture-photos-and-video-with-mediacapture#capture-a-photo). I think this is what you are looking for. Access the memory stream from the camera and capture a frame/photo to send to the Microsoft Cognitive Services Emotion API. – Shivam Jun 21 '16 at 15:12
-
@Shivam, actually what I'm looking for is the video stream. I do not want to take a photo and send that, I want the stream from the web cam. – David Pine Jun 21 '16 at 16:48
-
David, I have the same problem (unable to expose the video stream in a UWP app) - did you solve this problem? – deandob Jan 05 '17 at 23:59
-
Nope... can't figure it out – David Pine Jan 06 '17 at 00:06
1 Answers
-2
The Microsoft Cognitive Services Video APIs, including Emotion, are REST APIs, not streaming APIs, so your scenario is not supported.
What you can do instead is periodically capture a frame and make RESTful calls to one of the image APIs.

cthrash
- 2,938
- 2
- 11
- 10
-
1This answer not only avoids answering the question but it is also completely wrong. The [example](https://github.com/Microsoft/ProjectOxford-ClientSDK/blob/master/Emotion/Windows/Sample-WPF/EmotionDetectionUsingVideoPage.xaml.cs#L68) that I shared has an example of passing a stream into the API. I am already doing the temporary capture and post approach, but wanted to follow their example of the streaming video. Please read up on the MIME type "application/octet-stream". – David Pine Aug 06 '16 at 12:23
-
The fact that something is a REST API doesn't mean you can't pass a stream. As far as I know, there is no distinction like "REST" versus "streaming" API's. This answer is indeed completely wrong, even on the fundamental level. – Zimano Nov 30 '20 at 16:11