public OpusSettings(VideoConversionElement audioConversion) { CodecName = "libopus"; BitRate = audioConversion.AudioBitRate; Channels = audioConversion.AudioChannel; Frequency = audioConversion.AudioFrequency; }
public AacSettings(VideoConversionElement audioConversion) { CodecName = "libvo_aacenc"; BitRate = audioConversion.AudioBitRate; Channels = audioConversion.AudioChannel; Frequency = audioConversion.AudioFrequency; Options = AllFixedOptions; }
public Mp3Settings(VideoConversionElement audioConversion) { var channels = audioConversion.AudioChannel; if (channels > 2) { channels = 2; } CodecName = "libmp3lame"; BitRate = audioConversion.AudioBitRate; Channels = channels; Frequency = audioConversion.AudioFrequency; }
public FlvSettings(VideoConversionElement videoConversion) { CodecName = "flv"; var maxVideoBitRate = videoConversion.VideoBitRate; if (videoConversion.MaxVideoBitRate > 0) { maxVideoBitRate = videoConversion.MaxVideoBitRate; } var bufferSize = videoConversion.VideoBitRate * 10; if (videoConversion.BufferSize > 0) { bufferSize = videoConversion.BufferSize; } var keyframeInterval = videoConversion.FrameRate * 3; if (videoConversion.MaxVideoBitRate > 0) { keyframeInterval = videoConversion.MaxVideoBitRate; } if (keyframeInterval > MaximumKeyFrameInterval) { keyframeInterval = MaximumKeyFrameInterval; } var minKeyframeInterval = videoConversion.FrameRate; if (videoConversion.MinKeyFrameInterval > 0) { minKeyframeInterval = videoConversion.MinKeyFrameInterval; } if (minKeyframeInterval > MaximumKeyFrameInterval) { minKeyframeInterval = MaximumKeyFrameInterval; } Deinterlace = videoConversion.Deinterlace; Width = videoConversion.Width; Height = videoConversion.Height; AspectRatio = videoConversion.AspectRatio; BitRate = videoConversion.VideoBitRate; FrameRate = videoConversion.FrameRate; MaxBitRate = maxVideoBitRate; BufferSize = bufferSize; KeyframeInterval = keyframeInterval; MinKeyframeInterval = minKeyframeInterval; FirstPhaseOptions = AllFixedOptions; SecondPhaseOptions = string.Empty; }
public H264Settings(VideoConversionElement videoConversion) { CodecName = "libx264"; var maxVideoBitRate = videoConversion.VideoBitRate; if (videoConversion.MaxVideoBitRate > 0) { maxVideoBitRate = videoConversion.MaxVideoBitRate; } var bufferSize = videoConversion.VideoBitRate * 10; if (videoConversion.BufferSize > 0) { bufferSize = videoConversion.BufferSize; } var keyframeInterval = videoConversion.FrameRate * 3; if (videoConversion.MaxVideoBitRate > 0) { keyframeInterval = videoConversion.MaxVideoBitRate; } var minKeyframeInterval = videoConversion.FrameRate; if (videoConversion.MinKeyFrameInterval > 0) { minKeyframeInterval = videoConversion.MinKeyFrameInterval; } Deinterlace = videoConversion.Deinterlace; Width = videoConversion.Width; Height = videoConversion.Height; AspectRatio = videoConversion.AspectRatio; BitRate = videoConversion.VideoBitRate; FrameRate = videoConversion.FrameRate; MaxBitRate = maxVideoBitRate; BufferSize = bufferSize; KeyframeInterval = keyframeInterval; MinKeyframeInterval = minKeyframeInterval; FirstPhaseOptions = FirstPhaseFixedOptions; SecondPhaseOptions = SecondPhaseFixedOptions; }
private static void AddVideoConversionSetting(ProjectElement project) { var configurationProperty = project.GetConfigurationProperty(VideoConversionConfiguration.Instance.ElementCollectionSettingName); var commandElementCollection = project.GetElementCollection<VideoConversionElementCollection>(configurationProperty); var element = new VideoConversionElement { Name = "VideoConversionElement", OutPutPath = @"c:\", }; commandElementCollection.Add(element); }