2.3, audio and video capture (II)

 

This chapter Introduction: explain the configuration parameters of audio and video capture, video to explain the use of filters. Recommended reading way: understanding + practical operation.

  Following this section of the contents of one. Through the festival API "navigator.mediaDevices.getUserMedia (mediaStreamConstraints)" realized the audio and video data in real-time collection of video playing tag, this section, we explain in detail the configuration --mediaStreamConstraints acquisition parameters. As shown in the following data structure.

dictionary MediaStreamConstraints {
    (boolean or MediaTrackConstraints) video = true;
    (boolean or MediaTrackConstraints) audio = true;
 }

 

The code tells us, MediaStreamConstraints objects, video and audio options for at least one, can not capture audio and video are not. video and audio parameters which can be boolean type and can be other configuration data types, simple and crude configuration pass a value directly to / false is true, but the actual project development, the need for more detailed configuration, so this section we look at See the detailed configuration parameters which can be configured, the following code common configuration.

const MediaStreamConstraints = {
    video:{
        width:1280,
        height:720,
        faceMode:"enviroment",
        frameRate:30,
        resizeMode:"",
    }
}

 

 explain in detail.

 

Guess you like

Origin www.cnblogs.com/rajan/p/12448688.html
Recommended