Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: bgr0 -> nv12 conversion looks bad #529

Open
markg85 opened this issue Jan 28, 2025 · 21 comments
Open

[Bug]: bgr0 -> nv12 conversion looks bad #529

markg85 opened this issue Jan 28, 2025 · 21 comments
Labels

Comments

@markg85
Copy link

markg85 commented Jan 28, 2025

Describe the bug
Linux desktop streaming. I'm using x11grab which is a pixel format of bgr0.
AMF has a mapping for that: AV_PIX_FMT_BGR0 maps to AMF_SURFACE_BGRA

To be fair, it's just a mapping. It's not wired up to HEVC. So i did add that one myself. In amfenc.c i just added AV_PIX_FMT_BGR0 in the ff_amf_pix_fmts array.

Compiling ffmpeg with this makes it work and lets bgr0 be handled by AMF. Sweet! The more that can be offloaded to AMF in the encoding pipeline the better it is for latency purposes.

The following table shows the conversion as i think they happen. I do have to put a big fat disclaimer here. I'm assuming the cpu does a pix format conversion when pix_format is supplied and that it does that conversion to a format the driver (hevc_amf) supports. I'm also assuming that no cpu conversion happens when pix_format is not supplied.

Also note that no pix format in the table means i didn't supply pix_format as argument thus it's the source format. Which is bgr0.

pix_format CPU conversion AMF conversion Picture
none none bgr0 -> nv12 Image
nv12 bgr0 -> nv12 none Image
p010 bgr0 -> p010 p010 -> nv12 Image

By far the best one in that table is that last one, p010. The color representation is good and 10 bit (irrelevant for this issue) means less banding too, which you can see in the grey gradient behind the AMD logo if you look carefully!

You can easily see that the first row looks very off. In theory this would be the best one as AMF would do all the work.
In practice it looks like the AMF conversion from bgr0 -> nv12 is not doing the same as the cpu based one when nv12 is provided as pix_format.

At this point i'm not entirely convinced the issue is in ffmpeg (x11grab specifically) or in AMF. To try and rule out x11grab, i did modify it's code to output BGRA instead of BGR0 but the results were the same.

Is this a hardware bug?

Setup (please complete the following information):

  • OS: ArchLinux
  • Driver Version 1.4.35 + latest header changes from this repo
  • GPU 7900 XT
@markg85 markg85 added the bug label Jan 28, 2025
@MikhailAMD
Copy link
Collaborator

Few things:

  1. Instead of adding BGR0 to AMF encoder's list of input formats, with the latest patches you can use amf context and hwupload:
    -vf 'hwupload'. With that encoder input will be AV_PIX_FMT_AMF_SURFACE. You will also need "-hwaccel amf"
  2. Most of AMD VCN encoders like your 7900 XT support BGRA(0,A)/RGB(0,A) etc. directly, meaning that color conversion happens inside VCN. If used, it will improve performance.
  3. If VCN doesn't support HW conversion, it will be done by AMF color converter using Compute. Can be internal converter inside AMF encoder or new vpp_amf filter. New filter also can do scaling.
    -vf vpp_amf=1920:1080:format=rgba (or bgra or nv2 etc)
  4. AMF color converter doesn't yet support proper conversion between 8 and 10 bit YUVs (NV12 <-> P010). It is coming.
  5. But if you want 10-bit, you can submit to encoder R8G8B8A8, B8G8R8A8 or R10G10B10A2 or RGBA_F16 or P010 and configure encoder to HEVC 10-bit or AV1 10-bit.

@markg85
Copy link
Author

markg85 commented Jan 28, 2025

  1. Instead of adding BGR0 to AMF encoder's list of input formats, with the latest patches you can use amf context and hwupload:
    -vf 'hwupload'. With that encoder input will be AV_PIX_FMT_AMF_SURFACE. You will also need "-hwaccel amf"
  2. Most of AMD VCN encoders like your 7900 XT support BGRA(0,A)/RGB(0,A) etc. directly, meaning that color conversion happens inside VCN. If used, it will improve performance.

My command is getting "a little" complicated...

export LD_LIBRARY_PATH=/home/mark/pkgbuilds/ffmpeg/upstream/build/lib
./ffmpeg -hwaccel amf -hwaccel_device /dev/dri/renderD128 -init_hw_device amf=/dev/dri/renderD128 \
    -f x11grab -framerate 60 -max_delay 0 -max_probe_packets 1 -thread_queue_size 1024 -video_size 2560x1440 -r 60 -i :0.0+0,0 \
    -vf 'hwupload' \
    -c:v hevc_amf \
    -log_to_dbg 1 \
    -usage lowlatency \
    -rc vbr_peak \
    -minrate 2M \
    -maxrate 15M \
    -quality quality \
    -preset quality \
    -vbaq 0 -enforce_hrd 0 -aud 0 -latency 1 -filler_data 0  \
    -profile:v main10 \
    -profile_tier high \
    -b:v 8M \
    -f nut -muxdelay 0 udp://10.0.3.55:5555

It took some fiddling to get that hwupload to work. Turns out the init_hw_device is required for that. At least in the case of AMF. I did undo my changes to both x11grab and amf, it's now the same as your patches + upstream.

Some logging that might be helpful:

[graph -1 input from stream 0:0 @ 0x7ed8580045c0] w:2560 h:1440 pixfmt:bgr0 tb:1/60 fr:60/1 sar:0/1 csp:unknown range:unknown
[format @ 0x7ed858004c40] Setting 'pix_fmts' to value 'nv12|yuv420p|p010le|amf'
[format @ 0x7ed858004c40] Setting 'color_ranges' to value 'tv|pc'
[AVFilterGraph @ 0x7ed858001000] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[hwupload @ 0x7ed858004240] Surface format is bgr0.
[graph -1 input from stream 0:0 @ 0x7ed8580045c0] video frame properties congruent with link at pts_time: 0
[vost#0:0/hevc_amf @ 0x5ddca8233980] [enc:hevc_amf @ 0x5ddca8233e80] Using input frames context (format amf) with hevc_amf encoder.

I don't see any message from ffmpeg that it's converting formats so i assume it's passed on to AMF (or VCN).
Unfortunately, the color result is exactly the same as previously (the wrong washed out colors). Is there anything i'm doing wrong in my parameters?

@MikhailAMD
Copy link
Collaborator

try to use -color_range full
Do you see incorrect colors or washed-out text?
Can you share the original image to compare?

@markg85
Copy link
Author

markg85 commented Jan 28, 2025

With hwupload and color_range full:

Image

And this is how i expect it to be (provided pix_format p010 and removed hwupload)

Image

@MikhailAMD
Copy link
Collaborator

If you pass pix_fmt P010 to AMF HEVC encoder, it will initialize with HEVC 10-bit instead of default 8-bit. Yes, colors will be better.
I guess, FFmpeg AMF encoder code can be improved to force RGBA input + 10-bit explicitly to use internal conversion. I will ask for a patch.

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

If you pass pix_fmt P010 to AMF HEVC encoder, it will initialize with HEVC 10-bit instead of default 8-bit. Yes, colors will be better. I guess, FFmpeg AMF encoder code can be improved to force RGBA input + 10-bit explicitly to use internal conversion. I will ask for a patch.

I'm doubtful if that will work.
These two images from my last post, both had 10 bit. You can see it in the gradient behind the AMD logo, essentially no banding. So i'm quite sure the encoder already does 10 bit internally. What i'm guessing is the A channel in RGBA (or BGR0) to be interpreted a little differently in the hardware path. Can you confirm if that's the case?

@MikhailAMD
Copy link
Collaborator

Two different issues:

  1. Encoder bit-ness: currently the code is this:
    color_depth = AMF_COLOR_BIT_DEPTH_8;
    pix_fmt = avctx->hw_frames_ctx ? ((AVHWFramesContext*)avctx->hw_frames_ctx->data)->sw_format
    : avctx->pix_fmt;
    if (pix_fmt == AV_PIX_FMT_P010) {
    color_depth = AMF_COLOR_BIT_DEPTH_10;
    }
    AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH, color_depth);
    Unless pix_fmt == AV_PIX_FMT_P010, HEVC will be 8-bit.

  2. Bit-ness and format of captured images:
    Unless you enable HDR for display, the captured image is RGBA8 (RGB0). There are two options you tried:
    AMF conversion: RGBA8->NV12->HEVC-8
    FFmpeg conversion RGBA8->P010->HEVC-10
    I assume you stream to another computer and check colors on the client. Bit-ness give different results in colors.

If you want to check bit-ness of your output for these two cases, just write few frames to a file: -frames 100 -f out.mkv. You can also check color_range in the output HEVC stream.

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

Ahh, i see what you mean!
Interesting how banding (the lack thereof in fact) fooled me in this instance.

It indeed has yuv420 as output format when passing bgr0.

I patched ffmpeg, re-added BGR0 to the formats for HEVC and I unconditionally enabled AMF_COLOR_BIT_DEPTH_10. The output now does have 10 bit (yuv420p10le) but it's completely solid green!

@MikhailAMD
Copy link
Collaborator

Well... Something is still wrong. Could be your changes, command line, FFmpeg integration, general AMF, Linux specific things. It would help if you get some simple FFmpeg RGBA input like -mandelbrot filter or similar, make full command line with your parameters writing to a MP4 or MKV file and share the line. Also you can enable detailed FFmpeg log which in turn will enable detailed AMF log - part of these patches and share the log.

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

Ok, will do!
I do have to modify more. Even to get logging. Because.. errr...

❯ cppgrep "log_to_dbg"
libavcodec/amfenc_hevc.c:109:    { "log_to_dbg",     "Enable AMF logging to debug output",   OFFSET(log_to_dbg), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE },
libavcodec/amfenc_h264.c:143:    { "log_to_dbg",     "Enable AMF logging to debug output",   OFFSET(log_to_dbg)    , AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
libavcodec/amfenc.h:64:    int                 log_to_dbg;
libavcodec/amfenc_av1.c:132:    { "log_to_dbg",     "Enable AMF logging to debug output",   OFFSET(log_to_dbg), AV_OPT_TYPE_BOOL,{.i64 = 0 }, 0, 1, VE },

It's not being used 😒 This wasn't the case before. (same for forced_idr, haven't looked at the rest). Am i slowly becoming an AMF dev here? lol

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

Right, nope. This is a little more involved then just enabling one little thing.. We're now in AMF vtable and initialization magic. I'll happily apply a patch if you have one for me that enables log output else this is probably where i draw the line and rather wait for updated patches.

@MikhailAMD
Copy link
Collaborator

We would welcome you as dev :)
log_to_dbg seem obsolete with these patches. Need to remove it.
in these patches AMF logging level is connected to FFmpeg. just add -loglevel debug

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

We would welcome you as dev :)
Hah 😆

That doesn't show me much AMF logging at all..
I know how AMF logging "can" look from before this patch series. It doesn't seem like any of that is in the output.
Do i need to enable something else too?

Here's an output:

./ffmpeg \
    -f x11grab -framerate 60 -max_delay 0 -max_probe_packets 1 -thread_queue_size 1024 -video_size 2560x1440 -r 60 -i :0.0+0,0 \
    -c:v hevc_amf \
    -log_to_dbg 1 \
    -loglevel debug \
    -usage lowlatency \
    -rc vbr_peak \
    -minrate 2M \
    -maxrate 15M \
    -quality quality \
    -preset quality \
    -vbaq 0 -enforce_hrd 0 -aud 0 -latency 1 -filler_data 0  \
    -profile:v main10 \
    -profile_tier high \
    -b:v 8M \
    -pix_fmt bgr0 \
    -f nut -muxdelay 0 udp://10.0.3.55:5555
