Page 1 of 1

nvidia acceleration ffmpeg "veryfast" not supported

PostPosted: Mon Sep 30, 2024 5:35 pm
by nobody511
I thought i try to save a few Watts of Power and use a simple nvidia card to encode to h264 (old 730, but it makes 40W difference and gives same or slightly better fps).
Environment is Windows Server 2016 serviio is running inside a VM. Serviio version is 2.4
So I got an ffmpeg version 5 (serviio ffmpeg is also 5) from gyan.dev which supports this card. Manually running a transcode works fine.
I replaced the ffmpeg supplied with serviio with the version fom gyan and edited the options file so that nvidia acceleration is used.
But there will be no output - ffempg terminates. I examined the commandline which is used to call the ffmpeg binary, and tried it manually in a shell. Ffmepg does not like the option "veryfast" which serviio sends. If I replace veryfast with fast, the transcoding will run.

But how do I tell serviio to send fast instead of veryfast? The applicationprofile.xml is full of options but none seems to change this setting?
In the UI of serviio I can set quality to high, but also this will not change the ffempg option to fast.

As a last resort, I could replace the ffempg with a batch file, extract the arguments, and replace any verfyfast with fast. That should work but its not a nice workaround. Since Serviio supports nvenc I rather suspect I did oversee something obvious?

Re: nvidia acceleration ffmpeg "veryfast" not supported

PostPosted: Tue Oct 01, 2024 1:50 pm
by nobody511
Followup:
I tried a newer Card (1650) and a newer ffmpeg (v7). the nvenc codec still does not support the "veryfast" argument.
I made the workaround using a batch file. Seems to work.

Still I would like to know how this is supposed to work by just enabling the nvidia integration in the user.vmoptions file.

Re: nvidia acceleration ffmpeg "veryfast" not supported

PostPosted: Tue Oct 01, 2024 3:41 pm
by atc98092
Going to need Zip to respond to this. I have no idea how hardware acceleration is supposed to work.

Re: nvidia acceleration ffmpeg "veryfast" not supported

PostPosted: Tue Oct 01, 2024 4:20 pm
by nobody511
if anyone encounters the same problem, here the workaround:
The user.vmoptions file:
  Code:
-Dserviio.useNVidiaAcceleration
-Dffmpeg.location=C:\Program Files\Serviio\lib\ffmpeg.bat


the ffmpeg.bat file:
  Code:
@echo off

echo %* >>c:\logs\ffmpeg.log.txt
set CMDARG=%*
echo old:%CMDARG%

rem replace veryfast with fast
set NEWCMDARG=%CMDARG:veryfast=fast%

echo new:%NEWCMDARG% >>c:\logs\ffmpeg.log.txt
"C:\Program Files\Serviio\lib\ffmpeg.exe" %NEWCMDARG%
exit /B %ERRORLEVEL%



Btw: the old 730 Card performs better (energysaving wise) then the 1650. I get 170fps with the 730 and it uses approx. 30W, with the 1650 I get 210fps, but 70 watts consumed. But 70W is the same as if I use the CPU.