sickbeard_mp4_automator icon indicating copy to clipboard operation
sickbeard_mp4_automator copied to clipboard

Docker Mod version

Open Protektor-Desura opened this issue 1 year ago • 7 comments

I'm trying to setup the docker mod version. I'm not getting any errors that I can currently see in any logs, but it is not processing any of the files in Sonarr.

Here is my Sonarr compose file. sonarr.yml.txt

Here is my autoProcess.ini file. autoProcess.txt

In Sonarr in settings/connect I have only On Download and On Upgrade checked. I have the script set to /usr/local/sma/postSonarr.sh

On I also included the Linuxserver Jellyfin-AMD to add Mesa upgrade to the latest version so VAAPI HEVC encoding works properly.

Do you see what might be the issue?

Protektor-Desura avatar Jul 16 '22 17:07 Protektor-Desura

I'm also curious why SMA messes with the autoProcess.ini? I mean I removed the Plex section since I don't use it and you said let ffmpeg figure out the down sample to stereo so I removed the Audio.ChannelFilters and it keeps adding it back to my autoProcess.ini as:

[Audio.ChannelFilters] 6-2 = pan=stereo|FL=0.5FC+0.707FL+0.707BL+0.5LFE|FR=0.5FC+0.707FR+0.707BR+0.5LFE

I removed Sickbeard, Sickrage, SABNZBD, Deluge, uTorrent, Plex and qBittorrent because I'm not using SMA for any of those and I don't use any of them but qBittorrent. But it keeps adding them back to the file.

Protektor-Desura avatar Jul 16 '22 18:07 Protektor-Desura

Python's ConfigParser doesn't handle missing sections well, plus as the script evolves as new options are created having missing options added to the existing config files is important. You shouldn't be deleting whole sections from the config

For plex, just set refresh = False and it won't use any of the plex settings

Similarly for all those other sections, if you're not using them those settings aren't used but they will always be added back to the config

For the ChannelFilters and Subtitle Auth sections, those are dynamic sections so I added some logic so the default lines aren't added back, though the previous behavior was to set them to blank values

583968d94de6d10b6f9a64c57b036454d1231558

As for your lack of postSonarr, can't help you much there without logs

What logs are you checking? Sonarr should have something in its logs if the actual starting of the script is failing If you've gotten beyond that you should be getting something in sma.log

You can also still use manual.py from inside the container to test things and see if you're getting stuck somewhere if for some reason you can't sort it out via the logs

/usr/local/sma/venv/bin/python3 /usr/local/sma/manual.py from inside the container

or

docker exec radarr /usr/local/sma/venv/bin/python3 /usr/local/sma/manual.py from outside

mdhiggins avatar Jul 16 '22 21:07 mdhiggins

For awhile in the docker mod version I was getting an error about b_depth when ffmpeg ran and assumed it was some kind of error for the down sampling to stereo with the supplied Audio.ChannelFilters, which I did not create. Every time I removed it to let ffmpeg auto do it like you suggested that section got auto added back. Which is why I asked in the other ticket....what 3-5 days ago about down mixing to stereo using the Audio.ChannelFilters which only has a 6 to 2 channel downmix not 7 or 8 channel downmix automatically. So since it is creating it auto how does it auto create a 7.1 audio downmixed to stereo when there is no Audio.ChannelFilters for that? There is only the 5.1 to stereo Audio.ChannelFilters automatically created. I don't see a way leave it up to ffmpeg to do it automatic, seems it NEEDS an Audio.ChannelFilters setup.

Seems to me there should be an auto created 7 (6.1) to 2 and 8 (7.1) to 2 version for stereo downmixing.

Protektor-Desura avatar Jul 17 '22 03:07 Protektor-Desura

You are mistaken and I think didn't closely read what I typed out above

It's an artifact from the way the script handles ensuring the config file is up to date and that all options are present.