ffmpeg version N-118369-g959b799c8d Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 14.2.1 (GCC) 20240910
  configuration: --prefix=/home/mark/pkgbuilds/ffmpeg/upstream/build --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
  libavutil      59. 56.100 / 59. 56.100
  libavcodec     61. 31.101 / 61. 31.101
  libavformat    61.  9.106 / 61.  9.106
  libavdevice    61.  4.100 / 61.  4.100
  libavfilter    10.  9.100 / 10.  9.100
  libswscale      8. 13.100 /  8. 13.100
  libswresample   5.  4.100 /  5.  4.100
  libpostproc    58.  4.100 / 58.  4.100
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'x11grab'.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '60'.
Reading option '-max_delay' ... matched as AVOption 'max_delay' with argument '0'.
Reading option '-max_probe_packets' ... matched as AVOption 'max_probe_packets' with argument '1'.
Reading option '-thread_queue_size' ... matched as option 'thread_queue_size' (set the maximum number of queued packets from the demuxer) with argument '1024'.
Reading option '-video_size' ... matched as AVOption 'video_size' with argument '2560x1440'.
Reading option '-r' ... matched as option 'r' (override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)) with argument '60'.
Reading option '-i' ... matched as input url with argument ':0.0+0,0'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'hevc_amf'.
Reading option '-log_to_dbg' ... matched as AVOption 'log_to_dbg' with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-usage' ... matched as AVOption 'usage' with argument 'lowlatency'.
Reading option '-rc' ... matched as AVOption 'rc' with argument 'vbr_peak'.
Reading option '-minrate' ... matched as AVOption 'minrate' with argument '2M'.
Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument '15M'.
Reading option '-quality' ... matched as AVOption 'quality' with argument 'quality'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'quality'.
Reading option '-vbaq' ... matched as AVOption 'vbaq' with argument '0'.
Reading option '-enforce_hrd' ... matched as AVOption 'enforce_hrd' with argument '0'.
Reading option '-aud' ... matched as AVOption 'aud' with argument '0'.
Reading option '-latency' ...Routing option latency to both codec and muxer layer
 matched as AVOption 'latency' with argument '1'.
Reading option '-filler_data' ... matched as AVOption 'filler_data' with argument '0'.
Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument 'main10'.
Reading option '-profile_tier' ... matched as AVOption 'profile_tier' with argument 'high'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '8M'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'bgr0'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'nut'.
Reading option '-muxdelay' ... matched as option 'muxdelay' (set the maximum demux-decode delay) with argument '0'.
Reading option 'udp://10.0.3.55:5555' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url :0.0+0,0.
Applying option f (force container format (auto-detected otherwise)) with argument x11grab.
Applying option thread_queue_size (set the maximum number of queued packets from the demuxer) with argument 1024.
Applying option r (override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)) with argument 60.
Successfully parsed a group of options.
Opening an input file: :0.0+0,0.
[x11grab @ 0x63f2824cae40] Probe buffer size limit of 5000000 bytes reached
[x11grab @ 0x63f2824cae40] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':0.0+0,0':
  Duration: N/A, start: 1738173398.460660, bitrate: 7077888 kb/s
  Stream #0:0, 1, 1/1000000: Video: rawvideo, 1 reference frame (BGR[0] / 0x524742), bgr0, 2560x1440, 0/1, 7077888 kb/s, 60 fps, 1000k tbr, 1000k tbn
