mirror of https://github.com/ErsatzTV/ErsatzTV.git
Browse Source
* try to workaround amd crop metadata ffmpeg bug * limit workaround to hevc_vaapi encoder * update changelogpull/2683/head
3 changed files with 44 additions and 0 deletions
@ -0,0 +1,34 @@ |
|||||||
|
using ErsatzTV.FFmpeg.Format; |
||||||
|
|
||||||
|
namespace ErsatzTV.FFmpeg.OutputOption; |
||||||
|
|
||||||
|
public class AmdCropMetadataWorkaroundFilter(string videoFormat, FrameSize frameSize) : OutputOption |
||||||
|
{ |
||||||
|
public override string[] OutputOptions |
||||||
|
{ |
||||||
|
get |
||||||
|
{ |
||||||
|
if (videoFormat is not VideoFormat.Hevc) |
||||||
|
{ |
||||||
|
return []; |
||||||
|
} |
||||||
|
|
||||||
|
int cropPixels = frameSize.Height switch |
||||||
|
{ |
||||||
|
1080 => 8, |
||||||
|
_ => 0 |
||||||
|
}; |
||||||
|
|
||||||
|
if (cropPixels == 0) |
||||||
|
{ |
||||||
|
return []; |
||||||
|
} |
||||||
|
|
||||||
|
return |
||||||
|
[ |
||||||
|
"-bsf:v", |
||||||
|
$"{videoFormat}_metadata=crop_bottom={cropPixels}" |
||||||
|
]; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue