C#
VB
C++
Gets the average bit rate achieved by the multiplexer.
[DispIdAttribute(1)]int BitRate {get;}
<DispIdAttribute(1)>ReadOnly Property BitRate As Integer
[DispIdAttribute(1)]property int BitRate {int get();}
An System.Int32 value that represents the average bit rate achieved by the multiplexer.
The average bit rate is affected dramatically by the input media type. Compressed media has a much smaller bit rate.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public CaptureCtrlForm _form = new CaptureCtrlForm();public CaptureCtrl _captureCtrl;const int MaxBitRate = 128;const int TestBitRate = MaxBitRate + 1;public void NetworkMultiplexerExample(){// reference the capture control_captureCtrl = _form.CaptureCtrl;// output filestring outFile = @"ltsf://127.0.0.1:27015";try{// try to find a USB cameraif (_captureCtrl.VideoDevices["Logitech"] == null)throw new Exception("No Logitech video device available");_captureCtrl.VideoDevices["Logitech"].Selected = true;// select a video compressor_captureCtrl.VideoCompressors.Mpeg4.Selected = true;// set the target output file_captureCtrl.TargetFormat = TargetFormatType.NET;_captureCtrl.TargetFile = outFile;if (_captureCtrl.IsModeAvailable(CaptureMode.Video)){// just 10 seconds of capture time_captureCtrl.TimeLimit = 10;_captureCtrl.UseTimeLimit = true;// ready the capture graph in order to get the LNMetMux instance_captureCtrl.ReadyCapture(CaptureMode.Video);// get the network multiplexer referenceLMNetMux pMux = _captureCtrl.GetSubObject(CaptureObject.TargetFilter) as LMNetMux;if (pMux != null){// set live source (dropping samples is allowed if the sink is not sending fast enough to keep up)pMux.LiveSource = true;// atleast 10 seconds for the netmux sample queueif (pMux.MaxQueueDuration < 10)pMux.MaxQueueDuration = 10;// 128 kbps maxpMux.BitRateLimit = MaxBitRate * 1024;// set the result to what we expect_result = true;}// start capture_captureCtrl.StartCapture(CaptureMode.Video);// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while (_captureCtrl.State == CaptureState.Running){if (pMux != null){// confirm that the actual bitrate does not exceed our max specified above_result &= (pMux.BitRate / 1024 < TestBitRate);}Application.DoEvents();}// release the mux since its a COM objectif (pMux != null)Marshal.ReleaseComObject(pMux);}}catch (Exception){_result = false;}}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _result As Boolean = FalsePublic _form As CaptureCtrlForm = New CaptureCtrlForm()Public _captureCtrl As CaptureCtrlPrivate Const MaxBitRate As Integer = 128Private Const TestBitRate As Integer = MaxBitRate + 1Public Sub NetworkMultiplexerExample()' reference the capture control_captureCtrl = _form.CaptureCtrl' output fileDim outFile As String = "ltsf://127.0.0.1:27015"Try' try to find a USB cameraIf _captureCtrl.VideoDevices("Logitech") Is Nothing ThenThrow New Exception("No Logitech video device available")End If_captureCtrl.VideoDevices("Logitech").Selected = True' select a video compressor_captureCtrl.VideoCompressors.Mpeg4.Selected = True' set the target output file_captureCtrl.TargetFormat = TargetFormatType.NET_captureCtrl.TargetFile = outFileIf _captureCtrl.IsModeAvailable(CaptureMode.Video) Then' just 10 seconds of capture time_captureCtrl.TimeLimit = 10_captureCtrl.UseTimeLimit = True' ready the capture graph in order to get the LNMetMux instance_captureCtrl.ReadyCapture(CaptureMode.Video)' get the network multiplexer referenceDim pMux As LMNetMux = TryCast(_captureCtrl.GetSubObject(CaptureObject.TargetFilter), LMNetMux)If Not pMux Is Nothing Then' set live source (dropping samples is allowed if the sink is not sending fast enough to keep up)pMux.LiveSource = True' atleast 10 seconds for the netmux sample queueIf pMux.MaxQueueDuration < 10 ThenpMux.MaxQueueDuration = 10End If' 128 kbps maxpMux.BitRateLimit = MaxBitRate * 1024' set the result to what we expect_result = TrueEnd If' start capture_captureCtrl.StartCapture(CaptureMode.Video)' we'll loop on the state and pump messages for this example.' but you should not need to if running from a Windows Forms application.Do While _captureCtrl.State = CaptureState.RunningIf Not pMux Is Nothing Then' confirm that the actual bitrate does not exceed our max specified above_result = _result And (pMux.BitRate / 1024 < TestBitRate)End IfApplication.DoEvents()Loop' release the mux since its a COM objectIf Not pMux Is Nothing ThenMarshal.ReleaseComObject(pMux)End IfEnd IfCatch e1 As Exception_result = FalseEnd TryEnd Sub
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
