Windows Media Video (WMV) is the most recognized codec within the WMV family. While all versions of WMV support variable bit rate, average bit rate and constand bit rate.
Media Handler Pro can be used to create WMV and WMA video and audio files, view examples below or contact us for more help.
Example shown below is related with Media Handler Pro version 3.0.
// Sample code for encoding any format video to wmv format.
MediaHandler _mhandler = new MediaHandler();
// required properties
string RootPath = Server.MapPath(Request.ApplicationPath);
_mhandler.FFMPEGPath = HttpContext.Current.Server.MapPath("~\\ffmpeg\\ffmpeg.exe");
_mhandler.InputPath = RootPath + "\\contents\\video";
_mhandler.OutputPath = RootPath + "\\contents\\wmv";
_mhandler.FileName = "sample.mpg";
// optional output filename
_mhandler.OutputFileName = "sample.wmv";
// setting video related properties
_mhandler.Video_Bitrate = 786;
_mhandler.Audio_Bitrate = 64;
_mhandler.Audio_SamplingRate = 44100;
// generate highest quality mp4 video, note by making this option true, video bitrate will no longer work.
_mhandler.MaxQuality = true;
// optional video width and height settings
_mhandler.Width = 320;
_mhandler.Height = 240;
// optional video and audio codec settings, make sure it is compatible with wmv video otherwise result in failure of video encoding.
_mhandler.ACodec = "wmav1";
_mhandler.VCodec = "wmv1";
// posting watermark on wmv video, view detail in watermark section
_mhandler.WaterMarkPath = RootPath + "\\contents\\watermark";
_mhandler.WaterMarkImage = "watermark.gif";
// start processing video
string output = _mhandler.Encode_WMV();
// validate output with error codes in order to make sure wmv video is published successfully.
// Sample code for encoding any format video to wma format.
MediaHandler _mhandler = new MediaHandler();
// required properties
string RootPath = Server.MapPath(Request.ApplicationPath);
_mhandler.FFMPEGPath = HttpContext.Current.Server.MapPath("~\\ffmpeg\\ffmpeg.exe");
_mhandler.InputPath = RootPath + "\\contents\\video";
_mhandler.OutputPath = RootPath + "\\contents\\wmv";
_mhandler.FileName = "sample.mpg";
// optional output filename
_mhandler.OutputFileName = "sample.wma";
// setting video related properties
_mhandler.Video_Bitrate = 786;
_mhandler.Audio_Bitrate = 64;
_mhandler.Audio_SamplingRate = 44100;
// optional video and audio codec settings, make sure it is compatible with mp4 video otherwise result in failure of video encoding.
_mhandler.ACodec = "wmav1";
// start processing video
string output = _mhandler.Encode_WMA();
// validate output with error codes in order to make sure wma video is published successfully.