The old code is here if it helps you conceptualize what's happening

        # Make sure all sections and all keys for each section are present
        for s in self.DEFAULTS:
            if not config.has_section(s):
                config.add_section(s)
                write = True
            for k in self.DEFAULTS[s]:
                if not config.has_option(s, k):
                    config.set(s, k, str(self.DEFAULTS[s][k]))
                    write = True

This code was changed in the latest update inspired by this post

That being said, I agree that for dynamic sections that could theoretically grow and contain a number of options (for example the channel filters and subtitle auth sections, again as discussed above) they probably should have been excluded from adding the default options back in because its counter intuitive.

That being said, to disable 6-2 using the OLD version you would just need to blank out the filter line

[Audio.ChannelFilters]
6-2 = 

On the new update https://github.com/mdhiggins/sickbeard_mp4_automator/commit/583968d94de6d10b6f9a64c57b036454d1231558, if you delete the 6-2 line it won't be added back (the section will still get recreated just not 6-2).

[Audio.ChannelFilters]

how does it auto create a 7.1 audio downmixed to stereo when there is no Audio.ChannelFilters for that

FFMPEG can downmix channels without needing to specify a filter, the Audio.ChannelFilters option is designed to just give more customization to selectively apply an audio filter when downmixing beyond the FFMPEG default. It was a requested feature here https://github.com/mdhiggins/sickbeard_mp4_automator/issues/1406

The 6-2 option was included as a sample really just for reference. It is by far the most common downmix combination.

And finally

The docker containers are updated weekly (for the most part) so they may not include the latest version of SMA when I make changes like this until the next rebuild but if you set the SMA_UPDATE environment variable in your docker container to true and restart that container it will do a fresh pull from the github repo and allow you stay on the latest commits, this is outlined in the readme

https://github.com/mdhiggins/sma-mod#environment-variables

mdhiggins avatar Jul 17 '22 12:07 mdhiggins

I do like the auto update functions and use it. I hope the new version fixes my problems. I will give it a try tomorrow. The reason I think there is some issue with the docker mod or something is I'm currently using a sonarr-sma version that has everything combined and it works perfect. So I just copied over my autoProcessing.ini so I just assumed it would just work. I'm currently using: https://github.com/RandomNinjaAtk/docker-sonarr-sma

I'm trying to use the mod version because I technically also need the linuxserver:jellyfin-amd docker mod as well both for your version and well all versions of SMA. The reason is you can't used VAAPI to encode H.265/HEVC without running Mesa 21+ inside the docker. So my plan is to combine your SMA docker mode with Jellyfin-AMD docker mod to get everything working 100% for Sonarr & Lidarr for VAAPI hardware encoding. I prefer using the mods because it means I can use specific versions of Sonarr & Radarr when their are bugs with tying it to old versions of SMA or MESA.

So just as a side note for your sonarr-sma & radarr-sma combo dockers you also need to install and update to the latest MESA inside the docker. Which is another reason why docker-mods make more sense to me.

Protektor-Desura avatar Jul 17 '22 22:07 Protektor-Desura

Also if ever want to support tonemapping from HDR to SDR you will also need OpenCL support inside the docker. If you're using Intel then the Linuxserver Intel-OpenCL docker mod. It is a different requirement for AMD OpenCL which only available in the AMD Pro graphics drivers.

Protektor-Desura avatar Jul 17 '22 22:07 Protektor-Desura

The SMA_HWACCEL variable can be flagged as true to install extra packages, though I'd have to look into OpenCL support more thoroughly, but this is what's currently included

Debian

  • libva-drm2
  • libva
  • i965-va-driver
  • intel-media-va-driver
  • mesa-va-drivers

Alpine

  • libva
  • libgomp
  • vidstab
  • ca-certificates
  • libva-intel-driver
  • mesa-va-gallium

mdhiggins avatar Jul 18 '22 00:07 mdhiggins

I got some more info on supporting VIAAP encoding using OpenCL.

For Ubuntu there is pocl-opencl-icd, libpocl-dev and opencl-headers

Protektor-Desura avatar Mar 14 '24 04:03 Protektor-Desura