Exemple #1
0
        /// <summary>
        /// Creates a new Obs video encoder with default settings.
        /// </summary>
        /// <returns></returns>
        public static ObsEncoder CreateVideoEncoder()
        {
            ObsEncoder obsVideoEncoder = new ObsEncoder(ObsEncoderType.Video, "obs_x264", "simple_h264_stream");
            IntPtr     obsVideoPointer = Obs.GetVideo();

            obsVideoEncoder.SetVideo(obsVideoPointer);

            ObsData videoEncoderSettings = new ObsData();

            videoEncoderSettings.SetInt("bitrate", Constants.Video.ENCODER_BITRATE);
            videoEncoderSettings.SetString("rate_control", Constants.Video.RATE_CONTROL);
            obsVideoEncoder.Update(videoEncoderSettings);
            videoEncoderSettings.Dispose();

            return(obsVideoEncoder);
        }