FFMPEG硬件加速转换WEBM到MP4视频失败:无法找到编解码器参数。

3

我使用FFMPEG将WebM视频转换为MP4格式,并在Windows 10上使用Nvidia GPU GeoForce GTX 1660卡。几个月以来一直完美运行,但现在停止工作,并出现以下奇怪的错误:

[h264 @ 0000013d8b5eee00] missing picture in access unit with size 431
[extract_extradata @ 0000013d8b6aef40] No start code is found.
big-buck-bunny-trailer.webm: could not find codec parameters

FFMPEG版本和Nvidia驱动程序版本与之前相同,但是它在一夜之间崩溃了,没有任何线索。我尝试过在Google上搜索,并更新到最新的ffmpeg版本和Nvidia驱动程序版本,但仍然没有帮助。

如果我切换到使用libx264的CPU解码器(不使用hwaccel参数),它就可以正常工作。

环境:Windows 10 64位 | ffmpeg版本git-2020-04-15-51db0a4(最新)| Nvidia GeForce GTX 1660, - Geoforce Game Ready驱动程序版本:445.87 发布日期 Apr 15, 2020

 ffmpeg -y -vsync 0 -hwaccel cuvid -c:v h264_cuvid -i big-buck-bunny-trailer.webm -c:v h264_nvenc output.mp4

ffmpeg version git-2020-04-15-51db0a4 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 78.102 / 58. 78.102
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[h264 @ 0000013d8b5eee00] missing picture in access unit with size 431
[extract_extradata @ 0000013d8b6aef40] No start code is found.
big-buck-bunny-trailer.webm: could not find codec parameters
WARNING: defaulting hwaccel_output_format to cuda for compatibility with old commandlines. This behaviour is DEPRECATED and will be removed in the future. Please explicitly set "-hwaccel_output_format cuda".
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, matroska,webm, from 'big-buck-bunny-trailer.webm':
  Metadata:
    encoder         : http://sourceforge.net/projects/yamka
    creation_time   : 2010-05-20T08:21:12.000000Z
  Duration: 00:00:32.48, bitrate: N/A
    Stream #0:0(eng): Video: h264, none, 640x360, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 1k tbn (default)
    Stream #0:1(eng): Audio: vorbis, 44100 Hz, mono (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_cuvid) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (vorbis (native) -> aac (native))
Press [q] to stop, [?] for help
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 66
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1339
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1415
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1908
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2123
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2504
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2294
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2684
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2468
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2622
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2867
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2737
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 3017
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2556
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 7811
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1880
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1722
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2309
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1215
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2080
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1775
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2247
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1782
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1945
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1529
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1807
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2015
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1568
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2159
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1861
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2397
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1627
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2364
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1821
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2282
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2068
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1699
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2129
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2268
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2197
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1981
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2169
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2888
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1600
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2958
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1518
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2738
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2319
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2421
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2841
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 1949
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2422
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2288
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2559
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2332
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2403
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2257
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2573
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2320
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2231
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2408
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2415
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2194
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2697
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2480
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2256
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2245
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2519
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2203
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2332
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2341
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2439
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2201
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2882
[NULL @ 0000013d8b5eee00] missing picture in access unit with size 2467
Too many packets buffered for output stream 0:1.
[aac @ 0000013d8b6bf5c0] Qavg: 115.929
[aac @ 0000013d8b6bf5c0] 2 frames left in the queue on closing
Conversion failed!

有人知道如何修复它吗?我已经被卡了几天了。非常感谢!

2个回答

2

尝试以下命令:

ffmpeg -y -vsync 0 -hwaccel cuvid -c:v vp8_cuvid -i big-buck-bunny-trailer.webm -c:v h264_nvenc output.mp4

或者

ffmpeg -y -vsync 0 -hwaccel cuvid -c:v vp9_cuvid -i big-buck-bunny-trailer.webm -c:v h264_nvenc output.mp4

NVIDIA的视频编解码软件开发工具包需要首先指定源,因此在这种情况下,您需要将h264解码器更改为vp8或vp9解码器。


0

我成功地修复了它,通过指定解码器为libvpx

ffmpeg -y -vsync 0 -hwaccel cuvid -c:v libvpx -i big-buck-bunny-trailer.webm -c:v h264_nvenc output.mp4

这是有道理的,因为libvpx肯定能够解码webm视频。只是不知道为什么h264_cuvid不能再完成这项工作了。


你好,问题在于你没有使用正确的解码器。你尝试使用HW H264解码器进行解码。你需要使用VP8或VP9解码器才能使其正常工作。vp8_cuvidvp9_cuvid是你要寻找的解码器。 - Maxtrix

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接