Capture it all with LEADTOOLS Multi-Capture Video Support

Being able to capture audio and video from multiple sources is useful for a range of industries, from conducting online meetings, webinars, or conferences to creating content online or instructional videos to enhance the learning experience. The new LEADTOOLS Multi-Capture Video Support gives developers the power to build powerful video streaming applications with ease. This technology is new with V23 and not only does it do the work for you, but it allows you to use a wide variety of supported input sources to capture all the angles you need!

With our extensive tutorials, we help make tasks like these not so daunting. In the tutorial referenced below, we walk you through how to Capture Audio/Video from Multiple Sources at once using the LEADTOOLS Multimedia SDK in a WinForms C# application.

It’s Coding Time!

With the project created, references added, and the license set, coding can begin! First you will create the form controls then you will initialize the capture control and add streams, as shown in the following code:


private void AddStream(ILMMixCapSrc mixSrc, string videoName, string audioName = null, bool useFriendlyName = false, string labelText = null)
{
 var count = mixSrc.StreamCount;
 mixSrc.AddStream();
 ILMMixCapSrcStream stream = mixSrc.GetStream(count);
 if (videoName != null)
 {
  ILMMixCapSrcDevices devices = stream.VideoDevices;
  if (useFriendlyName)
   videoName = FindDeviceName(devices, videoName);
  var index = devices.Find(videoName);
  devices.Selection = index;
  if (labelText != null)
  {
   stream.Labels.AddLabel();
   ILMMixCapSrcLabel label = stream.Labels.GetLabel(stream.Labels.Count - 1);
   label.Text = labelText;
   stdole.IFontDisp font = label.Font;
   font.Name = "Arial";
   font.Bold = true;
   font.Size = 8;
   label.Font = font;
   label.Color = (uint)ColorTranslator.ToOle(Color.White);
   label.BackgroundColor = (uint)ColorTranslator.ToOle(Color.Blue);
  }
 }
 if (audioName != null)
 {
  ILMMixCapSrcDevices devices = stream.AudioDevices;
  if (useFriendlyName)
   audioName = FindDeviceName(devices, audioName);
  var index = devices.Find(audioName);
  devices.Selection = index;
 }
}
private string FindDeviceName(ILMMixCapSrcDevices devices, string name)
{
 for (int i = 0; i < devices.Count; i++)
 {
  ILMMixCapSrcDevice device = devices.Item(i);
  if (String.Compare(device.FriendlyName, name, StringComparison.OrdinalIgnoreCase) == 0)
   return device.Name;
 }
 return "";
}

Once you add the capture start and stop code, you can run the project and be on your way to select your capture source of choice within your audio/video capture application!

Download V23 Today!

V23 is available to download now via our FREE evaluation SDK! With every eval comes our full collection of libraries and free technical support via live chat and email. See for yourself become one of the many who choose LEADTOOLS to streamline their application development!

This entry was posted in Multimedia Imaging and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *