Áudio libfdk_aac de 24 bits com ffmpeg

Áudio libfdk_aac de 24 bits com ffmpeg

Gostaria de perguntar por que libfdk_aaco codificador do ffmpeg está diminuindo automaticamente a profundidade de bits do meu áudio durante a codificação e quero saber como pará-lo.

Minha codificação é assim (todos os dados estão lá, exceto metadados e caminhos de arquivo):

ffmpeg -i "/Path/To/Input.flac" -c:a libfdk_aac -b:a 192k -ar 48000 -map_metadata -1 -metadata title="Title" -metadata artist="Artist" -metadata date="Date" "/Path/To/Output.m4a"
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.10.44.4)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-opencl --enable-videotoolbox --enable-nonfree
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, flac, from '/Path/To/Input.flac':
  Duration: 00:31:31.71, start: 0.000000, bitrate: 4721 kb/s
    Stream #0:0: Audio: flac, 192000 Hz, stereo, s32 (24 bit)
Stream mapping:
  Stream #0:0 -> #0:0 (flac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
Output #0, ipod, to '/Path/To/Output.m4a':
  Metadata:
    title           : Title
    artist          : Artist
    date            : Date
    encoder         : Lavf58.20.100
    Stream #0:0: Audio: aac (libfdk_aac) (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 192 kb/s
    Metadata:
      encoder         : Lavc58.35.100 libfdk_aac
[NULL @ 0x7fb747801000] sample/frame number mismatch in adjacent frames
size=   44686kB time=00:31:31.71 bitrate= 193.5kbits/s speed=22.2x    
video:0kB audio:44338kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.784360%

Sem problemas com a codificação... (eu simplesmente codifico para AAC, defino a taxa de bits para 192kbps e reduzo a resolução para 48.000 kHz), exceto que, por algum motivo, a profundidade de bits é reduzida para 16 bits ao codificar a partir de uma fonte de 24 bits. Eu sei que o libfdk_aaccodificador suporta 24 bits, mas por algum motivo, o codificador reduz automaticamente a amostragem. Tentei forçar 24 bits, -sample_fmt s32mas retornou com este erro:

[libfdk_aac @ 0x7fc58100b200] Specified sample format s32 is invalid or not supported
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

Se alguém souber, agradeceria muito uma resposta.

Responder1

Receio que não. A saída codificada será decodificada para amostras de ponto flutuante, mas a biblioteca só aceita amostras de 16 bits comoentrada.

informação relacionada