After many weeks and a lot of effort, I finally managed to use a Cygwin and MinGW-w64 toolchain to cross-compile a working binary of FFmpeg for Windows, complete with the superior but elusive fdk_aac encoder.
However, comparing my newly-compiled binary with the official pre-compiled build for Windows makes me feel a little... lacking (first run is the Zeranoe build, second is my own):
Notice how the Zeranoe build's banner is missing all of the unseemly-looking configure options apart from the external libraries. Along with that, it also has the date that the program was built on inserted right after the GCC version.
How were the compilers of this build able to add these enhancements to their binary, and how can I do the same? I'm assuming these are simply GCC or preprocessor options that I can't find any information on, or maybe there's more to it than that.
N.B: I'm aware of the --no-banner
switch for FFmpeg, and that's not what I'm trying to do here.
These aren't GCC options, they are direct changes made to the source.
You can manually edit what is displayed on the banner in the cmdutils.c
file in the FFmpeg source - in the function print_program_info
, lines 1145 to 1157:
static void print_program_info(int flags, int level)
{
const char *indent = flags & INDENT? " " : "";
av_log(NULL, level, "%s version " FFMPEG_VERSION, program_name);
if (flags & SHOW_COPYRIGHT)
av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers",
program_birth_year, CONFIG_THIS_YEAR);
av_log(NULL, level, "\n");
av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT);
av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
}
There, you can manually add to the function things like the current date, etc or remove things entirely.