Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
parent
f0e25cb1e9
commit
cb232be687
2 changed files with 2 additions and 2 deletions
|
@ -18,7 +18,7 @@ func (o Options) VideoFilter(format PixelFormat) string {
|
|||
if format == "" {
|
||||
return fmt.Sprintf("scale='if(gte(iw,ih), min(%d, iw), -2):if(gte(iw,ih), -2, min(%d, ih))'", o.Size, o.Size)
|
||||
} else if format == FormatQSV {
|
||||
return fmt.Sprintf("vpp_qsv=framerate=30,scale_qsv=w='if(gte(iw,ih), min(%d, iw), -1)':h='if(gte(iw,ih), -1, min(%d, ih))'", o.Size, o.Size)
|
||||
return fmt.Sprintf("scale_qsv=w='if(gte(iw,ih), min(%d, iw), -1)':h='if(gte(iw,ih), -1, min(%d, ih))'", o.Size, o.Size)
|
||||
} else {
|
||||
return fmt.Sprintf("scale='if(gte(iw,ih), min(%d, iw), -2):if(gte(iw,ih), -2, min(%d, ih))',format=%s", o.Size, o.Size, format)
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ func TestAvcConvertCommand(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
assert.Equal(t, "/usr/bin/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD128 -i VID123.mov -c:a aac -vf vpp_qsv=framerate=30,scale_qsv=w='if(gte(iw,ih), min(1500, iw), -1)':h='if(gte(iw,ih), -1, min(1500, ih))' -c:v h264_qsv -map 0:v:0 -map 0:a:0? -r 30 -b:v 50 -bitrate 50 -f mp4 -movflags +faststart -y VID123.mov.avc", r.String())
|
||||
assert.Equal(t, "/usr/bin/ffmpeg -hwaccel qsv -hwaccel_output_format qsv -qsv_device /dev/dri/renderD128 -i VID123.mov -c:a aac -vf scale_qsv=w='if(gte(iw,ih), min(1500, iw), -1)':h='if(gte(iw,ih), -1, min(1500, ih))' -c:v h264_qsv -map 0:v:0 -map 0:a:0? -r 30 -b:v 50 -bitrate 50 -f mp4 -movflags +faststart -y VID123.mov.avc", r.String())
|
||||
})
|
||||
t.Run("h264_videotoolbox", func(t *testing.T) {
|
||||
Options := Options{
|
||||
|
|
Loading…
Reference in a new issue