Viscomsoft .Net Video Capture SDK

Encoder.getSupportedAudioBitrates Method

 

Return the list of supported Audio Bitrate. For WMV or MP4 encoder, it supported different audio bitrate depend on sample rates and channels.
so you will not be directly set the Encoder.Audiobitrate. Call this method first and select the supported bitrate from
the list.

public List<int> getSupportedAudioBitrates(int sampleRate, int channels)

Parameter

sampleRate-the value of audio sample rate.
channels-the value of audio channels.

Namespace: Viscomsoft.VideoCapture

Return Value
Return the list of support Audio Bitrate.

Example

   

[c# Syntax] 
  public VideoCapture _capture =  new VideoCapture();
  public Devices _devices = new Devices();
 
  _capture.Initialize();
  _devices.Refresh();
  _capture.Window = pictureBox1.Handle;
  _capture.Mode = VideoCapture.CaptureMode.Capture;
  _capture.Encoder.OutputType = OutputType.MP4;
  _capture.Encoder.H264Profile = H264Profile.Base;
  _capture.OutputFile = "c:\yourfolder\test1.mp4";

   AudioDevice audiodevice=_capture.AudioDevice = _devices.AudioDevices[0];
  _capture.AudioDevice = audiodevice;

  List<int> bitrates = _capture.Encoder.getSupportedAudioBitrates(audiodevice.SampleRates[0].SampleRate, audiodevice.SampleRates[0].Channels);
  _capture.Encoder.AudioBitrate = bitrates[0];

  _capture.VideoDevice = _devices.VideoDevices[0];
  _capture.Encoder.VideoBitrate = 1000000;
  _capture.VideoDevice.SelectedResolution = _capture.VideoDevice.VideoResolutions[0];
   int result= _capture.Start();