HaveAGitGat / Tdarr_Plugins

Tdarr Plugins
GNU General Public License v3.0
140 stars 163 forks source link

Using Set Video Encoder Flow Plugin: "Unable to parse option value 'veryslow'" #586

Open jacroe opened 10 months ago

jacroe commented 10 months ago

I'm running the 2.17.01 Docker version of Tdarr. I'm trying to convert an h264 Youtube video to hevc using the FFMPEG flow plugins including the Set Video Encoder one. I have the following configuration options chosen:

Here's the log when the error gets thrown. I've redacted episode name but kept the same format, i.e. the show name is two words, the episode number is triple digits, there's an apostrophe in the file name, etc.

2024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:[Step W03] [C15] [HEVC flow] Running Community plugin: 1.0.0: ffmpegCommandExecute: Execute hevc converstion
024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Scanning original library file
2024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:{
2024-01-19T23:22:57.086Z "exifToolScan": true,
2024-01-19T23:22:57.086Z "mediaInfoScan": false,
2024-01-19T23:22:57.086Z "closedCaptionScan": false
2024-01-19T23:22:57.086Z }
2024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Loading source file: /temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724573690/Redacted Show - 01x100 - There's Something Here.mkv
2024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Scanning source file: /temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724573690/Redacted Show - 01x100 - There's Something Here.mkv
2024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Scan types: {
2024-01-19T23:22:57.086Z "exifToolScan": true,
2024-01-19T23:22:57.086Z "mediaInfoScan": false,
2024-01-19T23:22:57.086Z "closedCaptionScan": false
2024-01-19T23:22:57.086Z }
2024-01-19T23:22:57.086Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Using cached scan results
2024-01-19T23:22:57.087Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Loaded plugin inputs: {}
2024-01-19T23:22:57.087Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Processing file
2024-01-19T23:22:57.087Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:{"spawnArgs":["-y","-hwaccel","cuda","-i","/temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724573690/Redacted Show - 01x100 - There's Something Here.mkv","-map","0:0","-c:0","hevc_nvenc","-qp","20","-preset","veryslow","-map","0:1","-c:1","copy","/temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724574433/Redacted Show - 01x100 - There's Something Here.mkv"],"outputFilePath":"/temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724574433/Redacted Show - 01x100 - There's Something Here.mkv"}

