#11298(undetermined:new): AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Type: defect Status: new | Priority: normal Component: | Version: git- undetermined | master Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Summary of the bug: I'm trying to encode a 1080p video in hevc_vaapi with and AMD display card, but the resulting video has a 1920x1088 dimension (when played by mpv / ffplay). How to reproduce: I built ffmpeg from latest master (e35587250c3e036261ea9cfc266e74730b6f60ae) to reproduce the bug: {{{ ./configure --disable-debug --disable-static --enable-shared \ --enable-gpl --disable-stripping --enable-libx265 --disable-x86asm }}} The command used is {{{ LD_LIBRARY_PATH='libavcodec:libavdevice:libavfilter:libavformat:libavutil:libpostproc:libswresample:libswscale' \ ./ffmpeg -hwaccel vaapi -hwaccel_output_format vaapi -i a.mkv \ -acodec copy -vcodec hevc_vaapi -rc_mode CQP -qp 36 a.mp4 }}} mpv outputs {{{ ● Video --vid=1 (hevc 1920x1080 60 fps) [default] ● Audio --aid=1 (aac 2ch 48000 Hz 160 kbps) [default] Using hardware decoding (vaapi). AO: [pipewire] 48000Hz stereo 2ch floatp VO: [gpu-next] 1920x1088 vaapi[nv12] AV: 00:00:01 / 00:00:03 (43%) A-V: 0.000 }}} Despite mpv / ffprobe / ffplay says the video stream is 1920x1080, it plays at 1920x1088. Actually I was doing screen recording with obs-studio and got this bug since at least ffmpeg 7.0.1. There was a patch (https://patchwork.ffmpeg.org/project/ffmpeg/patch/20240321170219.1487-1-Prim...) fixed this for 7.0.x but it no longer applies to 7.1. I'm using an AMD Radeon RX 6650 XT display card and so my only options are HEVC and AVC. This is not reproducible on Intel cards. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by lilydjwg): * Attachment "ffmpeg.log" added. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Changes (by schigi): * cc: schigi (added) -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:1> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Balling): "1920x1088" is what all 1920x1080 videos are. The coded heaight for all 1920x1080 videos in the wild is 1920x1088 -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:2> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Jhon): Happening to me when downscaling a 1440 video to 1080. Any output video has a green line at the bottom for those 8 extra px. I am running a .sh script that looks like this: {{{ ffmpeg \ -hwaccel_output_format vappi \ -vaapi_device /dev/dri/renderD128 \ -i input.mp4 \ -vf 'format=nv12,hwupload,scale_vaapi=-1:1080' \ -map 0:0 \ -c:v hevc_vaapi \ -map 0:a \ -c:a copy \ -rc_mode CQP \ -global_quality 25 \ -profile:v main \ -v verbose output.mkv }}} Using version 7.0.2-3ubuntu1 -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:3> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Timo R.): That must basically mean that AMDs bitstream generator fails to include the cropping info, to get 1088 back to 1080 on playback. Or our wrapper passed the wrong height to it at some point. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:4> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
That must basically mean that AMDs bitstream generator fails to include
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by James): Replying to [comment:4 Timo R.]: the cropping info, to get 1088 back to 1080 on playback.
Or our wrapper passed the wrong height to it at some point.
I think the relevant change that fixes this is in 7.1, possibly commit bcfbf2bac8f9eeeedc407b40596f5c7aaa0d5b47. The vaapi hevc encoder should code the cropping information within the bitstream and not rely on container cropping like av1. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:5> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Jhon): Replying to [comment:5 James]:
Replying to [comment:4 Timo R.]:
That must basically mean that AMDs bitstream generator fails to include the cropping info, to get 1088 back to 1080 on playback. Or our wrapper passed the wrong height to it at some point.
I think the relevant change that fixes this is in 7.1, possibly commit bcfbf2bac8f9eeeedc407b40596f5c7aaa0d5b47. The vaapi hevc encoder should code the cropping information within the bitstream and not rely on container cropping like av1. I just updated and its still happening in 7.1.1-1ubuntu1
If it helps to narrow the issue down, VLC plays it with no visible green line (before and now), but other players like Haruna (and the thumbnail in Dolphin file explorer) are showing the green line. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:6> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Balling): Was not there a patch to fix cropping for amd encoder?
HEVC encoding a 1080p video results in a 1920x1088 one
It always results in 1088 even on nvidia, there is just metadata that signals that last 8 lines are fake and should be removed. -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:7> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
#11298: AMD VAAPI HEVC encoding a 1080p video results in a 1920x1088 one -------------------------------------+------------------------------------- Reporter: lilydjwg | Owner: (none) Type: defect | Status: new Priority: normal | Component: | undetermined Version: git-master | Resolution: Keywords: | Blocked By: Blocking: | Reproduced by developer: 0 Analyzed by developer: 0 | -------------------------------------+------------------------------------- Comment (by Jhon): Just found this ticket, where someone comments the patch could not be applied to 7.1 https://fftrac-bg.ffmpeg.org/ticket/8506 -- Ticket URL: <https://trac.ffmpeg.org/ticket/11298#comment:8> FFmpeg <https://ffmpeg.org> FFmpeg issue tracker
participants (1)
-
FFmpeg