MediaSDK
MediaSDK copied to clipboard
ffmpeg QSV internal resolution and colorspace problems
Hi, i tryed many times encode with Intel QSV in ffmpeg, this vídeo resolutions 1920x1080 > 1920x1088, 1440x1080 > 1440x1088 those are fine for my HDTV no erros, but when i tryed 1280x720 ffmpeg come with internal resolution 1280x736, when i try to play the vídeo on my TV it show a green bar because ffmpeg internal resolution not 1280x720 coded internal size but 1280x736, here are my encoding options
ffmpeg -v verboe -hide_banner -hwaccel qsv -c:v h264_qsv -i Source.264 -c:v hevc_qsv -load_plugin hevc_sw -profile:v main -preset:v veryslow -g 240 -refs:v 6 -bf:v 3 -color_primaries bt709 -color_trc bt709 -colorspace bt709 -bsf:v hevc_metadata=colour_primaries=1:transfer_characteristics=1:matrix_coefficients=1 -gpb 0 -vf "scale_qsv=1280:720" Destination.hevc
Another problem im facing are colorspace converter from any 8bit to 10bit P010le, those are working fime on sample_multi_transcode
ffmpeg -v verbose -hide_banner -c:v h264_qsv -i Source.264 -c:v hevc_qsv -pix_fmt p010le -load_plugin hevc_sw -profile:v main10 -preset:v veryslow -g 240 -refs:v 6 -bf:v 3 -gpb 0 Destination.hevc
Can someone here send this bug to ffmpeg developers? I tryed already but they dont care Simple ffmpeg dont set internal resolution correctly like sample_multi_transcode or sample_encode and the colorspace converter dont work at all from any 8bit to 10bit P010le
Regards
thx4ever
Can someone here send this bug to ffmpeg developers? I tryed already but they dont care
How you ping ffmpeg developers, please share me the link.
ffmpeg internal resolution not 1280x720 coded internal size but 1280x736, here are my encoding options
Please try to apply this patch and report me it help or not.
diff --git a/libavfilter/vf_scale_qsv.c b/libavfilter/vf_scale_qsv.c
index 499534e..3cc05b6 100644
--- a/libavfilter/vf_scale_qsv.c
+++ b/libavfilter/vf_scale_qsv.c
@@ -201,8 +201,8 @@ static int init_out_pool(AVFilterContext *ctx,
out_frames_hwctx = out_frames_ctx->hwctx;
out_frames_ctx->format = AV_PIX_FMT_QSV;
- out_frames_ctx->width = FFALIGN(out_width, 32);
- out_frames_ctx->height = FFALIGN(out_height, 32);
+ out_frames_ctx->width = FFALIGN(out_width, 16);
+ out_frames_ctx->height = FFALIGN(out_height, 16);
out_frames_ctx->sw_format = out_format;
out_frames_ctx->initial_pool_size = 4;
@thx4ever , could you answer?
Sorry for late response, i tryed with this patch and it works, only problem now that vpp_qsv dont convert colorspace from 8 bit to 10bit p010le
@thx4ever is it still actual?
For me this patch does not solve problem.
I try to scale from 4K to FullHD: -hwaccel qsv -c:v vp9_qsv -i INPUT -vf scale_qsv=1920:1080 -c:v h264_qsv -b:v 6000k -profile:v high OUTPUT
I solve green bar problem when did not use hw qsv decoder: -init_hw_device qsv=hw -filter_hw_device hw -i INPUT -vf hwupload=extra_hw_frames=64,format=qsv,scale_qsv=1920:1080 -c:v h264_qsv -b:v 6000k -profile:v high OUTPUT
What happen again this patch already applied to ffmpeg but the problem continues, if i add those commands to ffmpeg -vf scale=1280:720 or -vf scale_qsv=1280:720 final video are coded 1280x736, can someone take a look on this problem?
The final video on my tv show a green horizontal bar