Rotate Captured Video in Windows Store App

Before reading this article, please go through the following articles:

  1. Developing Windows Store Apps : Introduction And Requirement Specification
  2. Plans For Designing Metro Style Apps (Windows Store Apps)
  3. Windows Store Application Life-Cycle
  4. Guidelines to Pass Windows Store App Certification
  5. Navigation Patterns to Develop Windows Store Application
  6. Templates to Develop Windows Store Apps
  7. Develop Your First Windows Store App (Hello World)
  8. Controls to Design Windows Store Apps
  9. Lay-out Design Guidelines For Windows Store Apps
  10. Guidelines to Create Splash Screen For Windows Store Application
  11. Configure Your Windows Store Application Using Manifest Designer
  12. Working With Progress Controls in Windows Store Application
  13. Global AppBar For Windows Store Applications
  14. Using Webcam to Preview Video In Windows Store App
Introduction

In the last article we saw how to capture video using webcam in windows store application. In this article we will see how to rotate the video captured from a webcam in a Windows Store application. If you need to place the video in a corner in your application due to limited space on the screen and since you need to show a rotated video then you can use this technique for rotating the video. Let's see how to rotate a video.

Step 1

Follow the steps given in my last article to create a first video captured application using a webcam.

Step 2

After you created a video capture enabled Windows Store application, add the rotation effect to you application. In the Windows Store we have two kinds of rotation, one is PreviewRotation and the second is RecordRotation.

Preview Rotation

A Preview rotation is for when you need to rotate the captured video while the video is being captured from the webcam or other capture enabled device. If you need to rotate the preview of the video then you can use preview rotation. Preview rotation can be provided using MediaCapture object's SetPreviewRotation method that takes a VideoRotation enumerations value as input and rotates the video.

VideoRotation enumeration can found under the "Windows.Media.Capture.VideoRotation" namespace. The VideoRotation enumeration has values for 0, 90, 180 and 270 degrees. For applying PreviewRotation on video use the following line of code.  captureMgr.SetPreviewRotation(VideoRotation.Clockwise90Degrees);

In the above line we have captureMgr as the MediaCapture object. We called the SetPreviewRotation method of the MediaCapture class to rotate the video while previewing.

Record Rotation

Record rotation is used when we need to rotate the video while recording. When you are recording video in a Windows Store application and need the video to be rotated then you can use Record Rotation. RecordRotation can be applied by calling the SetRecordRotation method of the MediaCapture class that also takes the same enumeration values as input as does Preview Roation.

captureMgr.SetRecordRotation(VideoRotation.Clockwise90Degrees);

Conclusion

In this easy way we can apply rotation on video in a Windows Store application.

Up Next
    Ebook Download
    View all
    Learn
    View all