Feature Request: VBR Mode and Cutoff/Bandwidth for FDK AAC

Started by MswolJ, July 17, 2023, 03:16:30 PM

Previous topic - Next topic

MswolJ

For FDK AAC encoding, can you please add support for VBR modes and also for overriding bandwidth/cutoff (low-pass) frequency?  Both are natively supported by the encoder library.

Thank you!

eumagga0x2a

VBR modes have been added by this commit. Manually overriding cut-off frequency is so strongly discouraged in the library documentation that I am not eager to implement it – and if, should it be a menu from maybe 8 kHz up to 20? Should it be assumed that the user knows that this won't work for profiles with SBR?

For now, whoever needs the best quality, should choose "Very High Bitrate" VBR mode which gives a cut-off > 19 kHz.

MswolJ

Quote from: eumagga0x2a on August 13, 2023, 06:18:47 PMVBR modes have been added by this commit. Manually overriding cut-off frequency is so strongly discouraged in the library documentation that I am not eager to implement it – and if, should it be a menu from maybe 8 kHz up to 20? Should it be assumed that the user knows that this won't work for profiles with SBR?

For now, whoever needs the best quality, should choose "Very High Bitrate" VBR mode which gives a cut-off > 19 kHz.

Good to hear.

With VBR mode 5 available, the need for overriding the frequency is largely irrelevant.

When will a Win64 build be available with this commit?

Thanks!

eumagga0x2a

Quote from: MswolJ on August 13, 2023, 09:45:15 PMWhen will a Win64 build be available with this commit?

When the maintainer of the project finds time to do that, so actually anytime soon or not so soon.

MswolJ

Hmm.. spent the time to try to build this project myself and received a bunch of errors in "nvenc".  Plenty of references to "VBR".

Related or coincidence?

Sample below:


src/libavcodec/nvenc.c: In function 'nvenc_override_rate_control':

src/libavcodec/nvenc.c:925:10: error: 'NV_ENC_PARAMS_RC_VBR_MINQP' undeclared (first use in this function); did you mean 'NV_ENC_PARAMS_RC_VBR'?

  925 |    case NV_ENC_PARAMS_RC_VBR_MINQP:

      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~

      |          NV_ENC_PARAMS_RC_VBR




This was my 64-bit attempt.  The 32-bit attempt ran into some different, really squirrelly issues.

eumagga0x2a

Do you cross-compile? The version of nv-codec-headers should be 11 something, don't try to use the master.

MswolJ

Quote from: eumagga0x2a on August 19, 2023, 06:26:32 AMDo you cross-compile? The version of nv-codec-headers should be 11 something, don't try to use the master.

OK, pulled the most recent 11 version.. seemed to get past that.  Now failing here...
[ 77%] Linking CXX static library libADM_libmp4v2.a

cd /home/ubuntu/avidemux2/buildMingwPluginsCommon-x86_64/ADM_muxers/muxerMp4v2/libmp4v2 && /usr/bin/cmake -P CMakeFiles/ADM_libmp4v2.dir/cmake_clean_>

cd /home/ubuntu/avidemux2/buildMingwPluginsCommon-x86_64/ADM_muxers/muxerMp4v2/libmp4v2 && /usr/bin/cmake -E cmake_link_script CMakeFiles/ADM_libmp4v>

/home/ubuntu/cross-build/mxe/usr/bin/x86_64-w64-mingw32.shared-ar qc libADM_libmp4v2.a CMakeFiles/ADM_libmp4v2.dir/src/3gp.cpp.obj CMakeFiles/ADM_lib>

/home/ubuntu/cross-build/mxe/usr/bin/x86_64-w64-mingw32.shared-ranlib libADM_libmp4v2.a

make[2]: Leaving directory '/home/ubuntu/avidemux2/buildMingwPluginsCommon-x86_64'

[ 77%] Built target ADM_libmp4v2

make[1]: Leaving directory '/home/ubuntu/avidemux2/buildMingwPluginsCommon-x86_64'

make: *** [Makefile:139: all] Error 2



Guess I need to just want for the pros to build..


eumagga0x2a

Just disable the build of MP4v2 muxer in CMakeLists.txt. On Fedora, I don't have to care because I build against the system libmp4v2.

eumagga0x2a

In doubt, please post the actual error (not the final failure at the end), you missed it.

MswolJ

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x4dc): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x4e4): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x506): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x533): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x569): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x57d): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x5ae): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x5d5): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x608): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x61c): relocation truncated to fit: R_X86_64_32S against `.>

CMakeFiles/ADM_vf_FluxSmooth.dir/objects.a(ADM_vidFluxAsm.cpp.obj):ADM_vidFluxAsm:(.text+0x64d): additional relocation overflows omitted from the out>

collect2: error: ld returned 1 exit status


eumagga0x2a

You haven't read the how-to then. It is explicitly stated there that fluxSmooth and ivtvDupeRemover cannot be compiled with the updated gcc in MXE (the assembler code needs a fix).

eumagga0x2a

However, if I am not mistaken, there is more stuff which MXE devs have changed: Qt5 in MXE now uses some icu*.dll libs (icudt66.dll, icuin66.dll and icuuc66.dll), which don't get automatically packaged yet. Please add these three DLLs to the list in create_release_package() in the bootstrap script.

Sorry for inconvenience, the official build node uses an old MXE where these changes are not necessary or even can cause build failures. It is just for people who start afresh.

MswolJ

Quote from: eumagga0x2a on August 19, 2023, 09:34:15 PMYou haven't read the how-to then. It is explicitly stated there that fluxSmooth and ivtvDupeRemover cannot be compiled with the updated gcc in MXE (the assembler code needs a fix).

It was quite painful to get this far... did read those instructions, but obviously forgot.

I followed that instruction and the one about python.  It actually built some files this time... have yet to test.

eumagga0x2a

You will need to copy the icu*.dll libs mentioned above manually from MXE into the Avidemux program directory, else it won't run.

MswolJ

Struggling a bit trying to get the python from my old script for CLI working...
adm.audioCodec(0, "FDK_AAC", "bitrate=320", "afterburner=True", "profile=2", "sbr=False");
Tried including bitrate_mode and other things...

Also struggling trying to convert that to VBR 5 (Highest quality).  No luck yet.