mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Add apple encoder and fix extra_hw_frames bug (#4986)
* Fixes format in full hw encoding to nv12 for cuda, vaapi and qsv now * Remove extra_hw_frames * Add apple transcoder support * Up the duration to discover decoding errors * yuv420p is not supported on intel --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
75
pkg/ffmpeg/ffmpeg_test.go
Normal file
75
pkg/ffmpeg/ffmpeg_test.go
Normal file
@@ -0,0 +1,75 @@
|
||||
// Package ffmpeg provides a wrapper around the ffmpeg and ffprobe executables.
|
||||
package ffmpeg
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFFMpegVersion_GreaterThan(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
this FFMpegVersion
|
||||
other FFMpegVersion
|
||||
want bool
|
||||
}{
|
||||
{
|
||||
"major greater, minor equal, patch equal",
|
||||
FFMpegVersion{2, 0, 0},
|
||||
FFMpegVersion{1, 0, 0},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"major greater, minor less, patch less",
|
||||
FFMpegVersion{2, 1, 1},
|
||||
FFMpegVersion{1, 0, 0},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"major equal, minor greater, patch equal",
|
||||
FFMpegVersion{1, 1, 0},
|
||||
FFMpegVersion{1, 0, 0},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"major equal, minor equal, patch greater",
|
||||
FFMpegVersion{1, 0, 1},
|
||||
FFMpegVersion{1, 0, 0},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"major equal, minor equal, patch equal",
|
||||
FFMpegVersion{1, 0, 0},
|
||||
FFMpegVersion{1, 0, 0},
|
||||
true,
|
||||
},
|
||||
{
|
||||
"major less, minor equal, patch equal",
|
||||
FFMpegVersion{1, 0, 0},
|
||||
FFMpegVersion{2, 0, 0},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"major equal, minor less, patch equal",
|
||||
FFMpegVersion{1, 0, 0},
|
||||
FFMpegVersion{1, 1, 0},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"major equal, minor equal, patch less",
|
||||
FFMpegVersion{1, 0, 0},
|
||||
FFMpegVersion{1, 0, 1},
|
||||
false,
|
||||
},
|
||||
{
|
||||
"major less, minor less, patch less",
|
||||
FFMpegVersion{1, 0, 0},
|
||||
FFMpegVersion{2, 1, 1},
|
||||
false,
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
if got := tt.this.Gteq(tt.other); got != tt.want {
|
||||
t.Errorf("FFMpegVersion.GreaterThan() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user