Opened 2 months ago

Last modified 8 weeks ago

#6177 new enhancement

request: use the default bit rate values of afconvert when using audiotoolbox encoding

Reported by: ponpon Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: audiotoolbox
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

thank you for good apps.

i think bit rates are too low when not setting -ab.

For example,
160kbps is sett in 5.1 of aac by ffmpeg, 224kbps; 7.1ch,
on the other hand, 320kbps; 5.1ch by afconvert, 448kbps; 7.1ch,

i request the usage of these.

5.1ch of aac

./ffmpeg -y -f lavfi -i aevalsrc=0:d=1:c=5.1 -c:a aac_at test51.mp4 ; afconvert -f mp4f -d aac test51.mp4 -o test51.m4a ; mediainfo test51.m4a | grep "Nominal bit rate"
ffmpeg version N-83606-gc9e3952 Copyright (c) 2000-2017 the FFmpeg developers
  built with clang version 3.8.1 (tags/RELEASE_381/final)
  configuration: --prefix=/sw --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --cc=clang-mp-3.8 --cxx=clang++-mp-3.8 --extra-cflags=' -march=native -I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldlibflags='-L/sw/lib -L/opt/local/lib -static' --target-os=darwin --arch=x86_64 --cpu=corei7-avx --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-openssl --enable-gnutls --enable-gcrypt --enable-gmp --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libschroedinger --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
  libavutil      55. 47.100 / 55. 47.100
  libavcodec     57. 80.101 / 57. 80.101
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 73.100 /  6. 73.100
  libavresample   3.  2.  0 /  3.  2.  0
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, lavfi, from 'aevalsrc=0:d=1:c=5.1':
  Duration: N/A, start: 0.000000, bitrate: 16934 kb/s
    Stream #0:0: Audio: pcm_f64le, 44100 Hz, 5.1, dbl, 16934 kb/s
[aac_at @ 0x7fb2b703b000] Bitrate 128000 not allowed; changing to 160000
Output #0, mp4, to 'test51.mp4':
  Metadata:
    encoder         : Lavf57.66.102
    Stream #0:0: Audio: aac (aac_at) ([64][0][0][0] / 0x0040), 44100 Hz, 5.1(side), s16, 128 kb/s
    Metadata:
      encoder         : Lavc57.80.101 aac_at
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_f64le (native) -> aac (aac_at))
Press [q] to stop, [?] for help
size=      22kB time=00:00:01.04 bitrate= 171.9kbits/s speed=39.6x    
video:0kB audio:21kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.365024%
*** warning: Transcoding multichannel audio may not handle channel layouts correctly (0)
Nominal bit rate                         : 320 Kbps


7.1ch

./ffmpeg -y -f lavfi -i aevalsrc=0:d=1:c=7.1 -c:a aac_at test71.mp4 ; afconvert -f mp4f -d aac test71.mp4 -o test71.m4a ; mediainfo test71.m4a | grep "Nominal bit rate"
ffmpeg version N-83606-gc9e3952 Copyright (c) 2000-2017 the FFmpeg developers
  built with clang version 3.8.1 (tags/RELEASE_381/final)
  configuration: --prefix=/sw --disable-shared --enable-static --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --optflags=-Ofast --cc=clang-mp-3.8 --cxx=clang++-mp-3.8 --extra-cflags=' -march=native -I/sw/include -I/opt/local/include ' --extra-ldflags=' -L/sw/lib -L/opt/local/lib -fopenmp' --extra-ldlibflags='-L/sw/lib -L/opt/local/lib -static' --target-os=darwin --arch=x86_64 --cpu=corei7-avx --enable-avresample --enable-libfdk-aac --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libxvid --enable-libfreetype --enable-openssl --enable-gnutls --enable-gcrypt --enable-gmp --enable-librtmp --enable-libass --enable-fontconfig --enable-libfribidi --enable-libbluray --enable-libdc1394 --enable-libschroedinger --enable-libmodplug --enable-lzma --enable-libx264 --enable-libx265 --enable-libzimg --enable-libvidstab --enable-libsoxr --enable-opengl --enable-opencl --pkg-config-flags=' --libs --static'
  libavutil      55. 47.100 / 55. 47.100
  libavcodec     57. 80.101 / 57. 80.101
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 73.100 /  6. 73.100
  libavresample   3.  2.  0 /  3.  2.  0
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, lavfi, from 'aevalsrc=0:d=1:c=7.1':
  Duration: N/A, start: 0.000000, bitrate: 22579 kb/s
    Stream #0:0: Audio: pcm_f64le, 44100 Hz, 7.1, dbl, 22579 kb/s
[aac_at @ 0x7f95c3853e00] Bitrate 128000 not allowed; changing to 224000
Output #0, mp4, to 'test71.mp4':
  Metadata:
    encoder         : Lavf57.66.102
    Stream #0:0: Audio: aac (aac_at) ([64][0][0][0] / 0x0040), 44100 Hz, 7.0, s16, 128 kb/s
    Metadata:
      encoder         : Lavc57.80.101 aac_at
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_f64le (native) -> aac (aac_at))
Press [q] to stop, [?] for help
size=      30kB time=00:00:01.04 bitrate= 237.9kbits/s speed=  34x    
video:0kB audio:29kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.144424%
*** warning: Transcoding multichannel audio may not handle channel layouts correctly (0)
Nominal bit rate                         : 448 Kbps

Change History (1)

comment:1 Changed 8 weeks ago by cehoyos

  • Component changed from undetermined to avcodec
  • Keywords audiotoolbox added
  • Priority changed from normal to wish
  • Type changed from defect to enhancement
  • Version changed from unspecified to git-master

Feel free to send the necessary patch to the development mailing list for discussion, I don't think these values will be changed because of a request here.

Note: See TracTickets for help on using tickets.