locked
Mobile Video recording App compression of Video

    Question

  • Hello

    I am looking for the option of compressing the video, recorded from front camera. I am using Windows 8 and VS 2013 for the creating the App..

    Can anyone suggest how to compress the file(I dont want to zip the file, only reduce the file size)

    Regards

    Yashaswi P.K

    Friday, August 8, 2014 9:00 AM

Answers

  • Hello

    I was able to reduce the quality and capture the video using the "AudioVideoCaptureDevice" class

    Below is the code

     Windows.Foundation.Size initResolutionsize;
                initResolutionsize.Height =  240;
                initResolutionsize.Width =  320;

    _avCaptureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back, initResolutionsize);
                _avCaptureDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264;
                _avCaptureDevice.AudioEncodingFormat = CameraCaptureAudioFormat.Aac;
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingProfile, H264EncoderProfile.Main);
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingLevel, H264EncoderLevel.Level3);

                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.VideoFrameRate, 15);
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.UnmuteAudioWhileRecording, true);
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EnableKeyframes, 1);

    • Marked as answer by yashaswi_coorg Wednesday, September 3, 2014 11:37 AM
    Wednesday, September 3, 2014 11:36 AM

All replies

  • Hi Yashaswi,

    Any reason you don't want zip the file? the algorithm helps you compress the file without lost any information of the video. If you need less file size, you can consider reduce the video quality.  

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 11, 2014 6:49 AM
    Moderator
  • Hi

    We are trying to create a App in windows & Android, where we are record the video and upload the recorded video file to the server. This is were we want to reduce the video size, so that we can easily upload videos(small like, say a 1 min video of 10KB). Since we are uploading from different version of OS(Windows/ Android) we do not want to work on zipping/ unzipping.

    Can anyone suggest any Codec/ API for the video compression in Mobile.

    Regards
    Yashaswi P.K

    Monday, August 11, 2014 1:06 PM
  • Hi Yashaswi,

    Sorry I don't think we have existing API for you to reduce the video quality. You may need Media Foundation to separate the video into frames reduce the frame image quality and then combine them. And I'm so sorry i'm not familiar with that area.

    You may need to search online with keywords for instance: reduce video quality window store app. I believe you can get more suggestions. I do find something for WP, but I cannot find a Windows Store App one, maybe you would like to ask code owner if they have the Windows Store App version.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 18, 2014 1:58 AM
    Moderator
  • Hello

    Can anyone suggest any way to zip the video file in Win Phone App. I tried installing DotNetZip Library (https://dotnetzip.codeplex.com/) using NuGet but it is not compatible with 4.5 verion of Dot Net Framework. Can anyone suggest how to Zip the file in Mobile App.

    Regards
    Yashaswi P.K

    Monday, August 18, 2014 8:47 AM
  • Hello

    I was able to reduce the quality and capture the video using the "AudioVideoCaptureDevice" class

    Below is the code

     Windows.Foundation.Size initResolutionsize;
                initResolutionsize.Height =  240;
                initResolutionsize.Width =  320;

    _avCaptureDevice = await AudioVideoCaptureDevice.OpenAsync(CameraSensorLocation.Back, initResolutionsize);
                _avCaptureDevice.VideoEncodingFormat = CameraCaptureVideoFormat.H264;
                _avCaptureDevice.AudioEncodingFormat = CameraCaptureAudioFormat.Aac;
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingProfile, H264EncoderProfile.Main);
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EncodingLevel, H264EncoderLevel.Level3);

                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.VideoFrameRate, 15);
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.UnmuteAudioWhileRecording, true);
                _avCaptureDevice.SetProperty(KnownCameraAudioVideoProperties.H264EnableKeyframes, 1);

    • Marked as answer by yashaswi_coorg Wednesday, September 3, 2014 11:37 AM
    Wednesday, September 3, 2014 11:36 AM