使用ffmpeg解码ogg文件时,输出原始音频包含"尾部"到底。虽然ffprobe在样本和秒中报告正确的持续时间,但在解码文件的末尾添加了大约8ms。
这听起来像编码器延迟的东西,我在mp3(LAME标签)和m4a(ITUNSMB标签)中有这方面的经验,但不是用ogg。
当我以audacity打开相同的ogg文件时,文件被正确解码,没有" tail" (并且大胆使用ffmpeg ..)。因此,文件中似乎有足够的信息可以正确解码。
我考虑解析ffprobe并截断到duration_ts
个帧数,但如果ffmpeg有一些构建标志,我宁愿由解码器处理......
这是同一个文件的图像,该文件首先由ffmpeg解码并导入为raw(带尾部),然后由audacity打开并解码(没有尾部):
任何线索?
这是完整的ffmpeg输出:
PS D:\audio-test> .\ffmpeg\bin\ffmpeg.exe -f ogg -i sine-scale.ogg -f s16le -ar 44100 -ac 1 -acodec pcm_s16le sinescale-s16le
ffmpeg version N-87327-g18821e3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 75.100 / 55. 75.100
libavcodec 57.106.101 / 57.106.101
libavformat 57. 82.100 / 57. 82.100
libavdevice 57. 8.101 / 57. 8.101
libavfilter 6.105.100 / 6.105.100
libswscale 4. 7.103 / 4. 7.103
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100
Input #0, ogg, from 'sine-scale.ogg':
Duration: 00:00:05.00, start: 0.000000, bitrate: 23 kb/s
Stream #0:0: Audio: vorbis, 44100 Hz, mono, fltp, 120 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (vorbis (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, s16le, to 'sinescale-s16le':
Metadata:
encoder : Lavf57.82.100
Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s
Metadata:
encoder : Lavc57.106.101 pcm_s16le
size= 431kB time=00:00:05.00 bitrate= 705.6kbits/s speed= 357x
video:0kB audio:431kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%