Can't capture video using MediaCapture, but the CameraCaptureUI can capture video
-
Thursday, February 23, 2012 12:19 PM
1. I try to use MediaCapture to capture with a Logitech C920 HD Pro Webcam but failed.
2. The code I use can work with an older Logitech Webcam.
3. I find I can use CameraCaptureUI to capture video with the new Logitech C920 HD Pro Webcam.
Here is my code:
Initialize:
var captureInitSettings = new Windows.Media.Capture.MediaCaptureInitializationSettings();
captureInitSettings.audioDeviceId = "";
captureInitSettings.videoDeviceId = "";
captureInitSettings.streamingCaptureMode = Windows.Media.Capture.StreamingCaptureMode.audioAndVideo;
captureInitSettings.photoCaptureSource = Windows.Media.Capture.PhotoCaptureSource.videoPreview;
mediaCaptureMgr = new Windows.Media.Capture.MediaCapture();
mediaCaptureMgr.initializeAsync(captureInitSettings);Start to capture:
encodingProfile = Windows.Media.MediaProperties.MediaEncodingProfile.createWmv(Windows.Media.MediaProperties.VideoEncodingQuality.hd720p);
proxyFolder.createFileAsync(videoFileName, Windows.Storage.CreationCollisionOption.generateUniqueName).then(
function (newFile) {
videoStorage = newFile;
mediaCaptureMgr.startRecordToStorageFileAsync(encodingProfile, videoStorage).then(function (result) {
startTimer();
});
});When calling mediaCaptureMgr.startRecordToStorageFileAsync, it enters the fail callback function, the error is Unknown Runtime error.
Does anybody know how CameraCaptureUI work? Or is there anything wrong with my code?
- Edited by yiling.yin Thursday, February 23, 2012 12:20 PM
- Edited by Jeff SandersMicrosoft Employee, Moderator Thursday, February 23, 2012 9:32 PM NDA violation only the publically available build is disucssed here
All Replies
-
Thursday, February 23, 2012 8:51 PMModerator
Did you try this sample:
http://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622
Jeff Sanders (MSFT)
- Proposed As Answer by Jeff SandersMicrosoft Employee, Moderator Thursday, February 23, 2012 8:51 PM
-
Friday, February 24, 2012 6:31 AM
The Meida Capture sample can't capture also.
But the CameraCaptureUI sample can capture video.
-
Friday, February 24, 2012 1:43 PMModerator
That is very strange. Let me see if I can find some more information about how the Capture UI works and get back to you. You said that it seems to be specific to this camera correct?
-Jeff
Jeff Sanders (MSFT)
-
Monday, February 27, 2012 12:56 PMModeratorYou said that it seems to be specific to this camera correct?
Jeff Sanders (MSFT)
-
Wednesday, March 07, 2012 11:29 AM
Hi all,
I got the same problem. My camera is Logitech QuickCam Chat.
The CameraCaptureUI sample works, but the Media Capture sample failed.
Is there any update? Thanks!
Chik
-
Friday, March 09, 2012 12:50 PMModerator
Hi Chik,
Is it possible for you to test with another camera and see if the problem only happens with this camera?
-Jeff
Jeff Sanders (MSFT)
-
Friday, April 13, 2012 12:26 AMModerator
Hey all,
Please check to see if you are using the Microsoft in-box driver or the custom driver that shipped from the OEM. I have this same problem with an older MS camera. Switching to the Microsoft UVC driver should fix the problem. If you try this and are still having problems please let us know.
-James
Windows Media SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/
- Proposed As Answer by James Dailey - MSFTMicrosoft Employee, Moderator Friday, April 13, 2012 12:26 AM


