我有一个mp4视频,我想在装有GTX1060卡的机器上使用ffmpeg字幕(来自.ass文件并通过-vf ass=/tmp/conf-notes.ass
),但是ffmpeg报告它无法创建NVDEC解码器
[h264 @ 0xcb9380] Error creating a NVDEC decoder: 1
[h264 @ 0xcb9380] Failed setup for format cuda: hwaccel initialisation returned error.
生成的输出文件可以,但是在创建过程中CPU被大量使用(我假定用于解码)-如果我放下-vf ass=/tmp/conf-notes.ass
并执行mp4-> mp4重新编码,就没有问题。
我想知道在将.ass
文件添加到链中时,允许GPU执行解码的命令所缺少的内容。
$ ffmpeg -hwaccel cuvid -i 2019-01-conferance.mp4 -vf ass=/tmp/conf-notes.ass -c:a copy -preset llhq -rc vbr_hq -vb 2M -minrate 500k -maxrate 12M -c:v h264_nvenc export.mp4
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 8 (GCC)
configuration: --arch=x86_64 --bindir=/usr/bin --datadir=/usr/share/ffmpeg --disable-debug --disable-static --disable-stripping --enable-alsa --enable-avfilter --enable-avresample --enable-bzlib --enable-decklink --enable-doc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gpl --enable-iconv --enable-libass --enable-libbluray --enable-libcdio --enable-libdc1394 --enable-libdrm --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libilbc --enable-libkvazaar --enable-libmfx --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-librtmp --enable-librubberband --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtesseract --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxml2 --enable-libxvid --enable-libzvbi --enable-lv2 --enable-lzma --enable-libndi_newtek --enable-nonfree --enable-openal --enable-opencl --enable-opengl --enable-postproc --enable-pthreads --enable-sdl2 --enable-shared --enable-version3 --enable-xlib --enable-zlib --extra-cflags=-I/usr/include/cuda --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --prefix=/usr --shlibdir=/usr/lib64 --enable-cuda --enable-cuvid --enable-libnpp --enable-nvdec --enable-nvenc --enable-runtime-cpudetect
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2019-01-conferance.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2019-01-12T00:00:06.000000Z
Duration: 00:00:24.07, start: 0.000000, bitrate: 11542 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 11350 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
creation_time : 2019-01-12T00:00:07.000000Z
handler_name : Mainconcept MP4 Video Media Handler
encoder : AVC Coding
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
Metadata:
creation_time : 2019-01-12T00:00:07.000000Z
handler_name : Mainconcept MP4 Sound Media Handler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[h264 @ 0xcb9380] Error creating a NVDEC decoder: 1
[h264 @ 0xcb9380] Failed setup for format cuda: hwaccel initialisation returned error.
[Parsed_ass_0 @ 0x1241c00] Shaper: FriBidi 1.0.2 (SIMPLE) HarfBuzz-ng 1.7.5 (COMPLEX)
[Parsed_ass_0 @ 0x1241c00] Using font provider fontconfig
[Parsed_ass_0 @ 0x1241c00] Added subtitle file: '/tmp/conf-notes.ass' (2 styles, 101 events)
.ass
文件是通过.srt
从ffmpeg -i foo.srt foo.ass
文件生成的