Successfully opened the file.
Parsing a group of options: output url udp://10.0.3.55:5555.
Applying option c:v (select encoder/decoder ('copy' to copy stream without reencoding)) with argument hevc_amf.
Applying option profile:v (set profile) with argument main10.
Applying option b:v (video bitrate (please use -b:v)) with argument 8M.
Applying option pix_fmt (set pixel format) with argument bgr0.
Applying option f (force container format (auto-detected otherwise)) with argument nut.
Applying option muxdelay (set the maximum demux-decode delay) with argument 0.
Successfully parsed a group of options.
Opening an output file: udp://10.0.3.55:5555.
[out#0/nut @ 0x63f2824d3e80] No explicit maps, mapping streams automatically...
[vost#0:0/hevc_amf @ 0x63f2824d5740] Created video stream from input stream 0:0
[udp @ 0x63f2824d8cc0] No default whitelist set
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (hevc_amf))
[vost#0:0/hevc_amf @ 0x63f2824d5740] Starting thread...
[vf#0:0 @ 0x63f2824d6280] Starting thread...
[vist#0:0/rawvideo @ 0x63f2824d3bc0] [dec:rawvideo @ 0x63f2824d7a00] Starting thread...
[in#0/x11grab @ 0x63f2824cab80] Starting thread...
Press [q] to stop, [?] for help
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240
detected 32 logical cores
[graph -1 input from stream 0:0 @ 0x751570003f80] w:2560 h:1440 pixfmt:bgr0 tb:1/60 fr:60/1 sar:0/1 csp:unknown range:unknown
[format @ 0x7515700045c0] Setting 'pix_fmts' to value 'bgr0'
[format @ 0x7515700045c0] Setting 'color_ranges' to value 'tv|pc'
[AVFilterGraph @ 0x751570001000] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
[graph -1 input from stream 0:0 @ 0x751570003f80] video frame properties congruent with link at pts_time: 0
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240
    Last message repeated 2 times
[AVHWDeviceContext @ 0x7515700057c0] AMF initialisation succeeded via Vulkan.
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240
0125-00-29 18:56:38 7D7FF6C0 [EncodeQueuePalImpl] Warning: EncodeQueueServicePalImpl::CreateEncodeQueue(): unsupported queue type 4 requested, fallback to queue type 2.
[AVHWDeviceContext @ 0x7515700057c0] EncodeQueuePalImpl: 0125-00-29 18:56:38 7D7FF6C0 [EncodeQueuePalImpl] Warning: EncodeQueueServicePalImpl::CreateEncodeQueue(): unsupported queue type 4 requested, fallback to queue type 2.
Output #0, nut, to 'udp://10.0.3.55:5555':
  Metadata:
    encoder         : Lavf61.9.106
  Stream #0:0, 0, 1/61440: Video: hevc, 1 reference frame (HEVC / 0x43564548), bgr0(pc, gbr/unknown/unknown, progressive), 2560x1440, 0/1, q=2-31, 8000 kb/s, 60 fps, 61440 tbn
    Metadata:
      encoder         : Lavc61.31.101 hevc_amf
[out#0/nut @ 0x63f2824d3e80] Starting thread...
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240
    Last message repeated 25 times
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240rate=  64.9kbits/s speed=0.967x    
    Last message repeated 29 times
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240rate=  54.6kbits/s speed=0.983x    
    Last message repeated 29 times
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240rate=  51.2kbits/s speed=0.989x    
    Last message repeated 29 times
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240rate=  49.6kbits/s speed=0.991x    
    Last message repeated 29 times
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240rate=  48.6kbits/s speed=0.993x    
    Last message repeated 29 times
[rawvideo @ 0x63f2824d7f00] PACKET SIZE: 14745600, STRIDE: 10240rate=  47.9kbits/s speed=0.994x    
    Last message repeated 29 times

As an aside, my ffmpeg is compiled with --disable-debug. Could it be that this logging you're talking about is only there when compiling ffmpeg in debug mode?

@MikhailAMD
Copy link
Collaborator

Compile option doesn't matter. AMF logs from installed SO.
AMF logging is enabled from amf_device_create. There see the check for AMF v1.4.35. It forces trace level to warnings only to avoid the memory corruption you reported before. You may remove this while you don't use PA.

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

Alright, i have output for you. It's a lot... :)

ffmpeg version N-118369-g959b799c8d Copyright (c) 2000-2025 the FFmpeg developers
  built with gcc 14.2.1 (GCC) 20240910
  configuration: --prefix=/home/mark/pkgbuilds/ffmpeg/upstream/build --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-frei0r --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libdvdnav --enable-libdvdread --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgsm --enable-libharfbuzz --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librav1e --enable-librsvg --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpl --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-vapoursynth --enable-version3 --enable-vulkan
  libavutil      59. 56.100 / 59. 56.100
  libavcodec     61. 31.101 / 61. 31.101
  libavformat    61.  9.106 / 61.  9.106
  libavdevice    61.  4.100 / 61.  4.100
  libavfilter    10.  9.100 / 10.  9.100
  libswscale      8. 13.100 /  8. 13.100
  libswresample   5.  4.100 /  5.  4.100
  libpostproc    58.  4.100 / 58.  4.100
Splitting the commandline.
Reading option '-framerate' ... matched as AVOption 'framerate' with argument '60'.
Reading option '-max_delay' ... matched as AVOption 'max_delay' with argument '0'.
Reading option '-max_probe_packets' ... matched as AVOption 'max_probe_packets' with argument '1'.
Reading option '-thread_queue_size' ... matched as option 'thread_queue_size' (set the maximum number of queued packets from the demuxer) with argument '1024'.
Reading option '-video_size' ... matched as AVOption 'video_size' with argument '2560x1440'.
Reading option '-r' ... matched as option 'r' (override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)) with argument '60'.
Reading option '-i' ... matched as input url with argument '/home/mark/Pictures/testpage.png'.
Reading option '-c:v' ... matched as option 'c' (select encoder/decoder ('copy' to copy stream without reencoding)) with argument 'hevc_amf'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-usage' ... matched as AVOption 'usage' with argument 'lowlatency'.
Reading option '-rc' ... matched as AVOption 'rc' with argument 'vbr_peak'.
Reading option '-minrate' ... matched as AVOption 'minrate' with argument '2M'.
Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument '15M'.
Reading option '-quality' ... matched as AVOption 'quality' with argument 'quality'.
Reading option '-preset' ... matched as AVOption 'preset' with argument 'quality'.
Reading option '-vbaq' ... matched as AVOption 'vbaq' with argument '0'.
Reading option '-enforce_hrd' ... matched as AVOption 'enforce_hrd' with argument '0'.
Reading option '-aud' ... matched as AVOption 'aud' with argument '0'.
Reading option '-latency' ...Routing option latency to both codec and muxer layer
 matched as AVOption 'latency' with argument '1'.
Reading option '-filler_data' ... matched as AVOption 'filler_data' with argument '0'.
Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument 'main10'.
Reading option '-profile_tier' ... matched as AVOption 'profile_tier' with argument 'high'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '8M'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'bgr0'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-f' ... matched as option 'f' (force container format (auto-detected otherwise)) with argument 'hevc'.
Reading option 'out.mkv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url /home/mark/Pictures/testpage.png.
Applying option thread_queue_size (set the maximum number of queued packets from the demuxer) with argument 1024.
Applying option r (override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)) with argument 60.
Successfully parsed a group of options.
Opening an input file: /home/mark/Pictures/testpage.png.
[AVFormatContext @ 0x60936f62ffc0] Opening '/home/mark/Pictures/testpage.png' for reading
[file @ 0x60936f5ea540] Setting default whitelist 'file,crypto,data'
[png_pipe @ 0x60936f62ffc0] Format png_pipe probed with size=2048 and score=99
[png_pipe @ 0x60936f62ffc0] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0 nb_streams:1
[png_pipe @ 0x60936f62ffc0] After avformat_find_stream_info() pos: 158930 bytes read:158930 seeks:0 frames:1
Input #0, png_pipe, from '/home/mark/Pictures/testpage.png':
  Duration: N/A, bitrate: N/A
  Stream #0:0, 1, 1/60: Video: png, 1 reference frame, rgba(pc, gbr/unknown/unknown), 2560x1440 [SAR 3780:3780 DAR 16:9], 0/1, 60 fps, 60 tbr, 60 tbn
Successfully opened the file.
Parsing a group of options: output url out.mkv.
Applying option c:v (select encoder/decoder ('copy' to copy stream without reencoding)) with argument hevc_amf.
Applying option profile:v (set profile) with argument main10.
Applying option b:v (video bitrate (please use -b:v)) with argument 8M.
Applying option pix_fmt (set pixel format) with argument bgr0.
Applying option f (force container format (auto-detected otherwise)) with argument hevc.
Successfully parsed a group of options.
Opening an output file: out.mkv.
[out#0/hevc @ 0x60936f638700] No explicit maps, mapping streams automatically...
[vost#0:0/hevc_amf @ 0x60936f632900] Created video stream from input stream 0:0
detected 32 logical cores
[file @ 0x60936f66d380] Setting default whitelist 'file,crypto,data'
Successfully opened the file.
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> hevc (hevc_amf))
[vost#0:0/hevc_amf @ 0x60936f632900] Starting thread...
[vf#0:0 @ 0x60936f633b80] Starting thread...
[vist#0:0/png @ 0x60936f638540] [dec:png @ 0x60936f634500] Starting thread...
[in#0/png_pipe @ 0x60936f62fd00] Starting thread...
Press [q] to stop, [?] for help
[in#0/png_pipe @ 0x60936f62fd00] EOF while reading input
[in#0/png_pipe @ 0x60936f62fd00] Terminating thread with return code 0 (success)
[vist#0:0/png @ 0x60936f638540] [dec:png @ 0x60936f634500] Decoder thread received EOF packet
[vist#0:0/png @ 0x60936f638540] [dec:png @ 0x60936f634500] Decoder returned EOF, finishing
[vist#0:0/png @ 0x60936f638540] [dec:png @ 0x60936f634500] Terminating thread with return code 0 (success)
[graph -1 input from stream 0:0 @ 0x7396c8003f80] w:2560 h:1440 pixfmt:rgba tb:1/60 fr:60/1 sar:3780/3780 csp:gbr range:pc
[format @ 0x7396c80045c0] Setting 'pix_fmts' to value 'bgr0'
[format @ 0x7396c80045c0] Setting 'color_ranges' to value 'tv|pc'
[auto_scale_0 @ 0x7396c8005ec0] w:iw h:ih flags:'' interl:0
[format @ 0x7396c80045c0] auto-inserting filter 'auto_scale_0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x7396c8001000] query_formats: 4 queried, 6 merged, 3 already done, 0 delayed
[auto_scale_0 @ 0x7396c8005ec0] w:2560 h:1440 fmt:rgba csp:gbr range:pc sar:3780/3780 -> w:2560 h:1440 fmt:bgr0 csp:gbr range:pc sar:1/1 flags:0x00000004
[auto_scale_0 @ 0x7396c8005ec0] [framesync @ 0x7396c8005fd0] Selected 1/60 time base
[auto_scale_0 @ 0x7396c8005ec0] [framesync @ 0x7396c8005fd0] Sync level 1
[swscaler @ 0x7396c8e27040] Forcing full internal H chroma due to input having non subsampled chroma
0125-00-29 21:01:09 D700C6C0 [AMFDeviceVulkanImpl]    Info: Version of the Vulkan driver:  2.0.333
[AVHWDeviceContext @ 0x7396c8f96880] AMFDeviceVulkanImpl: 0125-00-29 21:01:09 D700C6C0 [AMFDeviceVulkanImpl]    Info: Version of the Vulkan driver:  2.0.333
0125-00-29 21:01:09 D700C6C0 [AMFDeviceVulkanImpl]    Info: Highest version of the Vulkan API that is supported by the physical device: 1.4.303
[AVHWDeviceContext @ 0x7396c8f96880] AMFDeviceVulkanImpl: 0125-00-29 21:01:09 D700C6C0 [AMFDeviceVulkanImpl]    Info: Highest version of the Vulkan API that is supported by the physical device: 1.4.303
[AVHWDeviceContext @ 0x7396c8f96880] AMF initialisation succeeded via Vulkan.
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreBaseImpl]    Info: AMFEncoderCoreBaseImpl::QueryThroughput - maxThroughputMBPerSec = 0, totalRequiredThroughputMBPerSec = 0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreBaseImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreBaseImpl]    Info: AMFEncoderCoreBaseImpl::QueryThroughput - maxThroughputMBPerSec = 0, totalRequiredThroughputMBPerSec = 0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcUsage:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcUsage:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcFrameSize:2560,1440
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcFrameSize:2560,1440
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFrameRate:60,1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFrameRate:60,1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcProfile:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcProfile:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcTier:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcTier:1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQualityPreset:0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQualityPreset:0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcAspectRatio:1,1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcAspectRatio:1,1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:-1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:-1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcNominalRange:true
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcNominalRange:true
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcColorBitDepth:10
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcColorBitDepth:10
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorTransferChar:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorTransferChar:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorPrimaries:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorPrimaries:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcGOPSPerIDR:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcGOPSPerIDR:1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcDeBlockingFilter:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcDeBlockingFilter:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcRateControlMethod:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcRateControlMethod:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcEnableVBAQ:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcEnableVBAQ:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcEnforceHRD:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcEnforceHRD:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFillerDataEnable:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFillerDataEnable:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcTargetBitrate:8000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcTargetBitrate:8000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcPeakBitrate:12000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcPeakBitrate:12000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcVBVBufferSize:8000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcVBVBufferSize:8000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcPeakBitrate:15000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcPeakBitrate:15000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty LowLatencyInternal:true
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty LowLatencyInternal:true
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQueryTimeout:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQueryTimeout:1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Init(BGRA, 2560, 1440)
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Init(BGRA, 2560, 1440)
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreBaseImpl]    Info: AMFEncoderCoreBaseImpl::QueryThroughput - maxThroughputMBPerSec = 0, totalRequiredThroughputMBPerSec = 0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreBaseImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreBaseImpl]    Info: AMFEncoderCoreBaseImpl::QueryThroughput - maxThroughputMBPerSec = 0, totalRequiredThroughputMBPerSec = 0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcUsage:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcUsage:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcAspectRatio:1,1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcAspectRatio:1,1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcColorBitDepth:10
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcColorBitDepth:10
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcDeBlockingFilter:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcDeBlockingFilter:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcEnableVBAQ:0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcEnableVBAQ:0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcFrameSize:2560,1440
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcFrameSize:2560,1440
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcGOPSPerIDR:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcGOPSPerIDR:1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcNominalRange:true
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcNominalRange:true
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorPrimaries:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorPrimaries:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:-1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:-1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorTransferChar:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorTransferChar:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcProfile:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcProfile:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQualityPreset:0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQualityPreset:0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQueryTimeout:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcQueryTimeout:1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcRateControlMethod:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcRateControlMethod:2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcTier:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcTier:1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty LowLatencyInternal:true
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty LowLatencyInternal:true
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcEnforceHRD:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcEnforceHRD:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFillerDataEnable:false
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFillerDataEnable:false
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFrameRate:60,1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcFrameRate:60,1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcPeakBitrate:15000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcPeakBitrate:15000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcTargetBitrate:8000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcTargetBitrate:8000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcVBVBufferSize:8000000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty TL0.QL0.HevcVBVBufferSize:8000000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcFrameSize:2560,1440
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcFrameSize:2560,1440
0125-00-29 21:01:09 D700C6C0 [EncodeQueuePalImpl] Warning: EncodeQueueServicePalImpl::CreateEncodeQueue(): unsupported queue type 4 requested, fallback to queue type 2.
[AVHWDeviceContext @ 0x7396c8f96880] EncodeQueuePalImpl: 0125-00-29 21:01:09 D700C6C0 [EncodeQueuePalImpl] Warning: EncodeQueueServicePalImpl::CreateEncodeQueue(): unsupported queue type 4 requested, fallback to queue type 2.
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - numReferences=2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - numReferences=2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - rateControlMethod=4
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - rateControlMethod=4
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - profile=2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - profile=2
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - level=186
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - level=186
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - queueType=8
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - queueType=8
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - pictureWidth=2560
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - pictureWidth=2560
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - pictureHeight=1440
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - pictureHeight=1440
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - pictureBitDepth=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - pictureBitDepth=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - usage=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - usage=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - tier=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - tier=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - maxNumTemporalLayers=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - maxNumTemporalLayers=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - maxNumLongTermFrames=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - maxNumLongTermFrames=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - maxNumSliceOutputs=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - maxNumSliceOutputs=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - initialBufferFullness=64
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - initialBufferFullness=64
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - preEncodeMode=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - preEncodeMode=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - enablePreEncodeChroma=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - enablePreEncodeChroma=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - vbaqMode=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - vbaqMode=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - vbaqStrength=6
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - vbaqStrength=6
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - sceneChangeSensitivity=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - sceneChangeSensitivity=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - sceneChangeMinIdrInterval=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - sceneChangeMinIdrInterval=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - twoPassSearchCenterMapMode=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - twoPassSearchCenterMapMode=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - disableDeblockingFilter=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - disableDeblockingFilter=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - loopFilterAcrossSlicesEnabled=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - loopFilterAcrossSlicesEnabled=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - betaOffsetDiv2=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - betaOffsetDiv2=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - tcOffsetDiv2=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - tcOffsetDiv2=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - cbQpOffset=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - cbQpOffset=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - crQpOffset=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - crQpOffset=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - saoDisabled=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - saoDisabled=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - ampEnabled=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - ampEnabled=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - strongIntraSmoothingEnabled=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - strongIntraSmoothingEnabled=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - constrainedIntraPredictionEnabled=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - constrainedIntraPredictionEnabled=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - cabacInitFlag=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - cabacInitFlag=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - motionEstimationHalfPixel=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - motionEstimationHalfPixel=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - motionEstimationQuarterPixel=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - motionEstimationQuarterPixel=1
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - disableTransformSkip=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigInit::Init() - disableTransformSkip=0
0125-00-29 21:01:09 D700C6C0 [encodercapsbase]   Debug: EncoderCapsBase::AbsoluteToNormalized, V Clock HZ is not set, use default 3300.
[AVHWDeviceContext @ 0x7396c8f96880] encodercapsbase: 0125-00-29 21:01:09 D700C6C0 [encodercapsbase]   Debug: EncoderCapsBase::AbsoluteToNormalized, V Clock HZ is not set, use default 3300.
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcEncodeLatency:1000
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcEncodeLatency:1000
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 0!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 0!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 1, Layer 0 update!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 1, Layer 0 update!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 2, Layer 0 update!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 2, Layer 0 update!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 4!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 4!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 5!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 5!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 6!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 6!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 7!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 7!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 8!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 8!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 9!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 9!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigQualityPreset::Update() - preset=0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreHevc]    Info: ConfigQualityPreset::Update() - preset=0
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 10!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 10!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 11!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 11!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 12!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 12!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 13!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 13!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 14!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 14!
0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 15!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D700C6C0 [AMFEncoderCoreImpl]   Debug: ParamType 15!
Output #0, hevc, to 'out.mkv':
  Metadata:
    encoder         : Lavf61.9.106
  Stream #0:0, 0, 1/60: Video: hevc, 1 reference frame, bgr0(pc, gbr/unknown/unknown, progressive), 2560x1440 [SAR 1:1 DAR 16:9], 0/1, q=2-31, 8000 kb/s, 60 fps, 60 tbn
    Metadata:
      encoder         : Lavc61.31.101 hevc_amf
[out#0/hevc @ 0x60936f638700] Starting thread...
[auto_scale_0 @ 0x7396c8005ec0] [framesync @ 0x7396c8005fd0] Sync level 0
[out_#0:0 @ 0x7396c8004380] EOF on sink link out_#0:0:default.
[vf#0:0 @ 0x60936f633b80] Filtergraph returned EOF, finishing
[vf#0:0 @ 0x60936f633b80] All consumers returned EOF
[vf#0:0 @ 0x60936f633b80] Terminating thread with return code 0 (success)
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::SubmitInput() : format (BGRA), memory (HOST), width (2560), height (1440)
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::SubmitInput() : format (BGRA), memory (HOST), width (2560), height (1440)
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcInColorProfile:7
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcInColorProfile:7
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:2
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcInColorTransferChar:16
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcInColorTransferChar:16
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcInColorPrimaries:1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcInColorPrimaries:1
0125-00-29 21:01:09 D780D6C0 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::Init(BGRA, 2560, 1440)
[AVHWDeviceContext @ 0x7396c8f96880] AMFVideoConverterImpl: 0125-00-29 21:01:09 D780D6C0 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::Init(BGRA, 2560, 1440)
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:2
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetProperty HevcOutColorProfile:2
0125-00-29 21:01:09 D780D6C0 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::SubmitInput() : format (BGRA), memory (HOST), width (2560), height (1440)
[AVHWDeviceContext @ 0x7396c8f96880] AMFVideoConverterImpl: 0125-00-29 21:01:09 D780D6C0 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::SubmitInput() : format (BGRA), memory (HOST), width (2560), height (1440)
0125-00-29 21:01:09 D780D6C0 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::QueryOutput()
[AVHWDeviceContext @ 0x7396c8f96880] AMFVideoConverterImpl: 0125-00-29 21:01:09 D780D6C0 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::QueryOutput()
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 0!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 0!
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 7!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 7!
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 10!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 10!
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 11!
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreImpl: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreImpl]   Debug: ParamType 11!
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetBufferProps: Picture Type:0 Temporal ID=0 @frame 0
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: SetBufferProps: Picture Type:0 Temporal ID=0 @frame 0
0125-00-29 21:01:09 D780D6C0 [EncodeQueuePalImpl]   Debug: *SubmitInput():jobID=1
[AVHWDeviceContext @ 0x7396c8f96880] EncodeQueuePalImpl: 0125-00-29 21:01:09 D780D6C0 [EncodeQueuePalImpl]   Debug: *SubmitInput():jobID=1
[vost#0:0/hevc_amf @ 0x60936f632900] [enc:hevc_amf @ 0x60936f632c80] Encoder thread received EOF
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::QueryOutput()
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::QueryOutput()
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback taskId = 1.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback taskId = 1.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback status = 0.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback status = 0.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback isFirst = 1.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback isFirst = 1.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback isLast = 1.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback isLast = 1.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback bitstreamoffset = 0.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback bitstreamoffset = 0.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback bitstreamSize = 953.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback bitstreamSize = 953.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback hdcpEncrypted = 0.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback hdcpEncrypted = 0.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback hdcpInputCtrHi = 0.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback hdcpInputCtrHi = 0.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback hdcpInputCtrLo = 0.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback hdcpInputCtrLo = 0.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback fillerDataSize = 0.
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::GetBitStreamSize() - ECHEVCUVEReadFeedback fillerDataSize = 0.
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: QueryOutput() End: frame pts=0 outputFrames=1
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: QueryOutput() End: frame pts=0 outputFrames=1
0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::QueryOutput()
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 D780D6C0 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::QueryOutput()
[vost#0:0/hevc_amf @ 0x60936f632900] Terminating thread with return code 0 (success)
[out#0/hevc @ 0x60936f638700] All streams finished
[out#0/hevc @ 0x60936f638700] Terminating thread with return code 0 (success)
[AVIOContext @ 0x60936f6ad480] Statistics: 953 bytes written, 0 seeks, 1 writeouts
[out#0/hevc @ 0x60936f638700] Output file #0 (out.mkv):
[out#0/hevc @ 0x60936f638700]   Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (953 bytes); 
[out#0/hevc @ 0x60936f638700]   Total: 1 packets (953 bytes) muxed
[out#0/hevc @ 0x60936f638700] video:1KiB audio:0KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: 0.000000%
frame=    1 fps=0.0 q=-0.0 Lsize=       1KiB time=00:00:00.00 bitrate=N/A speed=   0x    
0125-00-29 21:01:09 DF824100 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Terminate()
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 DF824100 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Terminate()
0125-00-29 21:01:09 DF824100 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::Terminate()
[AVHWDeviceContext @ 0x7396c8f96880] AMFVideoConverterImpl: 0125-00-29 21:01:09 DF824100 [AMFVideoConverterImpl]   Debug: AMFVideoConverterImpl::Terminate()
0125-00-29 21:01:09 DF824100 +1
0125-00-29 21:01:09 DF824100 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Terminate()
[AVHWDeviceContext @ 0x7396c8f96880] AMFEncoderCoreHevc: 0125-00-29 21:01:09 DF824100 +1
0125-00-29 21:01:09 DF824100 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Terminate()
[in#0/png_pipe @ 0x60936f62fd00] Input file #0 (/home/mark/Pictures/testpage.png):
[in#0/png_pipe @ 0x60936f62fd00]   Input stream #0:0 (video): 1 packets read (158930 bytes); 1 frames decoded; 0 decode errors; 
[in#0/png_pipe @ 0x60936f62fd00]   Total: 1 packets (158930 bytes) demuxed
[AVIOContext @ 0x60936f638a80] Statistics: 158930 bytes read, 0 seeks

I have given it a png as image. I'll also use this in the future for banding tests.

Image

It gives me an green screen as output (1 frame mkv). I'm not allowed to upload mkv to github.. Well, it's 1 frame and completely green, not much to see.

Here are the things that caught my eye in the output:
SetProperty HevcOutColorProfile:-1

That is AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN. Shouldn't this be something like AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_601? Or one of the other full ones.. Just guessing here as this is the only thing looking off to me.

edit
Nope, that can't be it. The log, confusingly, sets everything twice (why?). It does set the color profile to AMF_VIDEO_CONVERTER_COLOR_PROFILE_2020. I also tried with p010 which does the exact same for this property and it works. So it's probably something else.

@MikhailAMD
Copy link
Collaborator

OK. I reproduced the problem with generated input on Windows, but it shouldn't matter. Some color conversion parameters for input and for output are not set and defaults don't work in this case. Below is what I added to hard-code all of them and force 10-bit. This fixes the green frame problem for me, but we will need to update the AMF encoder plugin for better RGBA input handling, 10-bit support and defaults.

// hard-coded values
// bit depth
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_COLOR_BIT_DEPTH, AMF_COLOR_BIT_DEPTH_10);

//input
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_INPUT_COLOR_PROFILE, AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709);
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_INPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_BT709);
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_INPUT_COLOR_PRIMARIES,AMF_COLOR_PRIMARIES_BT709);
// output
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE, AMF_COLOR_PRIMARIES_BT2020);
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_TRANSFER_CHARACTERISTIC, AMF_COLOR_TRANSFER_CHARACTERISTIC_SMPTE2084);
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PRIMARIES,AMF_COLOR_PRIMARIES_BT2020);

For your reference command line from Visual Code I used:
"-y",
"-init_hw_device", "d3d11va=dx11:,vendor_id=0x1002", "-init_hw_device", "amf=hw@dx11",
"-f", "lavfi", "-i", "mandelbrot",
"-vf", "hwupload",
"-c:v", "hevc_amf",
"-frames", "10",
"-profile:v", "main10",
"-profile_tier", "high",
"${workspaceFolder}\output.mkv"

BTW: We are very interested in your feedback such this one as it helps to improve AMF.

@markg85
Copy link
Author

markg85 commented Jan 29, 2025

Ha! You use god mode? That's not documented!

AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_OUTPUT_COLOR_PROFILE, AMF_COLOR_PRIMARIES_BT2020);

Note the primaries in the color profile 😉

Anyhow, confirmed locally! Thank you for these values. Is there anything i can do to help the AMF progress for that 8 bit -> 10 bit conversion?

@MikhailAMD
Copy link
Collaborator

Yes, my bad. The value is outside the parameter range, so the call has no effect. Should be AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_2020.
Note that FULL profile also enables full range.

AMF has deficiency in conversion from and to 8-10 bit between YUV formats only. Your input is RGBA so it works, 8, 10, 16-bit input. Do you have a different use case? There is no reason to convert RGBA8->NV12->P010, just loss of data.
We will expand FFmpeg integration based on our discussions.

Please note that AMF has own Capture component for Linux. The advantage of using it is no transfer to and from system memory. All data stays in video memory. Though, it doesns't have FFmpeg integration yet.

@markg85
Copy link
Author

markg85 commented Jan 30, 2025

Do you have a different use case?

This is the desktop streaming usecase, shouldn't that be sufficient enough? I'm not a streamer and am not using any of this in a professional setting, it's all just internal in one home and hobby-based. However, desktop streaming - say on twitch - is a very real usecase. Right now it probably all works by converting it on the CPU to go from BGR0 to nv12 first before it's fed to AMF.

My experiments also show that AMF can (mostly) do what i want. If i input it as p010 it looks mostly good.
I think you confirmed this before already, AMF "just" needs to be able to handle BGR0 as 10 bit, not as 8.

Please note that AMF has own Capture component for Linux. The advantage of using it is no transfer to and from system memory. All data stays in video memory. Though, it doesns't have FFmpeg integration yet.

Gimme gimme gimme :) You'd still have the 8 vs 10 bit issue, no? Could this work on X11 too? I'm asking because on x11 you can grab your input including the mouse, with kernel modesetting kmsgrab you can't get the mouse (or i don't know how). It's not fun to have a desktop stream when there's no mouse, i tried that.. You then need additional logic to grab the current mouse pixmap, stream that and do client side magic to draw the mouse in the same style as the server. Ugh.. The protocols and helper options might just be a little too limited for that on the KMS side at the moment so i prefer x11(grab) for now that just works.

This being said, X11 and AMF Capture has some very interesting features when combined! In X11 you can track modified regions of content which could work perfectly on the AMF Capture side with AMF_DISPLAYCAPTURE_DIRTY_RECTS. Now if you combine that information with a per-frame "Region Of Interest" (the ROI feature in the AMF Encoder) then it does seem to me that you can encode changes on screen in the most efficient way possible. The ROI docs also state it can be on a per frame basis so this would be golden.

@MikhailAMD
Copy link
Collaborator

MikhailAMD commented Jan 30, 2025

AMF DirectCapture captures BGRA0 and it may be feed directly to encoder. With parameters I hardcoded the result will be 10-bit HEVC. You can check AMF DVR sample.
AMF DirectCapture currently captures data before mouse cursor is applied. The one reason for this is that it gives zero-copy and minimum latency. Yes, in this case streaming solution should handle cursor bitmap separately. The second reason is that merging display surface with cursor is normally done in display hardware. So, if one wants to include cursor into the captured bitmap, one would need to disable HW cursor and switch to SW cursor and it means additional copy of display surface, no zero-copy in this case.
AMF DirectCapture works with X11 and Wayland, On Linux dirty rectangles are not available. On Windows they are generated by DWM and not available if an app runs in true-full-screen mode.
In general, encoder looks for changes from previous frames and will find area where data changed anyway.

@markg85
Copy link
Author

markg85 commented Jan 30, 2025

Hmm, yeah, i get it from a zero-copy point of view. I might eventually also go the no-mouse route and make a solution that streams mouse pixmap changes out of band and render it client side. The downside is it gives a perceived feeling if being more responsive then it actually is, which can be mediated by introducing moude render latency to match video streaming latency.. pff, that is getting complex! The upside, to me, isn't just the zero copy but is the reduced bandwidth as mouse movements over - say - a background are essentially free. It's as soon as a mouse has any visual interaction with a ui element that it becomes part of the encoding process.

Perhaps i'll go that route at some point, an out of stream mouse update. I'll keep it in-stream for the moment :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants