Closed apeman76 closed 2 years ago
Are you using a build of FFMPEG that supports hardware acceleration in these containers? The base FFMPEG binaries included in sonarr-sma/radarr-sma do not and it looks like hwaccel options aren't being applied to your final command which would happen if the build doesn't support it (the script checks against your current FFMPEG build before applying those options)
This error check is done at the decoder level previously but not encoders but I just included an update that checks the encoders you've chosen as well and puts up a warning if not supported
9cef08221d35622a85b44c800fc6e20f9d002e0e
You'll need to use the build
tag which will build your docker container locally and also build FFMPEG for you to support whichever hardware acceleration you're trying to achieve (QSV in this case)
Hello,
I have tried building a new docker container with the example docker-compose file:
services:
sonarr:
container_name: sonarr
build:
context: https://github.com/mdhiggins/sonarr-sma.git#build
args:
- ffmpeg_tag=4.2-vaapi
This all works and everything is functioning except I get a different error now:
2022-01-28 02:24:37 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2022-01-28 02:24:42 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2022-01-28 02:34:04 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2022-01-28 02:34:04 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2022-01-28 02:34:04 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2022-01-28 02:34:04 - resources.mediaprocessor - INFO - File /tv/The Simpsons/Season 33/The.Simpsons.S33E05.WEB.x264-TORRENTGALAXY[TGx].mkv is not valid
2022-01-28 02:34:04 - SonarrPostProcess - INFO - Processing returned False.
2022-01-28 02:34:04 - SonarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
File "/usr/local/sma/postSonarr.py", line 322, in <module>
sys.exit(1)
SystemExit: 1
2022-01-28 02:39:00 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2022-01-28 02:39:00 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2022-01-28 02:39:00 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2022-01-28 02:39:00 - resources.mediaprocessor - INFO - File /tv/The Simpsons/Season 32/The.Simpsons.S32E22.WEB.x264-PHOENiX[TGx].mkv is not valid
2022-01-28 02:39:00 - SonarrPostProcess - INFO - Processing returned False.
2022-01-28 02:39:00 - SonarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
File "/usr/local/sma/postSonarr.py", line 322, in <module>
sys.exit(1)
SystemExit: 1
Sorry i am not really that familiar with docker-compose and building containers :/
Looks like your build probably isn't working, if you bash into the container and try to run ffprobe or ffmpeg I'm betting you're going to get a compile error
This is usually a result of using different versions of ubuntu/linux across the FFMPEG build container and the host (sonarr) container.
You can bash into your sonarr container and run
cat /etc/issue
which should show you the Ubuntu version, for me its 20.04
In which case adjust your build tag to match
services:
sonarr:
container_name: sonarr
build:
context: https://github.com/mdhiggins/sonarr-sma.git#build
args:
sonarr_tag: develop
ffmpeg_tag: 4.4-vaapi2004
and while VAAPI and QSV are similar, they aren't exactly the same so you may need to choose your encoders/decoders to support VAAPI instead of quicksync specifically (h265vaapi instead of h265qsv/hevcqsv) though you can check your specific build of FFMPEG to be certain by running ffmpeg -encoders
and see if its listed
Edit: Quick check - looks like the develop
version of sonarr is on 2004 and the latest
tag is still on 1804 so match accordingly and check your own setup, updated example, also arg syntax shouldn't have -
on newer versions of docker-compose so I updated that as well
Yes, thank you so much!! It works perfectly now after rebuilding the image!
Out of curiosity just in case I encounter this in the future, could you share your final settings for hwaccel related options and which encoder your chose?
Thanks
Yes ofcourse:
[Converter]
hwaccel-decoders = hevc_qsv, h264_qsv, hevc_vaapi, h264_vaapi, h264_cuvid, mjpeg_cuvid, mpeg1_cuvid, mpeg2_cuvid, mpeg4_cuvid, vc1_cuvid
hwdevices = qsv:/dev/dri/renderD128
hwaccel-output-format = vaapi:vaapi
[Video]
codec = hevc_vaapi
It is currently running privileged, and with the 'devices' block added to the docker container
This gives me no errors at all 👍
Your setting hwdevices = qsv:/dev/dri/renderD128
is probably not being applied here, should change that to
hwdevices = vaapi:/dev/dri/renderD128
since you switched to VAAPI (though the default device is /dev/dri/renderD128 which is why its probably still working though you might be getting some warnings)
Thank you, I have edited that and it still works! I have 1 issue left that I cant seem to fix, I have really bad quality output but havent set any limitations or changes to the source's quality. Any idea why this could be?
[Video]
codec = hevc_vaapi
max-bitrate = 0
bitrate-ratio =
crf = -1
crf-profiles =
preset =
codec-parameters =
dynamic-parameters = True
max-width = 0
profile =
max-level = 0.0
pix-fmt =
filter =
force-filter = False
This is from a 1080p 1.02GB h264 file to a 170MB h265 file https://i.postimg.cc/kMfYxQHX/Screenshot-2022-02-01-181200.png
I mean you basically have no quality settings chosen here and FFMPEG in general defaults to pretty poor settings Try setting your crf (which for VAAPI gets translated to the -qp parameter) to something like 22 to 25 though these are more basic FFMPEG questions you should really be researching on your own
You can also mess around with the crf-profiles / profile / and bitrate-ratio options if you want to fine tune things, see the wiki for how these work
I will try out some settings and see the result. Thanks for all the help!!
Hello,
I am trying to get sonarr-sma (and radarr-sma) working on my Synology 620slim which has great encoder support, but I cant seem to get it to work. I have tried:
-Added renderD128 to the docker export and imported it:
The permissions inside docker are: crw-rw---- 1 root videoHXcNH6jS 226, 128 Jan 27 17:21 renderD128
-Running as administrator user My PUID is set to 1026 (of my admin user) and GUID is set to the same group ID (100). This is working great for docker, it can edit all the files it needs. The docker is also run privileged
-Editing the autoProcess.ini file to: (not included lines are default)
(and added sonarr/radarr api keys)
With every edit (especially the video codec) it seems to work a little more, but the last step that I cant seem to fix is this error I get when a file is imported:
Failed to set value 'qsv=sma:/dev/dri/renderD128' for option 'init_hw_device': Cannot allocate memory
Full log:
Do you know a fix for this?