Convert MOV to MP4 using C#

Convert WMV to MP4

Images and videos are an integral part of our lives. Also, the videos are getting more popular to express, educate, broadcast, etc a message to the wider community. With the passage of time, new video and audio compression formats are introduced. However, people do not want to lose their existing data. Or they cannot switch to new format/compression due to various reasons including legal, organizational, regional, etc obligations. So, in order to facilitate our customers, we have developed video files processing Cloud API. It enables you to adjust video properties such as volume level, frames per second, PTS, resolution, aspect ratio, bitrate, video standard (PAL, NTSC, FILM). You may also add image or text watermark to videos, extract video thumbnail images, re-encode videos with different codec, merge multiple videos, and convert videos to other supported formats.

Video processing using C#

Aspose.Video Cloud is developed on top of REST APIs and it enables you to manipulate existing video files over the cloud. No software download or installation required. So with few simple commands, you can accomplish your requirement. In order to use the REST API, use a specific SDK created for each programming language.

MOV to MP4 using C#

Given below are the steps and related details for the conversion of the MOV file to MP4 format using C#. In the following example, you will notice the ConvertOptions object which enables you to set AspectRatio, Bitrate, Codec. It also enables you to set Frames Per Second, FrameSize, Preset (speed), adjust Volume. You may also set a Watermark image or even a Text watermark in the resultant video file.

  1. First of all, get your personalized ClientID and ClientSecret code after registering over https://dashboard.aspose.cloud/
  2. Secondly, create an instance of VideoApi class while passing ClientID, ClientSecret, and apiBaseUrl as input arguments to its constructor
  3. Thirdly, create an instance of the ConvertOptions object
  4. Now set the AspectRatio of the resultant file as default using a value from ConvertOptions.AspectRatioEnum enumeration. Now assign the value to AspectRatio property of ConvertOptions class
  5. Penultimate, create an object of PostConvertVideoRequest class while passing input video file path, resultant format, location of resultant video and ConvertOptions object as an argument
  6. Finally, call PostConvertVideo(..) method while passing PostConvertVideoRequest object as argument. The resultant file saves in Cloud storage

You may download the source files from

Convert AVI to MP4 in C#

The AVI (Audio Video Interleave) is a multimedia container format introduced by Microsoft in November 1992 as part of its Video for Windows software. AVI files can contain both audio and video data in a file container that allows synchronous audio-with-video playback. Therefore, lots of media is already generated in .avi format but in order to preserve it and to make it compatible with the latest applications, it can also be converted to MP4 formats. The conversion steps are the same and the API is robust enough to save to determine the format of the input file and enables us to perform conversion operations without any hassle.

The input TestData_sample.avi can be downloaded for test purposes.

Conclusion

In this article, we have seen the details on how easily we can convert video and audio files from one format to another. Apart from the conversion feature, a lot of other exciting features are available in Aspose.Video Cloud. We recommend you have a quick look over product documentation and in case you encounter any issue while using the API, please feel free to contact us through our Free product support forum.

Last but not the least, our cloud SDKs are open-source and the complete source code of Aspose.Video Cloud SDK for .NET can be downloaded over GitHub.