我正在尝试将mp4文件转码为标准格式。视频似乎没问题,但音频不稳定(与视频不同步)。
我的测试输入文件具有以下属性:
Stream #0:1(eng), 0, 1/48000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, 2 channels, 129 kb/s (default)
我输出到:
Stream #0:1, 0, 1/44100: Audio: aac (libfaac) (Main), 44100 Hz, stereo, s16, 128 kb/s
当我构建音频过滤器图时,我得到以下调试输出:
[in @ 0x103954380] Setting 'time_base' to value '1/48000'
[in @ 0x103954380] Setting 'sample_rate' to value '48000'
[in @ 0x103954380] Setting 'sample_fmt' to value 'fltp'
[in @ 0x103954380] Setting 'channel_layout' to value '0x3'
[in @ 0x103954380] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x3
[format @ 0x10390b3e0] Setting 'sample_fmts' to value 's16'
[format @ 0x10390b3e0] Setting 'sample_rates' to value '44100'
[format @ 0x10390b3e0] Setting 'channel_layouts' to value '0x3'
[format @ 0x10390b3e0] auto-inserting filter 'auto-inserted resampler 0' between the filter 'in' and the filter 'format'
[AVFilterGraph @ 0x101f21b80] query_formats: 3 queried, 3 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0x103952bc0] ch:2 chl:stereo fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:s16 r:44100Hz
这对我来说是正确的,但是当我处理文件时,我收到了很多以下消息......
[libfaac @ 0x102063a00] Trying to remove 80 more samples than there are in the queue
......音频不稳定。另外我看到样本格式与原始文件(来自ffprobe)相同:
Stream #0:1(und): Audio: aac (Main) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
即。它尚未完成从AV_SAMPLE_FMT_FLT到AV_SAMPLE_FMT_S16的转换。
我想知道比特率是否是问题的原因但我看不出任何方法将输入比特率转换为输出比特率。有什么想法吗?