locked
MediaCapture.PrepareLowLagRecordToStorageFileAsync() infinite await

    Question

  • Hi,

    I am trying to create app which should record videos with 1-3s long with small intervals between videos.

    Something like 1s video 1s pause 2s video 1 sec pause (length depends on other events).

    MediaCapture mediaCapture;
    // Initialize
    mediaCapture.StartRecordToStorageFileAsync(mp4profile, file);
    // event duration
    mediaCapture.StopRecordAsync();

    This code is not fast enough.

    Then I tried following:

    // code from MediaCapture sample
    // initialized properties
    m_recordStorageFile;
    MediaEncodingProfile recordProfile = null;
    recordProfile recordProfile;
    m_lowLagRecord = await mediaCaptureMgr.PrepareLowLagRecordToStorageFileAsync(recordProfile, m_recordStorageFile);
    But last method is never finished on my machine.

    Any advice how to solve this?

    Thanks.

    Monday, August 18, 2014 1:03 PM

All replies

  • Hi PVyhlas,

    Per my understanding, you need to initialize recordProfile and m_recordStorageFile objects before call PrepareLowLagRecordToStorageFileAsync method like the code sample. But from your description, there is no initialization. Can you try the approach and let me know the result?

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 19, 2014 7:24 AM
    Moderator
  • Hi,

    I removed initialization code from post above.

    This problem happens when I use unchanged code from provided SDK sample (there is default initialization of profile and storage file), same thing happen when I run SDK sample.

    http://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622

    here is full code

    m_recordStorageFile = await Windows.Storage.KnownFolders.VideosLibrary.CreateFileAsync(VIDEO_FILE_NAME, Windows.Storage.CreationCollisionOption.GenerateUniqueName);
    				ShowStatusMessage("Create record file successful");
    				MediaEncodingProfile recordProfile = null;
    				recordProfile = MediaEncodingProfile.CreateMp4(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);
    				m_lowLagRecord = await m_mediaCaptureMgr.PrepareLowLagRecordToStorageFileAsync(recordProfile, m_recordStorageFile);

    Tuesday, August 19, 2014 6:59 PM