#8506(avcodec:new): H.265 VA-API encoder changes video size on AMD cards
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+---------------------------------- Reporter: tildearrow | Type: defect Status: new | Priority: normal Component: avcodec | Version: 4.2 Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+---------------------------------- Description: The H.265 VA-API encoder on an AMD card rounds the video size to a multiple of 16. As an example, a 1920x1080 video will be resized to 1920x1088. While the specs require the internal video size to be a multiple of 16, there is another "visible" video size which can be set arbitrarily (and hence allow for the 1920x1080 size). However, the AMD VA-API driver seems to be setting the "visible" size to the same value as the internal size. Therefore the size is wrong. Steps to Reproduce: 1. {{{ sudo env LIBVA_DRIVER_NAME=radeonsi ffmpeg -vaapi_device /dev/dri/card1 -f lavfi -i color=color=black:size=1920x1080 -t 0.04 -vf 'format=nv12,hwupload' -c:v hevc_vaapi -qp 24 -y 1088.ts }}} This will generate a 1-frame video that apparently has a frame size of 1920x1080. 2. {{{ $ ffprobe -i 1088.ts }}} This will check that the video really has a frame size of 1920x1080. -Expected Result- {{{ ffprobe version n4.2.2 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 9.2.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable- stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable- libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable- libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable- nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [mpegts @ 0x55aed1cd4c00] Format mpegts detected only with low score of 2, misdetection possible! Input #0, mpegts, from '1088.ts': Duration: 00:00:00.00, start: 1.400000, bitrate: 957090 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 1920x1080, 90k tbr, 90k tbn, 90k tbc }}} (look at 1920x1080) -Actual (Defective) Result- {{{ ffprobe version n4.2.2 Copyright (c) 2007-2019 the FFmpeg developers built with gcc 9.2.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable- stripping --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable- libpulse --enable-libsoxr --enable-libspeex --enable-libssh --enable- libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-nvdec --enable- nvenc --enable-omx --enable-shared --enable-version3 libavutil 56. 31.100 / 56. 31.100 libavcodec 58. 54.100 / 58. 54.100 libavformat 58. 29.100 / 58. 29.100 libavdevice 58. 8.100 / 58. 8.100 libavfilter 7. 57.100 / 7. 57.100 libswscale 5. 5.100 / 5. 5.100 libswresample 3. 5.100 / 3. 5.100 libpostproc 55. 5.100 / 55. 5.100 [mpegts @ 0x55aed1cd4c00] Format mpegts detected only with low score of 2, misdetection possible! Input #0, mpegts, from '1088.ts': Duration: 00:00:00.00, start: 1.400000, bitrate: 957090 kb/s Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: hevc (Main) (HEVC / 0x43564548), yuv420p(tv), 1920x1088, 90k tbr, 90k tbn, 90k tbc }}} As you can see, the video has been resize to 1920x1088. This should not happen. Additional information: FFmpeg 4.2.2. Arch Linux. Radeon Vega FE. Mesa 19.3.3. Linux linux 5.4.10-rt5-1-rt #1 SMP PREEMPT_RT @1578738969 x86_64 GNU/Linux. -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+----------------------------------- Reporter: tildearrow | Owner: Type: defect | Status: new Priority: normal | Component: avcodec Version: 4.2 | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by tildearrow): * Attachment "ffmpeg-20200201-151319.log" added. Report -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards -------------------------------------+----------------------------------- Reporter: tildearrow | Owner: Type: defect | Status: new Priority: normal | Component: avcodec Version: unspecified | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+----------------------------------- Changes (by cehoyos): * version: 4.2 => unspecified Comment: Is this issue reproducible with current FFmpeg git head, the only version supported here? -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+----------------------------------- Reporter: tildearrow | Owner: Type: defect | Status: new Priority: normal | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by tildearrow): * version: unspecified => git-master Comment: Replying to [comment:1 cehoyos]:
Is this issue reproducible with current FFmpeg git head, the only version supported here?
Reproduces on master head too (d85c84eb38e5845495dacfcef82265a433fdd043 as of now). -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+----------------------------------- Reporter: tildearrow | Owner: Type: defect | Status: new Priority: normal | Component: avcodec Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by tildearrow): * Attachment "ffmpeg-20200201-213631.log" added. Report with git version -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+----------------------------------- Reporter: tildearrow | Owner: Type: defect | Status: new Priority: normal | Component: avcodec Version: git-master | Resolution: Keywords: amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Changes (by cehoyos): * keywords: => amf -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+----------------------------------- Reporter: tildearrow | Owner: Type: defect | Status: new Priority: normal | Component: avcodec Version: git-master | Resolution: Keywords: amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Comment (by fulinjie): Cannot be reproduced with iHD driver. Since pic_width_in_luma_samples and pic_height_in_luma_samples are set in FFmpeg level, I tried with iHD driver, however it could not be reproduced. Doubt whether conformance_window_flag and conf_win_bottom_offset are set correctly in your case. -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#8506: H.265 VA-API encoder changes video size on AMD cards ------------------------------------+----------------------------------- Reporter: tildearrow | Owner: (none) Type: defect | Status: new Priority: normal | Component: avcodec Version: git-master | Resolution: Keywords: amf | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | ------------------------------------+----------------------------------- Comment (by lilydjwg): Hi, this issue appeared again half a year ago. This patch (https://patchwork.ffmpeg.org/project/ffmpeg/patch/20240321170219.1487-1-Prim...) fixed it but it could no longer apply on ffmpeg 7.1. This happens to AMD cards only, iHD is unaffected. But I have an AMD card without AV1 support, so the only options for me is H265 or H264 (the latter takes a lot more space). -- Ticket URL: <https://trac.ffmpeg.org/ticket/8506#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg