mdhiggins / sonarr-sma

Sonarr docker based on linuxserver/sonarr with SMA built in using python3
MIT License
39 stars 18 forks source link

Perform conversion prior to transferring file to NAS #48

Closed lizardfish0 closed 1 year ago

lizardfish0 commented 1 year ago

Hello,

My issue is nearly identical to #39, just looking for some clarity.

I have Plex/Sonarr/Radarr running on a separate server w/ a more powerful CPU, GPU, NVMe drive, etc. I'd like to perform the transcoding operation using this hardware. My NAS does not have a GPU or a CPU sufficient for this work, which rules out "library-side" solutions like tdarr.

Based on your response in #39, it seems like this isn't possible due to the lack of a suitable event to subscribe to in sonarr/radarr. I think the next best solution would be to direct SMA to perform the transcoding on the host system's /dev/shm, which would result in the file first being written to the NAS, then read from the NAS, then transcoded and written back to the NAS.

If possible, I'd like to reduce this back-and-forth and the network overhead it creates to a single trip.

Hoping there's a way to accomplish this! I'm not sure how to utilize the scripts mentioned in #39.

lizardfish0 commented 1 year ago

Also worth adding that my qBittorrent is hosted on a remote server. From what I can tell, the download client scripts in the sickbeard_mp4_automator repo are specific to scenarios where the client is hosted on the same device that's running SMA.

lizardfish0 commented 1 year ago

Thinking out loud, is there a way to take advantage of the remote path mappings feature in sonarr/radarr? I use syncthing to mirror my qBit downloads back to my server (the one I'd like to do the transcoding on). Presumably, qBit is unaware of syncthing's existence and just fires back an API request to sonarr/radarr when it completes the download, which triggers sonarr/radarr to wait till the file appears in the folder you specify in the remote path mappings section.

Is there anything stopping you from giving a different path? I'm thinking:

mdhiggins commented 1 year ago

You have a few options here without needing to mess with path mapping

The easiest option for /dev/shm which I use on my own setup is to just use the output-directory option. All conversion and processing of temporary files will be done in that directory and then the final product moved to the final destination

As mentioned in #39, SMA also includes a whole host of scripts to run after the download client completes, so you have the option of running things after SAB/Deluge/etc finish downloading before Radarr/Sonarr are notified that the download is complete which depending on your configuration might be more opportune. The readme covers how to set up these scripts

lizardfish0 commented 1 year ago

Right, having qBittorrent trigger a script seems like the best option. However, I'm running qBittorent on a remote VPS and then syncing the files back to my machine running the sonarr-sma container. I may be misunderstanding, but this script seems specific cases where you want to transcode media on the same machine that runs qBittorrent.

mdhiggins commented 1 year ago

Yeah in that case that's probably not what you're looking for. The output-directory option might be the way to go then

lizardfish0 commented 1 year ago

Is there any way to set up some monitored directory within the container? Could then utilize the move-to option to move the file to the directory that sonarr is monitoring.

mdhiggins commented 1 year ago

Would need a custom solution for something like that, nothing supported currently