OutputStreams Property

Summary
Gets the number of output streams available in the current program.
Syntax
C#
C++/CLI
public int OutputStreams { get; } 
public: 
property int OutputStreams { 
   int get(); 
} 

Property Value

A value representing the number of output streams available in the current program.

Remarks

The current source media file is the file that the MediaInfo object gets information for. To set the current source media file, set the SourceFile property. The source file has one or more programs and each program has one or more output streams. The value of this property might change if you change the value of the current program using the CurrentProgram property. The value of this property can be used to iterate through all streams, acquiring information on each. To set the current stream, set the CurrentStream property. Once the current stream has been set, other MediaInfo properties are updated with information about the current stream.

Example
C#
using Leadtools; 
using Leadtools.Multimedia; 
using LeadtoolsMultimediaExamples.Fixtures; 
 
 
public PlayCtrlForm _form = new PlayCtrlForm(); 
public bool _result = false; 
 
public void ResetSourceExample() 
{ 
   // reference the play control 
   PlayCtrl playctrl = _form.PlayCtrl; 
 
   // input file 
   string inWmvFile = Path.Combine(LEAD_VARS.MediaDir, "MediaInfo_Source.wmv"); 
   string inAviFile = Path.Combine(LEAD_VARS.MediaDir, "MediaInfo_Source.avi"); 
             
   try 
   { 
      // create a new media info object 
      MediaInfo mi = new MediaInfo(); 
 
      // get MP3 info 
      mi.SourceFile = inWmvFile; 
 
      // set the info string with general media information 
      Console.WriteLine("General Info"); 
      Console.WriteLine("Title: " + mi.Title); 
      Console.WriteLine("Author: " + mi.Author); 
      Console.WriteLine("Description: " + mi.Description); 
      Console.WriteLine("Rating: " + mi.Rating); 
      Console.WriteLine("Copyright: " + mi.Copyright); 
      Console.WriteLine(); 
 
      // reset the source 
      mi.ResetSource(); 
 
      // get AVI info 
      mi.SourceFile = inAviFile; 
 
      Console.WriteLine("General Info"); 
      Console.WriteLine("File: " + mi.SourceFile); 
      Console.WriteLine("File Size: " + mi.SourceFileSize); 
      Console.WriteLine("Format: " + mi.SourceFormat + "(" + mi.SourceFormatName + ")"); 
      Console.WriteLine("Duration: " + mi.SourceDuration); 
      Console.WriteLine("Real Bit-rate: " + mi.SourceBitRate); 
      Console.WriteLine("Format Type: " + mi.SourceMediaType.FormatType); 
      Console.WriteLine(); 
 
      Console.WriteLine("Source Filter Info"); 
                
      var s = mi.SourceFilter; 
      IntPtr ptr = Marshal.GetIUnknownForObject(s); 
      Console.WriteLine(string.Format("Address of Object Pointer: 0x{0:X}", ptr.ToInt64())); 
 
      Console.WriteLine("ClassID: " + mi.SourceFilterClassID); 
      Console.WriteLine("Name: " + mi.SourceFilterName); 
 
      Console.WriteLine("Streams Info"); 
      for ( int streamIndex = 0; streamIndex < mi.OutputStreams; streamIndex++ ) 
      { 
         mi.CurrentStream = streamIndex; 
         Console.WriteLine("Stream Index: " + streamIndex); 
         Console.WriteLine("Type: " + mi.StreamType + "(" + mi.StreamTypeName); 
         Console.WriteLine("Subtype: " + mi.StreamSubtype + "(" + mi.StreamSubtypeName); 
         Console.WriteLine("Format Type: " + mi.StreamMediaType.FormatType); 
 
         if (mi.StreamTypeName == "Video") 
         { 
            Console.WriteLine("Width: " + mi.VideoWidth + " pixels"); 
            Console.WriteLine("Height: " + mi.VideoHeight + " pixels"); 
            Console.WriteLine("Bit Count: " + mi.VideoBitCount + " bits per pixel"); 
            Console.WriteLine("Frame Count: " + mi.VideoFrames); 
            Console.WriteLine("Frame Rate: " + mi.VideoFrameRate + "frames per second"); 
            Console.WriteLine("Compression: " + mi.VideoCompression); 
            Console.WriteLine("Bit-rate: " + mi.VideoBitRate + "kbps"); 
            Console.WriteLine("Duration: " + mi.StreamDuration + "seconds"); 
            Console.WriteLine(); 
         } 
         else if (mi.StreamTypeName == "Audio") 
         { 
            Console.WriteLine("Format Tag: " + mi.AudioFormatTag); 
            Console.WriteLine("Channels: " + mi.AudioChannels); 
            Console.WriteLine("Frequency: " + mi.AudioSamplesPerSec + " samples per second"); 
            Console.WriteLine("Sample Size: " + mi.AudioBitsPerSample + " bits per sample"); 
            Console.WriteLine("Average Rate: " + mi.AudioAvgBytesPerSec + "bytes per second"); 
            Console.WriteLine("Duration: " + mi.StreamDuration + "seconds"); 
            Console.WriteLine(); 
         } 
      } 
 
      // media info outputted to console, set result to true 
      _result = true; 
 
      // reset the source 
      mi.ResetSource(); 
 
      // set the result to what we expect 
      _result = (mi.SourceFile == null); 
   } 
   catch (Exception) 
   { 
      _result = false; 
   } 
} 
 
static class LEAD_VARS 
{ 
   public const string MediaDir = @"C:\LEADTOOLS23\Media"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Multimedia Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.