Opened 13 months ago

Last modified 10 months ago

#10266 new defect

Issues when using av1_amf to encode a video

Reported by: j.zwayn Owned by:
Priority: normal Component: undetermined
Version: 5.1.2 Keywords: av1 amf encoder
Cc: j.zwayn Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:

Video is fullHD (1920x1080). We want to encode the video using av1_amf.
the card used is: AMD Radeon RX 7900 XT, Driver: 31.0.14000.62003
AMF version: AMF 1.4.29
ffmpeg: 2d202985b79630cd5056c4e32f8f77f22bf1067c

The resulting file do not have the right format: 1920x1080 as input and it output 1920x1082

How to reproduce:

% ffmpeg.exe -y -i input.mkv -b:v 5M -c:v av1_amf output.mkv 
ffmpeg version N-109535-gfcd557a2c2
built with gcc 10-win32 (GCC) 20210110

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Attachments (2)

elden_ring_av1_5mb_cut2500kb.mkv (2.4 MB ) - added by jdek 13 months ago.
vlc.log (39.9 KB ) - added by jdek 13 months ago.

Change History (5)

comment:1 by Balling, 13 months ago

The resulting file do not have the right format: 1920x1080 as input and it output 1920x1082

Why are sure AMD can encode 1080 pixels? Nvidia cannot.

Last edited 13 months ago by Balling (previous) (diff)

by jdek, 13 months ago

Attachment: vlc.log added

comment:2 by jdek, 13 months ago

Added sample for av1 amf.

VLC says 1152/1082, ffprobe says 1082, mediainfo specifies 1080/1082.

ffprobe:

$ ffprobe elden_ring_av1_5mb.mkv
ffprobe version 4.3.5-0+deb11u1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
[libdav1d @ 0x55e7f78f1b00] libdav1d 0.7.1
Input #0, matroska,webm, from 'elden_ring_av1_5mb.mkv':
  Metadata:
    SOFTWARE        : Lavf57.56.101
    ENCODER         : Lavf59.36.100
  Duration: 00:00:20.00, start: 0.000000, bitrate: 5013 kb/s
    Stream #0:0: Video: av1 (Main), yuv420p(tv, bt709, progressive), 1920x1082, 60 fps, 60 tbr, 1k tbn, 1k tbc
    Metadata:
      ENCODER         : Lavc59.56.100 av1_amf
      DURATION        : 00:00:20.000000000
[libdav1d @ 0x55e7f78f5bc0] libdav1d 0.7.1

Mediainfo:

$ mediainfo elden_ring_av1_5mb.mkv
General
Unique ID                                : 261833798229551093745524176964670436669 (0xC4FB5AF16BCDED45DDDBE2DEA3C3B53D)
Complete name                            : elden_ring_av1_5mb.mkv
Format                                   : Matroska
Format version                           : Version 4
File size                                : 12.0 MiB
Duration                                 : 20 s 0 ms
Overall bit rate                         : 5 013 kb/s
Writing application                      : Lavf59.36.100
Writing library                          : Lavf59.36.100
ErrorDetectionType                       : Per level 1
SOFTWARE                                 : Lavf57.56.101

Video
ID                                       : 1
Format                                   : AV1
Format/Info                              : AOMedia Video 1
Format profile                           : Main@L5.2
Codec ID                                 : V_AV1
Duration                                 : 20 s 0 ms
Bit rate                                 : 4 914 kb/s
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Original height                          : 1 082 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 60.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.039
Stream size                              : 11.7 MiB (98%)
Writing library                          : Lavc59.56.100 av1_amf
Default                                  : No
Forced                                   : No
Color range                              : Limited

comment:3 by nyanmisaka, 10 months ago

https://gitlab.freedesktop.org/mesa/mesa/-/issues/9185#note_1954937

There is the same issue on Linux with the in developing av1_vaapi encoder. Unfortunately AMD developers said this is a hardware limitation in VCN 4.0 and will be resolved in the next generation.

Note: See TracTickets for help on using tickets.