2
votes

Consider the following two files

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a.mp4':
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x784
Stream #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'b.mp4':
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1038
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp

a.mp4 has 6 channel AC3 audio, b.mp4 has 6 channel AAC audio. If I downmix a.mp4 like so

ffmpeg -i a.mp4 -c:v copy -ac 2 outfile.mp4

it will use default downmix coefficients from ac3dec.c

However if I downmix b.mp4 like so

ffmpeg -i b.mp4 -c:v copy -ac 2 outfile.mp4

where are those defaults defined?

1

1 Answers

3
votes

The default value for "center mix level" and "surround mix level" is

// In file libswresample/swresample.c
"set center mix level"      , OFFSET(clev), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB}
"set surround mix level"    , OFFSET(slev), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB}

Which is

// In file libswresample/swresample.c
#define C_30DB  M_SQRT1_2

Which is

//       In file libavutil/mathematics.h
// included from libavutil/avutil.h
//          from libavutil/opt.h
//          from libswresample/swresample.c
#define M_SQRT1_2      0.70710678118654752440

swresample.c

mathematics.h