public void AutoConvert_Verify() { var setting = new AutoConvert(); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-auto_convert 1"); }
public void QualityScaleAudio_Verify() { var setting = new QualityScaleAudio(1); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-q:a 1"); }
public void AspectRatio_Verify() { var setting = new AspectRatio(Ratio.Create(1, 1)); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-aspect 1:1"); }
public void TrimShortest_Verify() { var setting = new TrimShortest(); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-shortest"); }
public void OverwriteOutput_Verify() { var setting = new OverwriteOutput(); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-y"); }
public void RemoveAudio_Verify() { var setting = new RemoveAudio(); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-an"); }
public void Input_Verify() { var setting = new Input(Resource.From("c:\\apple.mp4")); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-i \"c:/apple.mp4\""); }
public void Size_Verify() { var setting = new Size(852, 480); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-s 852x480"); }
public void CopyTimestamps_Verify() { var setting = new CopyTimestamps(); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-copyts"); }
public void Level_Verify() { var settingWrong1 = new Level(-1); var setting = new Level(3.1); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Equal("-level 3.1", SettingSerializer.Serialize(setting)); }
public void BitStreamFilterVideo_Verify() { var settingWrong1 = new BitStreamFilterVideo(""); var setting = new BitStreamFilterVideo("aac_adtstoasc"); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Equal("-bsf:v aac_adtstoasc", SettingSerializer.Serialize(setting)); }
public void Duration_Verify() { var settingWrong1 = new DurationInput(0); var setting = new DurationInput(2); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Equal("-t 00:00:02.0", SettingSerializer.Serialize(setting)); }
public void FrameRate_Verify() { var settingWrong1 = new FrameRate(); var setting = new FrameRate(29.97); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Equal("-r 29.97", SettingSerializer.Serialize(setting)); }
public void QualityScaleVideo_Verify() { var setting = new QualityScaleVideo(1); Assert.Throws <ArgumentException>(() => new QualityScaleAudio(0)); Assert.Throws <ArgumentException>(() => new QualityScaleAudio(32)); Assert.Equal("-q:v 1", SettingSerializer.Serialize(setting)); }
public void BitrateAudio_Verify() { var settingWrong1 = new BitRateAudio(0); var setting = new BitRateAudio(1100); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Equal("-b:a 1100k", SettingSerializer.Serialize(setting)); }
public void BitStreamFilterAudio_Verify() { var settingWrong1 = new BitStreamFilterAudio(""); var setting = new BitStreamFilterAudio("aac_adtstoasc"); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-bsf:a aac_adtstoasc"); }
public void BitRateVideo_Verify() { var settingWrong1 = new BitRateVideo(0); var setting = new BitRateVideo(1100); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-b:v 1100k"); }
public void WriteCommand(FFprobeCommand command) { var inputResource = new Input(command.Resource); BuilderBase.Append(" "); BuilderBase.Append(SettingSerializer.Serialize(inputResource)); command.Settings.ForEach(WriteSerializerSpecifier); }
public void ProfileVideo_Verify() { var settingWrong1 = new ProfileVideo(string.Empty); var settingWrong2 = new ProfileVideo(" "); var setting = new ProfileVideo("baseline"); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-profile:v baseline", SettingSerializer.Serialize(setting)); }
public void SeekPositionInput_Verify() { var settingWrong1 = new SeekPositionInput(0); var settingWrong2 = new SeekPositionInput(-1); var setting = new SeekPositionInput(120); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-ss 00:02:00.0", SettingSerializer.Serialize(setting)); }
public void PixelFormat_Verify() { var settingWrong1 = new PixelFormat(string.Empty); var settingWrong2 = new PixelFormat(" "); var setting = new PixelFormat("yuv420p"); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-pix_fmt yuv420p", SettingSerializer.Serialize(setting)); }
public void Channels_Verify() { var settingWrong1 = new ChannelOutput(0); var settingWrong2 = new ChannelOutput(-1); var setting = new ChannelOutput(1); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-ac 1", SettingSerializer.Serialize(setting)); }
public void CodecAudio_Verify() { var settingWrong1 = new CodecAudio(string.Empty); var settingWrong2 = new CodecAudio(" "); var setting = new CodecAudio(AudioCodecType.LibFdk_Aac); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-c:a libfdk_aac", SettingSerializer.Serialize(setting)); }
public void ConstantRateFactor_Verify() { var settingWrong1 = new ConstantRateFactor(-1); var settingWrong2 = new ConstantRateFactor(60); var setting = new ConstantRateFactor(18); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-crf 18", SettingSerializer.Serialize(setting)); }
public void FormatOutput_Verify() { var settingWrong1 = new FormatOutput(string.Empty); var settingWrong2 = new FormatOutput(" "); var setting = new FormatOutput("mp4"); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-f mp4", SettingSerializer.Serialize(setting)); }
public void CodecVideo_Verify() { var settingWrong1 = new CodecVideo(string.Empty); var settingWrong2 = new CodecVideo(" "); var setting = new CodecVideo(VideoCodecType.Libx264); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-c:v libx264", SettingSerializer.Serialize(setting)); }
public void MovFlags_Verify() { var settingWrong1 = new MovFlags(string.Empty); var settingWrong2 = new MovFlags(" "); var setting = new MovFlags(MovFlags.EnableFastStart); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-movflags +faststart", SettingSerializer.Serialize(setting)); }
public void Map_Verify() { var settingWrong1 = new Map(string.Empty); var settingWrong2 = new Map(" "); var setting = new Map("output1"); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.Equal("-map [output1]", SettingSerializer.Serialize(setting)); }
public void StartAt_Verify() { var settingWrong1 = new StartAt(0); var settingWrong2 = new StartAt(-1); var setting = new StartAt(120); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-ss 00:02:00.0"); }
public void FrameDropThreshold_Verify() { var setting1 = new FrameDropThreshold() { Threshold = 0 }; var setting2 = new FrameDropThreshold(0); Assert.Equal("-frame_drop_threshold 0", SettingSerializer.Serialize(setting1)); Assert.Equal("-frame_drop_threshold 0", SettingSerializer.Serialize(setting2)); }