2024-01-19T23:22:57.087Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Running tdarr-ffmpeg -y -hwaccel cuda -i /temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724573690/Redacted Show - 01x100 - There's Something Here.mkv -map 0:0 -c:0 hevc_nvenc -qp 20 -preset veryslow -map 0:1 -c:1 copy /temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724574433/Redacted Show - 01x100 - There's Something Here.mkv
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:ffmpeg version 6.0-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
2024-01-19T23:22:58.088Z built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
2024-01-19T23:22:58.088Z configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
2024-01-19T23:22:58.088Z libavutil 58. 2.100 / 58. 2.100
2024-01-19T23:22:58.088Z libavcodec 60. 3.100 / 60. 3.100
2024-01-19T23:22:58.088Z libavformat 60. 3.100 / 60. 3.100
2024-01-19T23:22:58.088Z libavdevice 60. 1.100 / 60. 1.100
2024-01-19T23:22:58.088Z libavfilter 9. 3.100 / 9. 3.100
2024-01-19T23:22:58.088Z libswscale 7. 1.100 / 7. 1.100
2024-01-19T23:22:58.088Z libswresample 4. 10.100 / 4. 10.100
2024-01-19T23:22:58.088Z libpostproc 57. 1.100 / 57. 1.100
2024-01-19T23:22:58.088Z Input #0, matroska,webm, from '/temp/tdarr-workDir-node-Ui8YycnlR-worker-last-lice-ts-1705724569639/1705724573690/Redacted Show - 01x100 - There's Something Here.mkv':
2024-01-19T23:22:58.088Z Metadata:
2024-01-19T23:22:58.088Z MAJOR_BRAND : dash
2024-01-19T23:22:58.088Z MINOR_VERSION : 0
2024-01-19T23:22:58.088Z COMPATIBLE_BRANDS: iso6avc1mp41
2024-01-19T23:22:58.088Z ENCODER : Lavf60.3.100
2024-01-19T23:22:58.088Z Duration: 00:10:59.11, start: 0.000000, bitrate: 1373 kb/s
2024-01-19T23:22:58.088Z Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 60 fps, 60 tbr, 1k tbn (default)
2024-01-19T23:22:58.088Z Metadata:
2024-01-19T23:22:58.088Z HANDLER_NAME : ISO Media file produced by Google Inc.
2024-01-19T23:22:58.088Z DURATION : 00:10:59.090000000
2024-01-19T23:22:58.088Z Stream #0:1(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
2024-01-19T23:22:58.088Z Metadata:
2024-01-19T23:22:58.088Z DURATION : 00:10:59.108000000
2024-01-19T23:22:58.088Z Stream mapping:
2024-01-19T23:22:58.088Z Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc))
2024-01-19T23:22:58.088Z Stream #0:1 -> #0:1 (copy)
2024-01-19T23:22:58.088Z Press [q] to stop, [?] for help
2024-01-19T23:22:58.088Z [hevc_nvenc @ 0x55ad6430fc40] [Eval @ 0x7ffc61f8d7c0] Undefined constant or missing '(' in 'veryslow'
2024-01-19T23:22:58.088Z [hevc_nvenc @ 0x55ad6430fc40] Unable to parse option value "veryslow"
2024-01-19T23:22:58.088Z [hevc_nvenc @ 0x55ad6430fc40] Error setting option preset to value veryslow.
2024-01-19T23:22:58.088Z [vost#0:0/hevc_nvenc @ 0x55ad64298880] Error initializing output stream: Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
2024-01-19T23:22:58.088Z Conversion failed!
2024-01-19T23:22:58.088Z
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Running FFmpeg failed
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:[-error-]
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Error: FFmpeg failed
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:"FFmpeg failed"
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:"Error: FFmpeg failed\n at /app/Tdarr_Node/assets/app/plugins/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js:192:27\n at step (/app/Tdarr_Node/assets/app/plugins/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js:33:23)\n at Object.next (/app/Tdarr_Node/assets/app/plugins/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js:14:53)\n at fulfilled (/app/Tdarr_Node/assets/app/plugins/FlowPlugins/CommunityFlowPlugins/ffmpegCommand/ffmpegCommandExecute/1.0.0/index.js:5:58)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)"
2024-01-19T23:22:58.088Z _rr8rV0cA:Node[RattmannGPU]:Worker[last-lice]:Flow has failed

Let me know if I can provide more details.

andrewmeyer commented 9 months ago

I can recreate this issue, it appears that newer versions of ffmpeg have different quality sets:

nvenc_hevc AVOptions:
  -preset            <int>        E..V.... Set the encoding preset (from 0 to 11) (default medium)
     default                      E..V.... 
     slow                         E..V.... hq 2 passes
     medium                       E..V.... hq 1 pass
     fast                         E..V.... hp 1 pass
     hp                           E..V.... 
     hq                           E..V.... 
     bd                           E..V.... 
     ll                           E..V.... low latency
     llhq                         E..V.... low latency hq
     llhp                         E..V.... low latency hp
     lossless                     E..V.... lossless
     losslesshp                   E..V.... lossless hp
nvenc_h264 AVOptions:
  -preset            <int>        E..V.... Set the encoding preset (from 0 to 11) (default medium)
     default                      E..V.... 
     slow                         E..V.... hq 2 passes
     medium                       E..V.... hq 1 pass
     fast                         E..V.... hp 1 pass
     hp                           E..V.... 
     hq                           E..V.... 
     bd                           E..V.... 
     ll                           E..V.... low latency
     llhq                         E..V.... low latency hq
     llhp                         E..V.... low latency hp
     lossless                     E..V.... 
     losslesshp                   E..V.... 

In my opinion the list may need to be updated to reflect the 11 new presets, alternatively a filtered list of presets may need to be generated for the given encoder