我需要將.wav格式的音頻文件切分爲10秒的塊。 這些塊需要精確到10秒,而不是10.04799988232秒。在ffmpeg中準確的音頻切片樣本?
我使用的是當前的代碼
ffmpeg -i test.wav -ss 0 -to 10 -c:a libfdk_aac -b:a 80k aac/test.aac
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --disable-lzma --enable-nonfree --enable-vda
libavutil 55. 34.100/55. 34.100
libavcodec 57. 64.101/57. 64.101
libavformat 57. 56.100/57. 56.100
libavdevice 57. 1.100/57. 1.100
libavfilter 6. 65.100/6. 65.100
libavresample 3. 1. 0/3. 1. 0
libswscale 4. 2.100/4. 2.100
libswresample 2. 3.100/2. 3.100
libpostproc 54. 1.100/54. 1.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from '/Users/chris/Repos/mithc/client/assets/audio/wav/test.wav':
Duration: 00:04:37.62, bitrate: 2307 kb/s
Stream #0:0: Audio: pcm_s24le ([1][0][0][0]/0x0001), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s
Output #0, adts, to '/Users/chris/Repos/mithc/client/assets/audio/aac/test.aac':
Metadata:
encoder : Lavf57.56.100
Stream #0:0: Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 80 kb/s
Metadata:
encoder : Lavc57.64.101 libfdk_aac
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s24le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
size= 148kB time=00:00:15.01 bitrate= 80.6kbits/s speed=40.9x
video:0kB audio:148kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
此代碼不會產生精確的切片,任何想法如何可能?
適用於我使用相同的編碼器和比特率。 M4A準確地說是10秒:'ffmpeg -i input.m4a -f null -',參考'time ='。顯示您的實際命令和完整的控制檯輸出。 – LordNeckbeard
命令: '的ffmpeg -i test.wav -ss 0 -to 10 -c:一個libfdk_aac -b:一個80K AAC/test.aac' 輸出: http://pastebin.com/nYeh2Xar 還應該提到,我正在分割一系列要使用網絡音頻API串聯播放的文件,因此不要丟棄樣本對於避免爆音是非常重要的。 –