c# - Record on windows IOT from webcam in 1080p -


following this example note resolution of video 640*480. code works perfect. webcam 1080p model. how raspberry pi save video @ 1080p?

here camera initialization code directly sample,aswell code record video. cannot find location resolution set.

 private async void initvideo_click(object sender, routedeventargs e)     {         // disable buttons until initialization completes          setinitbuttonvisibility(action.disable);         setvideobuttonvisibility(action.disable);         setaudiobuttonvisibility(action.disable);          try         {             if (mediacapture != null)             {                 // cleanup mediacapture object                 if (ispreviewing)                 {                     await mediacapture.stoppreviewasync();                     captureimage.source = null;                     playbackelement.source = null;                     ispreviewing = false;                 }                 if (isrecording)                 {                     await mediacapture.stoprecordasync();                     isrecording = false;                     recordvideo.content = "start video record";                     recordaudio.content = "start audio record";                 }                 mediacapture.dispose();                 mediacapture = null;             }              status.text = "initializing camera capture audio , video...";             // use default initialization             mediacapture = new mediacapture();             await mediacapture.initializeasync();                              // set callbacks failure , recording limit exceeded             status.text = "device initialized video recording!";             mediacapture.failed += new mediacapturefailedeventhandler(mediacapture_failed);             mediacapture.recordlimitationexceeded += new windows.media.capture.recordlimitationexceededeventhandler(mediacapture_recordlimitexceeded);              // start preview                             previewelement.source = mediacapture;             await mediacapture.startpreviewasync();             ispreviewing = true;             status.text = "camera preview succeeded";              // enable buttons video , photo capture             setvideobuttonvisibility(action.enable);              // enable audio init button, leave video init button disabled             audio_init.isenabled = true;         }         catch (exception ex)         {             status.text = "unable initialize camera audio/video mode: " + ex.message;                      }     }        private async void recordvideo_click(object sender, routedeventargs e)     {         try         {             takephoto.isenabled = false;             recordvideo.isenabled = false;             playbackelement.source = null;              if (recordvideo.content.tostring() == "start video record")             {                 takephoto.isenabled = false;                 status.text = "initialize video recording";                 string filename;                 filename = video_file_name;                  recordstoragefile = await windows.storage.knownfolders.videoslibrary.createfileasync(filename, windows.storage.creationcollisionoption.generateuniquename);                  status.text = "video storage file preparation successful";                  mediaencodingprofile recordprofile = null;                 recordprofile = mediaencodingprofile.createmp4(windows.media.mediaproperties.videoencodingquality.auto);                  await mediacapture.startrecordtostoragefileasync(recordprofile, recordstoragefile);                 recordvideo.isenabled = true;                 recordvideo.content = "stop video record";                 isrecording = true;                 status.text = "video recording in progress... press \'stop video record\' stop";             }             else             {                 takephoto.isenabled = true;                 status.text = "stopping video recording...";                 await mediacapture.stoprecordasync();                 isrecording = false;                  var stream = await recordstoragefile.openreadasync();                 playbackelement.autoplay = true;                 playbackelement.setsource(stream, recordstoragefile.filetype);                 playbackelement.play();                 status.text = "playing recorded video" + recordstoragefile.path;                 recordvideo.content = "start video record";             }         }         catch (exception ex)         {             if (ex system.unauthorizedaccessexception)             {                 status.text = "unable play recorded video; video recorded to: " + recordstoragefile.path;                 recordvideo.content = "start video record";             }             else             {                 status.text = ex.message;                 cleanup();             }                         }                 {                             recordvideo.isenabled = true;                         }     } 

take @ "videodevicecontroller.getavailablemediastreamproperties" , "videodevicecontroller.setmediastreampropertiesasync" toget available resolutions , set resolution of video capture device.

http://msdn.microsoft.com/en-us/library/windows/apps/windows.media.devices.videodevicecontroller.getavailablemediastreamproperties.aspx http://msdn.microsoft.com/en-us/library/windows/apps/windows.media.devices.videodevicecontroller.setmediastreampropertiesasync.aspx


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -