
Me gustaría preguntar por qué libfdk_aac
el codificador de ffmpeg reduce automáticamente la resolución de bits de mi audio al codificar y quiero saber cómo detenerlo.
Mi codificación es la siguiente (todos los datos están ahí, excepto los metadatos y las rutas de los archivos):
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%
No hay problemas con la codificación... (simplemente codifico en AAC, configuro la velocidad de bits en 192 kbps y reduzco la resolución a 48000 kHz) excepto que, por alguna razón, la profundidad de bits se reduce a 16 bits cuando se codifica desde una fuente de 24 bits. Sé que el libfdk_aac
codificador admite 24 bits, pero por alguna razón, el codificador reduce la resolución automáticamente. Intenté forzar 24 bits, -sample_fmt s32
pero devolví este error:
[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!
Si alguien lo sabe agradecería mucho una respuesta.
Respuesta1
Me temo que no. La salida codificada se decodificará en muestras de punto flotante, pero la biblioteca solo acepta muestras de 16 bits comoaporte.