示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VideoOutputStream"/> class.
        /// </summary>
        /// <param name="stream">The video stream.</param>
        /// <param name="config">The stream setting.</param>
        internal VideoOutputStream(OutputStream <VideoFrame> stream, VideoEncoderSettings config)
        {
            this.stream   = stream;
            Configuration = config;
            converter     = new ImageConverter();

            var(size, format) = GetStreamLayout(stream);
            encodedFrame      = VideoFrame.Create(size, format);
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MediaOutput"/> class.
        /// </summary>
        /// <param name="mediaContainer">The <see cref="OutputContainer"/> object.</param>
        /// <param name="videoSettings">The video stream settings.</param>
        internal MediaOutput(OutputContainer mediaContainer, VideoEncoderSettings videoSettings)
        {
            container = mediaContainer;

            if (mediaContainer.Video != null)
            {
                Video = new VideoOutputStream(mediaContainer.Video, videoSettings);
            }
        }
示例#3
0
        /// <summary>
        /// Adds a new video stream to the file.
        /// </summary>
        /// <param name="settings">The video stream settings.</param>
        /// <returns>This <see cref="MediaBuilder"/> object.</returns>
        public MediaBuilder WithVideo(VideoEncoderSettings settings)
        {
            if (FFmpegLoader.IsFFmpegGplLicensed == false && (settings.Codec == VideoCodec.H264 || settings.Codec == VideoCodec.H265))
            {
                throw new NotSupportedException("The LGPL-licensed FFmpeg build does not contain libx264 and libx265 codecs.");
            }

            container.AddVideoStream(settings);
            return(this);
        }
示例#4
0
 /// <summary>
 /// Adds a new video stream to the file.
 /// </summary>
 /// <param name="settings">The video stream settings.</param>
 /// <returns>This <see cref="MediaBuilder"/> object.</returns>
 public MediaBuilder WithVideo(VideoEncoderSettings settings)
 {
     container.AddVideoStream(settings);
     videoSettings = settings;
     return(this);
 }