UWP get live webcam video stream
Asked Answered
J

1

6

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.

Justificatory answered 21/6, 2016 at 13:3 Comment(6)
MediaCapture.StartRecordToStreamAsync( MediaEncodingProfile encodingProfile, IRandomAccessStream stream ) ?Goneness
@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.Justificatory
Have a look at this example. 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.Kimono
@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.Justificatory
David, I have the same problem (unable to expose the video stream in a UWP app) - did you solve this problem?Goodson
Nope... can't figure it outJustificatory
C
-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.

Cardioid answered 6/8, 2016 at 3:25 Comment(2)
This answer not only avoids answering the question but it is also completely wrong. The example 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".Justificatory
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.Caduceus

© 2022 - 2024 — McMap. All rights reserved.