Fix hw transcoding not detecting filtering errors (#4934)

This commit is contained in:
NodudeWasTaken
2024-06-06 03:58:19 +02:00
committed by GitHub
parent 0a07194110
commit 124ea609fe
3 changed files with 8 additions and 4 deletions

View File

@@ -82,7 +82,11 @@ func (f *FFMpeg) InitHWSupport(ctx context.Context) {
f.hwCodecSupport = hwCodecSupport
}
func (f *FFMpeg) hwCanFullHWTranscode(ctx context.Context, vf *models.VideoFile, codec VideoCodec) bool {
func (f *FFMpeg) hwCanFullHWTranscode(ctx context.Context, codec VideoCodec, vf *models.VideoFile, reqHeight int) bool {
if codec == VideoCodecCopy {
return false
}
var args Args
args = append(args, "-hide_banner")
args = args.LogLevel(LogLevelWarning)
@@ -91,7 +95,7 @@ func (f *FFMpeg) hwCanFullHWTranscode(ctx context.Context, vf *models.VideoFile,
args = args.Input(vf.Path)
args = args.Duration(0.1)
videoFilter := f.hwMaxResFilter(codec, vf.Width, vf.Height, minHeight, true)
videoFilter := f.hwMaxResFilter(codec, vf.Width, vf.Height, reqHeight, true)
args = append(args, CodecInit(codec)...)
args = args.VideoFilter(videoFilter)