[DispIdAttribute(2)]int BitRateLimit {get; set;}
An System.Int32 value that represents the forced bit rate limit, in bits per second. The default value of the bit rate limit is -1, which means that the multiplexer is not restricted to a bit rate.
The multiplexer will output the data at a slower rate, in relation to the input rate, to limit the bit rate. However, the average bit rate may slightly exceed the requested limit.
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;}}