public int OutputStreams { get; } public:property int OutputStreams {int get();}
A value representing the number of output streams available in the current program.
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.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public PlayCtrlForm _form = new PlayCtrlForm();public bool _result = false;public void ResetSourceExample(){// reference the play controlPlayCtrl playctrl = _form.PlayCtrl;// input filestring 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 objectMediaInfo mi = new MediaInfo();// get MP3 infomi.SourceFile = inWmvFile;// set the info string with general media informationConsole.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 sourcemi.ResetSource();// get AVI infomi.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 sourcemi.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";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
