Simple Video Converter

This topic is about building a video converter in C#, C++, and Visual Studio.

Source Video

For a video source we use the Wildlife.wmv HD movie from the Internet Archive. The original video format is WMV 720p, 16:9, 1280 x 720.


Just under 50 lines of code, this snippet is a fully functional video converter. It will take any input supported by AVBlocks and will convert it to an iPad HD 720p video.

using PrimoSoftware.AVBlocks;

namespace SimpleConverter
    class Program
        static void Main(string[] args)

            var inputInfo = new MediaInfo();
            inputInfo.Inputs[0].File = "Wildlife.wmv";

            if (inputInfo.Open()) {
                var inputSocket = MediaSocket.FromMediaInfo(inputInfo);
                var outputSocket = MediaSocket.FromPreset(Preset.Video.iPad.H264_720p);
                outputSocket.File = "Wildlife.mp4";

                using (var transcoder = new Transcoder()) {

                    if (transcoder.Open())



How to run

Follow the steps to create a C# console application in Visual Studio, but in Program.cs use the code from this article.

Download the Wildlife.wmv HD movie from the Internet Archive and save it in bin\x64\Debug under the project's directory.

Run the application in Visual Studio. Wait a few seconds for the Transcoder to finish. The converted file Wildlife.mp4 will be in the bin\x64\Debug directory.

Last updated onMarch 10th, 2018 11:16:37 AM