我使用ffmpeg-python将视频和音频结合在我的程序中,但是对于一个视频文件,我经常收到以下错误:
ffmpeg version N-55702-g920046a Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 21 2013 18:10:00 with gcc 4.7.3 (GCC)
configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 42.100 / 52. 42.100
libavcodec 55. 29.100 / 55. 29.100
libavformat 55. 14.101 / 55. 14.101
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 82.100 / 3. 82.100
libswscale 2. 5.100 / 2. 5.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000000000073cb40] Could not find codec parameters for stream 0 (Video: none (av01 / 0x31307661), 2560x1440, 5427 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
temp/Above NYC - Filmed in 12K.mp4: could not find codec parameters
Traceback (most recent call last):
File "C:/Users/Family/PycharmProjects/8-bit Downloader/class_8_bit.py", line 4, in <module>
ffmpeg.output(v, "temp/hello.mp4").run()
File "C:\Users\Family\PycharmProjects\8-bit Downloader\venv\lib\site-packages\ffmpeg\_run.py", line 325, in run
raise Error('ffmpeg', out, err)
ffmpeg._run.Error: ffmpeg error (see stderr output for detail)
它就是认不出来。我知道编解码器是av01,我已经尝试将它作为vcodec关键字传入,但是没有任何工作。我试着直接去cmd,添加“分析”和“概率”,但是似乎没有什么效果。我怎么才能解决这个问题?我的代码:
import ffmpeg
# I have tried passing absolute paths instead of relative ones too, still not working
input_video = ffmpeg.input("temp/Above NYC - Filmed in 12K.mp4")
input_audio = ffmpeg.input("temp/audio_temp 1.webm")
full_path = "temp/New.mp4"
out = ffmpeg.output(input_video, input_audio, full_path, vcodec='copy', acodec='aac', strict='experimental')
out.run(overwrite_output=True)
发布于 2021-01-26 12:25:21
看起来您的ffmpeg
不是用AV1支持构建的。--enable-libdav1d
和--enable-libaom
都不会出现在配置中。它也很古老(从2013年开始的2.0开发版本)。
您可以使用ffmpeg -codecs
命令进行确认,并查找如下行
DEV.L. av1 AV1开放媒体联盟(译码器: libdav1d libaom-av1 )
如果它丢失了,或者没有D
,那么它就不能工作。
请注意,您有一个共享构建(--disable-static --enable-shared
),因此您还需要单独安装库,即使它们已启用。
考虑增加“分析”和“probesize”选项的值
这在这种情况下行不通。它已经找到了参数-- (av01 / 0x31307661), 2560x1440, 5427 kb/s
--但是不知道如何处理它们。
https://stackoverflow.com/questions/65901108
复制相似问题