mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-12-14 01:55:45 +00:00
Add missing tests
This commit is contained in:
parent
994121ce70
commit
ef3c3140c4
1 changed files with 48 additions and 0 deletions
|
|
@ -660,6 +660,31 @@ public class ArgumentBuilderTest
|
|||
str);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Builder_BuildString_VideoFilter_Vaapi_Scale4()
|
||||
{
|
||||
var str = FFMpegArguments
|
||||
.FromFileInput("input.mp4")
|
||||
.OutputToFile("output.mp4", false, opt => opt
|
||||
.WithVideoFilters(filterOptions => filterOptions
|
||||
.Format("nv12", "vaapi")
|
||||
.HardwareUpload()
|
||||
.WithVaapiVideoFilter(options => options
|
||||
.Scale(VideoSize.Original)
|
||||
)
|
||||
)
|
||||
.WithVaapiRcMode(VaapiRcMode.CQP)
|
||||
.WithH264VaapiOptions(options => options
|
||||
.WithQuantizer(28)
|
||||
)
|
||||
)
|
||||
.Arguments;
|
||||
|
||||
Assert.AreEqual(
|
||||
"-i \"input.mp4\" -vf \"format=pix_fmts=nv12|vaapi, hwupload\" -rc_mode CQP -qp 28 \"output.mp4\"",
|
||||
str);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Builder_BuildString_Single_Image()
|
||||
{
|
||||
|
|
@ -703,6 +728,29 @@ public class ArgumentBuilderTest
|
|||
str);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Builder_BuildString_Segments_WUseWallclockTimestamps()
|
||||
{
|
||||
var str = FFMpegArguments
|
||||
.FromFileInput("input.mp4")
|
||||
.OutputToFile("output-%Y%m%d-%s.mp4", false, opt => opt
|
||||
.WithUseWallclockAsTimestamps(false)
|
||||
.ForceFormat("segment")
|
||||
.WithSegmentOptions(options => options
|
||||
.WithSegmentAtClocktime()
|
||||
.WithSegmentTime(TimeSpan.FromMinutes(10))
|
||||
.WithMinimumSegmentDuration(TimeSpan.FromMinutes(5))
|
||||
.WithResetTimestamps()
|
||||
.WithStrftime()
|
||||
)
|
||||
)
|
||||
.Arguments;
|
||||
|
||||
Assert.AreEqual(
|
||||
"-i \"input.mp4\" -use_wallclock_as_timestamps 0 -f segment -segment_atclocktime 1 -segment_time 600 -min_seg_duration 300 -reset_timestamps 1 -strftime 1 \"output-%Y%m%d-%s.mp4\"",
|
||||
str);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Builder_BuildString_Rtsp_Stream()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue