gpt4 book ai didi

audio - 添加水印时FFMPEG输出被截断

转载 作者:行者123 更新时间:2023-12-03 01:17:08 27 4
gpt4 key购买 nike

我正在使用以下命令生成 wav 文件的带水印的 320Kbps MP3 预览:

ffmpeg -i /path/input.wav -y -filter_complex "amovie=/path/wm_padded.wav:loop=0,asetpts=N/SR/TB,adelay=3000|3000[beep];[0][beep]amix=duration=shortest,volume=2"  -b:a 320k  /path/preview.mp3

(wm_padded.wav 是填充到 10 秒的水印文件,我使用的是 Mac。该命令的结构基于 this 帖子)

虽然这有时会按预期工作,但有时会产生简短的乱码预览。任何调试此问题的帮助将不胜感激。我已经验证了输入文件,它似乎很好,这是 FFMPEG 命令输出:
    $ ffmpeg -i /path/input.wav -y -filter_complex "amovie=/path/wm_padded.wav:loop=0,asetpts=N/SR/TB,adelay=3000|3000[beep];[0][beep]amix=duration=shortest,volume=2"  -b:a 320k -vsync 2 /path/test-Preview.mp3
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
[wav @ 0x7ff2ba801a00] Discarding ID3 tags because more suitable tags were found.
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from '/path/input.wav':
Metadata:
comment : motion graphics, motion, textures
time_reference : 0
coding_history :
Duration: 00:00:01.75, bitrate: 1520 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 288x288 [SAR 72:72 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Cover (front)
[Parsed_amovie_0 @ 0x7ff2b9d0c040] Channel layout is not set in output stream 0, guessed channel layout is 'stereo'
Stream mapping:
Stream #0:0 (pcm_s16le) -> amix:input0 (graph 0)
volume (graph 0) -> Stream #0:0 (libmp3lame)
Stream #0:1 -> #0:1 (mjpeg (native) -> png (native))
Press [q] to stop, [?] for help
[swscaler @ 0x108d00000] deprecated pixel format used, make sure you did set range correctly
[Parsed_amovie_0 @ 0x7ff2b9e09840] Channel layout is not set in output stream 0, guessed channel layout is 'stereo'
Output #0, mp3, to '/path/preview.mp3':
Metadata:
comment : motion graphics, motion, textures
time_reference : 0
coding_history :
TSSE : Lavf58.29.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, fltp, 320 kb/s
Metadata:
encoder : Lavc58.54.100 libmp3lame
Stream #0:1: Video: png, rgb24(progressive), 288x288 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc (attached pic)
Metadata:
comment : Cover (front)
encoder : Lavc58.54.100 png
frame= 1 fps=0.0 q=-0.0 Lsize= 206kB time=00:00:00.10 bitrate=15994.8kbits/s speed=3.62x
video:200kB audio:5kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.598223%

提前致谢!

最佳答案

升级到 FFMPEG 2.8 解决了这个问题。在 Mac 上,使用:

brew install ffmpeg@2.8

关于audio - 添加水印时FFMPEG输出被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62127711/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com