Image To Video SDK allows to convert image sequence to video slideshow with transitions, slide effects, background music and color.

JPG images can be converted to either AVI or WMV video file in Image To Video SDK. What format to choose for JPG to video conversion?

Difference between AVI and WMV video formats:

  • Videos in AVI format have significantly larger file sizes than video files in WMV.
  • AVI has better video playback quality and performance.
  • There are lots of codecs and file extensions associated with AVI (DivX, xDiv, mJpeg, MP4 and many more) while WMV is a proprietary file format of Microsoft.
  • AVI gives possibility to create uncompressed video and 32-bit RGBA video (i.e. video with transparency channel) while WMV doesn’t.

Summary: WMV is preferrable for online streaming while AVI is the best format to use for high quality playback on PCs and editing purposes.

To convert JPG to AVI in Visual C# or Visual Basic. NET, use source codes from How to convert JPG to AVI tutorial.

To convert JPG to WMV in Visual C# or Visual Basic .NET, use the source codes below.

VISUAL C#

using System;
using System.Diagnostics;

using BytescoutImageToVideoLib;

namespace SimpleSlideshow
{
class Program
{

static void Main(string[] args)
{

Console.Write("Converting JPG slides into video, please wait..");

// Create BytescoutImageToVideoLib.ImageToVideo object instance
ImageToVideo converter = new ImageToVideo();

// Activate the component
converter.RegistrationName = "demo";
converter.RegistrationKey = "demo";

// Add images and set the duration for every slide
Slide slide;
slide = (Slide) converter.AddImageFromFileName("..\..\..\..\slide1.jpg");

slide.Duration = 3000; // 3000ms = 3s
slide = (Slide) converter.AddImageFromFileName("..\..\..\..\slide2.jpg");

slide.Duration = 3000;
slide = (Slide) converter.AddImageFromFileName("..\..\..\..\slide3.jpg");

slide.Duration = 3000;

// Set output video size
converter.OutputWidth = 400;

converter.OutputHeight = 300;

// Set output video file name
converter.OutputVideoFileName = "result.wmv";

// Run the conversion
converter.RunAndWait();

Console.WriteLine("Conversion is done. Press any key to continue..");

Console.ReadKey();

// Open the result video file in default media player
Process.Start("result.wmv");

}
}
}