Beiträge von Nicholas Flamy

    The place your FFmpeg (https://github.com/Vouk/voukoder-ffmpeg) gets AMF from (https://github.com/GPUOpen-LibrariesAndSDKs/AMF) says "Version 1.4.21: AMD Radeon Software Adrenalin Edition 21.10.1 (21.30.25.01) or newer. Added PSNR/SSIM score feedback, new QVBR rate control mode and LTR mode for encoders, added HDR support for HEVC encoder and color converter, new EncoderLatency sample app."

    Your FFmpeg says that it is on the latest version of AMF but it clearly isn't. I downloaded your FFmpeg and it was clearly out of date. That's part of the problem.


    They added Main10 on December 3rd, 2021. I'm looking through your FFmpeg Github workflows and if I can figure it out I'll make a PR.


    It's strange, the static build I downloaded from https://github.com/Vouk/voukoder-ffmpeg/releases has ffmpeg-win64-static-release\include\AMF\ and all the files match the GitHub master branch https://github.com/GPUOpen-LibrariesAndSDKs/AMF but the FFmpeg still shows no main10 and errors out when attempting -profile main10 even though the exact same command in Jellyfin FFmpeg works. I think the FFmpeg build is somehow using an older version of AMF even though ffmpeg-win64-static-release\include\AMF\ has the latest files.

    One screenshot is running ./ffmpeg -i '.\Katy Perry - Teenage Dream - 04 - Firework.flac' -c:v copy -c:a libfdk_aac -vbr 4 KP-regular-vbr-4.m4a and the other is running ./ffmpeg -i '.\Katy Perry - Teenage Dream - 04 - Firework.flac' -c:v copy -c:a libfdk_aac -vbr 4 -cutoff 20000 KP-20k-vbr-4.m4a. In the screenshots, you can clearly see one has much lower levels above about 17KHz and that is the first command. The other has normal sound levels above 17KHz and that is with -cutoff 20000. I'll try and test these audio files with Voukoder and see if the cutoff applies or if it's a weird FFmpeg thing. I will get back to you in a second comment when I check.


    Voukoder has the same cutoff applied by default. This could be useful: https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_aac

    So it's not just FFmpeg, it's the FDK AAC encoder.


    Chapter 3.1 which is on page 23 of the FDK AAC docs explains something about the bandwidth and the API for it: https://github.com/mstorsjo/fdk-a…/aacEncoder.pdf


    On this FFmpeg documentation page it lists cutoff as an option:

    ffmpeg Documentation

    This is what I get, I'm using Jellyfin FFmpeg 6.0.1-1 (but I think it's on 6.0 as well):

    ./ffmpeg -h encoder=hevc_amf
    ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
     built with gcc 12-win32 (GCC)
     configuration: --prefix=/opt/ffmpeg --arch=x86_64 --target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --pkg-config=pkg-config --pkg-config-flags=--static --extra-version=Jellyfin --disable-ffplay --disable-debug --disable-doc --disable-sdl2 --disable-ptx-compression --disable-w32threads --enable-pthreads --enable-shared --enable-lto --enable-gpl --enable-version3 --enable-schannel --enable-iconv --enable-libxml2 --enable-zlib --enable-lzma --enable-gmp --enable-chromaprint --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libwebp --enable-libvpx --enable-libzimg --enable-libx264 --enable-libx265 --enable-libsvtav1 --enable-libdav1d --enable-libfdk-aac --enable-opencl --enable-dxva2 --enable-d3d11va --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
     libavutil      58.  2.100 / 58.  2.100
     libavcodec     60.  3.100 / 60.  3.100
     libavformat    60.  3.100 / 60.  3.100
     libavdevice    60.  1.100 / 60.  1.100
     libavfilter     9.  3.100 /  9.  3.100
     libswscale      7.  1.100 /  7.  1.100
     libswresample   4. 10.100 /  4. 10.100
     libpostproc    57.  1.100 / 57.  1.100
    Encoder hevc_amf [AMD AMF HEVC encoder]:
       General capabilities: dr1 delay hardware
       Threading capabilities: none
       Supported hardware devices: d3d11va d3d11va dxva2 dxva2
       Supported pixel formats: nv12 yuv420p p010le bgra bgr0 d3d11 dxva2_vld
    hevc_amf AVOptions:
     -usage             <int>        E..V....... Encoder Usage (from 0 to 5) (default transcoding)
        transcoding     0            E..V....... Transcoding, video editing
        ultralowlatency 1            E..V....... Video game streaming
        lowlatency      2            E..V....... Video collaboration, RDP
        webcam          3            E..V....... Video conferencing
        highquality     4            E..V....... High-quality encoding
        llhighquality   5            E..V....... High-quality encoding (low latency)
     -profile           <int>        E..V....... Profile (from 1 to 2) (default main)
        main            1            E..V.......
        main10          2            E..V.......
     -profile_tier      <int>        E..V....... Profile Tier (from 0 to 1) (default main)
        main            0            E..V.......
        high            1            E..V.......
     -level             <int>        E..V....... Profile Level (from 0 to 186) (default auto)
        auto            0            E..V.......
        1.0             30           E..V.......
        2.0             60           E..V.......
        2.1             63           E..V.......
        3.0             90           E..V.......
        3.1             93           E..V.......
        4.0             120          E..V.......
        4.1             123          E..V.......
        5.0             150          E..V.......
        5.1             153          E..V.......
        5.2             156          E..V.......
        6.0             180          E..V.......
        6.1             183          E..V.......
        6.2             186          E..V.......
     -quality           <int>        E..V....... Quality Preset (from 0 to 10) (default speed)
        speed           10           E..V....... Prefer Speed
        balanced        5            E..V....... Balanced
        quality         0            E..V....... Prefer Quality
     -rc                <int>        E..V....... Rate Control Method (from -1 to 3) (default -1)
        cqp             0            E..V....... Constant Quantization Parameter
        cbr             3            E..V....... Constant Bitrate
        vbr_peak        2            E..V....... Peak Contrained Variable Bitrate
        vbr_latency     1            E..V....... Latency Constrained Variable Bitrate
     -header_insertion_mode <int>        E..V....... Set header insertion mode (from 0 to 2) (default none)
        none            0            E..V.......
        gop             1            E..V.......
        idr             2            E..V.......
     -gops_per_idr      <int>        E..V....... GOPs per IDR 0-no IDR will be inserted (from 0 to INT_MAX) (default 1)
     -preanalysis       <boolean>    E..V....... Enable Pre-Encode/Analysis for rate rontrol (2-Pass) (default false)
     -vbaq              <boolean>    E..V....... Enable VBAQ (default false)
     -hmqb              <boolean>    E..V....... Enable High Motion Quality Boost (default false)
     -enforce_hrd       <boolean>    E..V....... Enforce HRD (default false)
     -filler_data       <boolean>    E..V....... Filler Data Enable (default false)
     -max_au_size       <int>        E..V....... Maximum Access Unit Size for rate control (in bits) (from 0 to INT_MAX) (default 0)
     -min_qp_i          <int>        E..V....... Min Quantization Parameter for I-frame (from -1 to 51) (default -1)
     -max_qp_i          <int>        E..V....... Max Quantization Parameter for I-frame (from -1 to 51) (default -1)
     -min_qp_p          <int>        E..V....... Min Quantization Parameter for P-frame (from -1 to 51) (default -1)
     -max_qp_p          <int>        E..V....... Max Quantization Parameter for P-frame (from -1 to 51) (default -1)
     -qp_p              <int>        E..V....... Quantization Parameter for P-frame (from -1 to 51) (default -1)
     -qp_i              <int>        E..V....... Quantization Parameter for I-frame (from -1 to 51) (default -1)
     -skip_frame        <boolean>    E..V....... Rate Control Based Frame Skip (default false)
     -me_half_pel       <boolean>    E..V....... Enable ME Half Pixel (default true)
     -me_quarter_pel    <boolean>    E..V....... Enable ME Quarter Pixel (default true)
     -aud               <boolean>    E..V....... Inserts AU Delimiter NAL unit (default false)
     -log_to_dbg        <boolean>    E..V....... Enable AMF logging to debug output (default false)


    It seems your AMF is outdated.
    https://github.com/Vouk/voukoder-ffmpeg

    I don't know why but it doesn't have some of the options normal FFmpeg has had for at least a year.

    Could we get an audio cutoff setting like in FFmpeg? That would solve the issue with the audio above 17KHz getting cut off. By default libfdk_aac applies a low pass filter but the ffmpeg command paramete "-cutoff 20000" sets the low pass filter to 20KHz (which is the max, if set higher I will error and tell you 20KHz is max.)