Click here to Skip to main content
15,893,508 members
Articles / Multimedia

Multimedia Transcoding Across Multiple Computers with LEADTOOLS

7 Jan 2013CPOL4 min read 35.2K   442   5  
The benefits of grid and distributed computing are well established and indisputable.  However, implementing them can be a nightmare – converting audio/video files in separate chunks can result in video hiccups and out of sync audio – but not with LEADTOOLS!

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

using System;
using System.Collections;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
using System.IO;
using Leadtools.Multimedia;

namespace MultiMachineTranscoding
{
   public class FrmMain : System.Windows.Forms.Form
   {

      #region  Windows Form Designer generated code

      public FrmMain() : base()
      {
         //This call is required by the Windows Form Designer.
         InitializeComponent();

         //Add any initialization after the InitializeComponent() call
#if _WIN64
         this.Text = this.Text + " - 64 Bit Version";
#else
         this.Text = this.Text + " - 32 Bit Version";
#endif
      }

      //Form overrides dispose to clean up the component list.
      protected override void Dispose(bool disposing)
      {
         if (disposing)
         {
            if (components != null)
            {
               components.Dispose();
            }
         }
         base.Dispose(disposing);
      }

      private MenuStrip menuStrip1;
      private ToolStripMenuItem _menuItemExit;
      private ToolStripMenuItem exitToolStripMenuItem;
      private ToolStripMenuItem _menuItemWindow;
      private ToolStripMenuItem _menuItemCascade;
      private ToolStripMenuItem _menuItemTileHorizontally;
      private ToolStripMenuItem _menuItemTileVertically;
      private ToolStripMenuItem _menuItemArrangeIcons;

      //Required by the Windows Form Designer
      private System.ComponentModel.IContainer components;

      //NOTE: The following procedure is required by the Windows Form Designer
      //It can be modified using the Windows Form Designer.  
      //Do not modify it using the code editor.
      [System.Diagnostics.DebuggerStepThrough()]
      private void InitializeComponent()
      {
         System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain));
         this.menuStrip1 = new System.Windows.Forms.MenuStrip();
         this._menuItemExit = new System.Windows.Forms.ToolStripMenuItem();
         this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
         this._menuItemWindow = new System.Windows.Forms.ToolStripMenuItem();
         this._menuItemCascade = new System.Windows.Forms.ToolStripMenuItem();
         this._menuItemTileHorizontally = new System.Windows.Forms.ToolStripMenuItem();
         this._menuItemTileVertically = new System.Windows.Forms.ToolStripMenuItem();
         this._menuItemArrangeIcons = new System.Windows.Forms.ToolStripMenuItem();
         this.menuStrip1.SuspendLayout();
         this.SuspendLayout();
         // 
         // menuStrip1
         // 
         this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._menuItemExit,
            this._menuItemWindow});
         this.menuStrip1.Location = new System.Drawing.Point(0, 0);
         this.menuStrip1.Name = "menuStrip1";
         this.menuStrip1.Size = new System.Drawing.Size(848, 24);
         this.menuStrip1.TabIndex = 1;
         this.menuStrip1.Text = "menuStrip1";
         // 
         // _menuItemExit
         // 
         this._menuItemExit.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.exitToolStripMenuItem});
         this._menuItemExit.Name = "_menuItemExit";
         this._menuItemExit.Size = new System.Drawing.Size(37, 20);
         this._menuItemExit.Text = "File";
         // 
         // exitToolStripMenuItem
         // 
         this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
         this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
         this.exitToolStripMenuItem.Text = "Exit";
         this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
         // 
         // _menuItemWindow
         // 
         this._menuItemWindow.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this._menuItemCascade,
            this._menuItemTileHorizontally,
            this._menuItemTileVertically,
            this._menuItemArrangeIcons});
         this._menuItemWindow.Name = "_menuItemWindow";
         this._menuItemWindow.Size = new System.Drawing.Size(63, 20);
         this._menuItemWindow.Text = "Window";
         // 
         // _menuItemCascade
         // 
         this._menuItemCascade.Name = "_menuItemCascade";
         this._menuItemCascade.Size = new System.Drawing.Size(166, 22);
         this._menuItemCascade.Text = "Cascade";
         this._menuItemCascade.Click += new System.EventHandler(this._menuItemCascade_Click);
         // 
         // _menuItemTileHorizontally
         // 
         this._menuItemTileHorizontally.Name = "_menuItemTileHorizontally";
         this._menuItemTileHorizontally.Size = new System.Drawing.Size(166, 22);
         this._menuItemTileHorizontally.Text = "Tile Horizonatally";
         this._menuItemTileHorizontally.Click += new System.EventHandler(this._menuItemTileHorizontally_Click);
         // 
         // _menuItemTileVertically
         // 
         this._menuItemTileVertically.Name = "_menuItemTileVertically";
         this._menuItemTileVertically.Size = new System.Drawing.Size(166, 22);
         this._menuItemTileVertically.Text = "Tile Vertically";
         this._menuItemTileVertically.Click += new System.EventHandler(this._menuItemTileVertically_Click);
         // 
         // _menuItemArrangeIcons
         // 
         this._menuItemArrangeIcons.Name = "_menuItemArrangeIcons";
         this._menuItemArrangeIcons.Size = new System.Drawing.Size(166, 22);
         this._menuItemArrangeIcons.Text = "Arrange Icons";
         this._menuItemArrangeIcons.Click += new System.EventHandler(this._menuItemArrangeIcons_Click);
         // 
         // FrmMain
         // 
         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(848, 810);
         this.Controls.Add(this.menuStrip1);
         this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
         this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
         this.IsMdiContainer = true;
         this.MainMenuStrip = this.menuStrip1;
         this.Name = "FrmMain";
         this.Text = "C# Multi-Machine Transcoding Demo";
         this.Load += new System.EventHandler(this.FrmMain_Load);
         this.menuStrip1.ResumeLayout(false);
         this.menuStrip1.PerformLayout();
         this.ResumeLayout(false);
         this.PerformLayout();

      }

      #endregion


      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      [STAThread()]
      public static void Main()
      {
         Application.EnableVisualStyles();
         Application.EnableVisualStyles();
         Application.DoEvents();
         // To run the Unlock Support code, include [LEADTOOLS Install Dir]\Examples\Ltmm\Dotnet\CS\Common\LtmmSerialNumber.cs & UnlockSupport.cs
         //string[] ppszExtraKeys =
         //{
         //   // insert additional extra keys here
         //};
         //UnlockSupport unlocksprt = new UnlockSupport();
         //unlocksprt.Unlock(null, ppszExtraKeys);
         Application.Run(new FrmMain());
         //unlocksprt.Lock(null);
      }

      private void FrmMain_Load(object sender, System.EventArgs e)
      {
         //Show settings dialog
         FrmSettings settings = new FrmSettings();
         settings.MdiParent = this;
         settings.Show();
      }

      private void exitToolStripMenuItem_Click(object sender, EventArgs e)
      {
         Application.Exit();
      }

      private void _menuItemCascade_Click(object sender, EventArgs e)
      {
         this.LayoutMdi(MdiLayout.Cascade);
      }

      private void _menuItemTileHorizontally_Click(object sender, EventArgs e)
      {
         this.LayoutMdi(MdiLayout.TileHorizontal);
      }

      private void _menuItemTileVertically_Click(object sender, EventArgs e)
      {
         this.LayoutMdi(MdiLayout.TileVertical);
      }

      private void _menuItemArrangeIcons_Click(object sender, EventArgs e)
      {
         this.LayoutMdi(MdiLayout.ArrangeIcons);
      }
   }
} //end of root namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Help desk / Support LEAD Technologies, Inc.
United States United States
Since 1990, LEAD has established itself as the world's leading provider of software development toolkits for document, medical, multimedia, raster and vector imaging. LEAD's flagship product, LEADTOOLS, holds the top position in every major country throughout the world and boasts a healthy, diverse customer base and strong list of corporate partners including some of the largest and most influential organizations from around the globe. For more information, contact sales@leadtools.com or support@leadtools.com.
This is a Organisation (No members)


Comments and Discussions