我想问为什么 ffmpeg 的libfdk_aac
编码器在编码时会自动降低音频的位深度,我想知道如何停止它。
我的编码是这样的(除了元数据和文件路径之外,所有数据都在那里):
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%
编码没有问题...(我只是编码为 AAC,将比特率设置为 192kbps,并将采样率降低到 48000 kHz),但由于某种原因,当从 24 位源编码时,位深度会降低到 16 位。我知道libfdk_aac
编码器支持 24 位,但出于某种原因,编码器会自动降低采样率。我尝试强制使用 24 位,但-sample_fmt s32
返回了此错误:
[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!
如果有人知道,我将非常感激您的答复。
答案1
恐怕不行。编码输出将解码为浮点样本,但该库仅接受 16 位样本输入。