ffmpeg 的 Buffer Underfollow 和忽略缓冲区消息

ffmpeg 的 Buffer Underfollow 和忽略缓冲区消息

我只是想改变 mpeg 文件的音量,所以请尝试这样做。

(该 mpeg 文件是 20Mbps NTSC-HD 文件)

    ffmpeg -i <inputfile.mpg> -vcodec copy -filter:a "volume=+3dB" <output.mpg>

我发现了很多这样的警告信息

[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=38310 size=111232
[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=40351 size=111232
[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=42392 size=111232
[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=44433 size=111232
[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=46474 size=111232
[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=48515 size=111232
[mpeg @ 00000000030c24c0] buffer underflow st=1 bufi=1077 size=1152
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=50556 size=111232
[mpeg @ 00000000030c24c0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=317008 size=433920
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=319049 size=433920
[mpeg @ 00000000030c24c0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=319049 size=433920
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=321090 size=433920
[mpeg @ 00000000030c24c0] packet too large, ignoring buffer limits to mux it
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=321090 size=433920
[mpeg @ 00000000030c24c0] buffer underflow st=0 bufi=323131 size=433920
[mpeg @ 00000000030c24c0] packet too large, ignoring buffer limits to mux it

我尝试使用 -bufsize 增加缓冲区,但结果还是一样。我的第一个屏幕显示如下。

ffmpeg version N-82143-gbf14393 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.4.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --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-libschroedinger --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-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil      55. 35.100 / 55. 35.100
  libavcodec     57. 65.100 / 57. 65.100
  libavformat    57. 57.100 / 57. 57.100
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 66.100 /  6. 66.100
  libswscale      4.  3.100 /  4.  3.100
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Input #0, mpeg, from 'EST0511.mpg':
  Duration: 00:00:19.02, start: 0.226944, bitrate: 20928 kb/s
    Stream #0:0[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 384 kb/s
    Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 20000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc

我可以对此有什么建议吗?

答案1

如果输出扩展名是.mpg,则 ffmpeg 假定它是 MPEG-1 系统流,该流需要 mpeg1video 流,并具有预期的缓冲区大小。

对于 MPEG-2 PS,使用-f dvd

ffmpeg -i <inputfile.mpg> -vcodec copy -c:a mp2 -af "volume=+3dB" -f dvd <output.mpg>

答案2

解决方案(可能)

尝试移除-vcodec copy并让它ffmpeg做它想做的事。

ffmpeg -i '<INPUT FILE PATH>' -filter:a 'volume=+3dB' OUTPUT.mpg

我刚刚做完

ffmpeg -i test.flv -filter:a 'volume=+3dB' OUTPUT.mpg

并且它成功了。

相关内容