lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
555 stars 26 forks source link

Transcoding with NVENC fails with "InitializeEncoder failed" error #75

Closed ekvq closed 3 years ago

ekvq commented 3 years ago

Hey Don,

Having some trouble getting up and running on Windows 10 and NVENC. Any file I try fails with this error:

[hevc_nvenc @ 00000251662dcf40] InitializeEncoder failed: invalid param (8): Preset P1 to P7 not supported with older 2 Pass RC Modes(CBR_HQ, VBR_HQ) and cbr lowdelayEnable NV_ENC_RC_PARAMS::multiPass flag for two pass encoding and set Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

I've tried just issuing the ffmpeg command that's generated by the script, but I'm still getting the error. I'm not quite sure where to start on this issue, but I have a feeling it might be ffmpeg, so here's the output of ffmpeg -version:

ffmpeg version 2020-10-07-git-a086b73e1f-full_build-www.gyan.dev Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil      56. 60.100 / 56. 60.100
libavcodec     58.109.100 / 58.109.100
libavformat    58. 61.100 / 58. 61.100
libavdevice    58. 11.102 / 58. 11.102
libavfilter     7. 87.100 /  7. 87.100
libswscale      5.  8.100 /  5.  8.100
libswresample   3.  8.100 /  3.  8.100
libpostproc    55.  8.100 / 55.  8.100

_ffmpeg_83836_19312.mkv.log

Please let me know what other info you need and I'll update this ASAP.

samhutchins commented 3 years ago

Use the Release version from gyan.dev: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z

Don's working on an update to other-transcode that supports newer versions of ffmpeg

Long version:

NVidia released an update to their media encoding SDK, and and ffmpeg has now integrated with it. These changes are incompatible with some of the options used by other-transcode. Don and the hivemind are working on the changes needed to support newer versions, and you can see the progress in the GitHub commit history. In fact, if you just download the ruby script directly from GitHub it will work with your ffmpeg nightly. It looks like we're gonna get even more speed out of NVENC with this update too :-D

ekvq commented 3 years ago

Yup! That fixed it. Thanks, @samhutchins

lisamelton commented 3 years ago

@ekvq Indeed, thanks @samhutchins! And my apologies for not noticing this issue last night.

The new version of other-transcode will be released "soon." If you want to try it, you can download the script from GitHub since all the necessary changes are checked in now. You'll get a speed boost even with the release version of ffmpeg.