Code Monkey home page Code Monkey logo

sonarr-sma's Introduction

Hi there 👋

sonarr-sma's People

Contributors

justinglock40 avatar lizardfish0 avatar mdhiggins avatar oswaldb22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sonarr-sma's Issues

Error caused by log file ownership

I’m using the build setup of Sonarr-SMA & Radarr-SMA as I’m using an NVIDIA GPU to assist with the FFMPEG compute, but I’m wanting to convert my existing collection.

To do this, I’m running the manual.py from within the container, but it keeps creating logs as root. This then causes issues when SMA is called by Sonarr or Radarr, as it can’t overwrite the log file.

I’ve specified PUID (username 1000) and PGID (docker 998) as environment variables, and even set them as UID & GID in autoProcess.ini.

Am I doing something wrong? If not, could SMA write the log files as per the UID/GID in the autoProcess.ini file?

vaapi hardware encode not working

sonarr.txt
autoProcess.txt

I am trying to get vaapi hardware encoding working. The file is encoded by FFMPEG, just not using hardware. It took over 8 hours to encode the test file from yesterday and that was with the CPU pegged at 100% the whole time. Is there anything that I am missing in my docker compose or my autoProcess.ini?

I had to install the non-free driver as per a previously closed thread here to get it to stop giving errors similar to the previous thread.

I have to devices under /dev/dri/: card0 and renderD128, both of which give the same results.

Any help would be appreciated.

Any chance for sonarr v3

Hello!

Any possibility to get a container for sonarr v3 with sma inbuilt? I know v3 is in beta but it is very much stable.

Thanks in advance!

Sonarr V3 and Radarr V3 Connect/PostProcess Exit1 Using Script

I looked through various threads, and closed issues herein and been banging my head against the wall trying to figure this out. I am running Ubuntu 16.04 and calling Python3.5.

Here is the log from SonarrV3:

<html>
<body>
<!--StartFragment-->

SonarrErrorPipeline | Invalid request Validation failed: -- : Script exited with code: 1 | 5:02pm |  
-- | -- | -- | --
  | postSonarr.py | SyntaxError: invalid syntax | 5:02pm |  
  | postSonarr.py | ^ | 5:02pm |  
  | postSonarr.py | return f"{type(self).__name__}({list(self)})" | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/rebulk/utils.py", line 153 | 5:02pm |  
  | postSonarr.py | from .utils import is_iterable | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/rebulk/loose.py", line 18, in <module> | 5:02pm |  
  | postSonarr.py | from .loose import set_defaults | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/rebulk/builder.py", line 11, in <module> | 5:02pm |  
  | postSonarr.py | from .builder import Builder | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/rebulk/rebulk.py", line 8, in <module> | 5:02pm |  
  | postSonarr.py | from .rebulk import Rebulk | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/rebulk/__init__.py", line 7, in <module> | 5:02pm |  
  | postSonarr.py | from rebulk.match import Match | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/guessit/monkeypatch.py", line 9, in <module> | 5:02pm |  
  | postSonarr.py | from . import monkeypatch as _monkeypatch | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/guessit/__init__.py", line 6, in <module> | 5:02pm |  
  | postSonarr.py | from guessit import guessit | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/subliminal/core.py", line 12, in <module> | 5:02pm |  
  | postSonarr.py | from .core import (AsyncProviderPool, ProviderPool, check_video, download_best_subtitles, download_subtitles, | 5:02pm |  
  | postSonarr.py | File "/usr/local/lib/python3.5/dist-packages/subliminal/__init__.py", line 11, in <module> | 5:02pm |  
  | postSonarr.py | import subliminal | 5:02pm |  
  | postSonarr.py | File "/home/(removed)/Desktop/MKV_2_MP4/resources/mediaprocessor.py", line 21, in <module> | 5:02pm |  
  | postSonarr.py | from resources.mediaprocessor import MediaProcessor | 5:02pm |  
  | postSonarr.py | File "/home/(removed)/Desktop/MKV_2_MP4/postSonarr.py", line 10, in <module> | 5:02pm |  
  | postSonarr.py | Traceback (most recent call last):

<!--EndFragment-->
</body>
</html>

.sh Script

#!/bin/bash
/usr/bin/python3.5 [path to postsonarr.py]

Sonarr V3 will not accept script arguments

Hi,

Just tried the preview tagged image to see how Sonarr V3 looks.

It will not accept an argument for the path as suggested. Entering:

/usr/local/sma/env/bin/python3 /usr/local/sma/postSonarr.py

results in 'File does not exist' message and the save is refused.

A workaround shell script containing '/usr/local/sma/env/bin/python3 /usr/local/sma/postSonarr.py" is also not accepted. Error message is 'Script exited with code: 255'

Any thoughts for a fix or a workaround?

Thanks

Use VAAPI ffmpeg on Synology

You write that the "build" tag can be used to get a version of ffmpeg that supports VAAPI.

I'm using your image on a Synology NAS and have spent some hours trying to figure out how to do this, but to no avail. Do you have any idea, how to get a VAAPI version of your image running in Docker on a Synology? Thank you!

Suggestion, auto-update on startup

So instead of having to push new image builds, to update the script every time, if a start-up script was used to pull down the latest code That would mean you only need to update the image to facilitate dependency changes.

Container not updated

I was under the impression that when the linuxserver\sonarr container gets updated, your container gets updated too because it is based off of that container. Is this not accurate? Or do you always have to do it manually? Here's what I see in the Updates page in Sonarr:

image

I see that your container was last updated two months ago which explains why it doesn't have the lastest Sonarr version.

additional post processing script

There doesn't seem to be a simple way to invoke additional post processing after the sma portion is done. I'm not familiar enough with docker, but could I just map another volume to /usr/local/sma/post_process and it will overlay the existing directory in the container?

Upgraded to latest version and no longer working:(

Hi bro, got sonaarr and radarr to update to latest version using :
docker build https://github.com/mdhiggins/sonarr-sma.git#build --build-arg ffmpeg_tag=4.4-ubuntu2004
sonarr, latest version finally and your script installed. Using all my working config files and autoprocess.ini files as before.

Sonarr working fine, but the mp4autoamtor sadly is not converting anymore and I cant figure out why, here is my error log and autoprocess.ini file

[Converter]
ffmpeg = /usr/local/bin/ffmpeg
ffprobe = /usr/local/bin/ffprobe
threads = 0
hwaccels = dxva2, cuvid, qsv, d3d11va, vaapi
hwaccel-decoders = h264_cuvid, mjpeg_cuvid, mpeg1_cuvid, mpeg2_cuvid, mpeg4_cuvid, vc1_cuvid, hevc_qsv, h264_qsv, hevc_vaapi, h264_vaapi
hwdevices = vaapi:/dev/dri/renderD128
hwaccel-output-format = vaapi:vaapi
output-directory =
output-format = mp4
output-extension = mp4
temp-extension = xxx
minimum-size = 10
ignored-extensions = nfo, ds_store
copy-to =
move-to =
delete-original = True
sort-streams = True
process-same-extensions = True
force-convert = True
post-process = False
wait-post-process = False
detailed-progress = False
preopts =
postopts =
bypass-if-copying-all = False
opts-separator = ,
regex-directory-replace = [^\w\-_\. ]

[Permissions]
chmod = 0644
uid = -1
gid = -1

[Metadata]
relocate-moov = True
full-path-guess = True
tag = True
tag-language = eng
download-artwork = Thumbnail
sanitize-disposition =
strip-metadata = False
keep-titles = False

[Video]
codec = h264, x264
max-bitrate = 4000
crf = 23
crf-profiles = 1280:23:4M:12M
preset = veryfast
codec-parameters =
dynamic-parameters = False
max-width = 1280
profile = main
max-level = 3.1
pix-fmt = yuv420p
filter =
force-filter = False
bitrate-ratio =

[HDR]
pix-fmt = yuv420p
space = bt2020nc
transfer = smpte2084
primaries = bt2020
preset =
codec-parameters =
filter =
force-filter = False
codec =
profile =

[Audio]
codec = libfdk_aac
languages =
default-language = Eng
first-stream-of-language = False
allow-language-relax = True
channel-bitrate = 64
max-bitrate = 0
max-channels = 6
prefer-more-channels = True
default-more-channels = True
filter =
force-filter = True
sample-rates =
copy-original = False
aac-adtstoasc = False
ignore-truehd = mp4, m4v
ignored-dispositions = True
unique-dispositions = True
sample-format =
copy-original-before = False
stream-codec-combinations =

[Universal Audio]
codec =
channel-bitrate = 64
first-stream-only = False
move-after = False
filter =
force-filter = False

[Subtitle]
codec = mov_text
codec-image-based =
languages =
default-language =
first-stream-of-language = False
encoding = utf8
burn-subtitles = False
burn-dispositions =
embed-subs = True
embed-image-subs = False
embed-only-internal-subs = False
filename-dispositions = forced
ignore-embedded-subs = False
ignored-dispositions =
unique-dispositions = False
attachment-codec = srt

[Sonarr]
host = 127.0.0.1
port = 8989
apikey =
ssl = False
webroot =
force-rename = False
rescan = True
block-reprocess = False

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

error log:

2021-11-03 10:39:31 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2021-11-03 10:39:31 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2021-11-03 10:39:31 - resources.readsettings - DEBUG - Loading default config file.
2021-11-03 10:39:31 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2021-11-03 10:39:31 - resources.readsettings - WARNING - Force-convert is true, so process-same-extensions is being overridden to true as well
2021-11-03 10:39:31 - SonarrPostProcess - DEBUG - environ({'sonarr_series_title': 'Last Week Tonight with John Oliver', 'XDG_CONFIG_HOME': '/config/.config', 'LANG': 'en_US.UTF-8', 'HOSTNAME': 'b2a58463d15a', 'sonarr_series_id': '1840', 'OLDPWD': '/run/s6/services/sonarr', 'sonarr_episodefile_sourcefolder': '/data/usenet/tvshows/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta', 'sonarr_episodefile_qualityversion': '1', 'sonarr_episodefile_quality': 'HDTV-1080p', 'sonarr_episodefile_releasegroup': 'MeGusta', 'sonarr_download_client': '', 'sonarr_episodefile_path': '/data/tvshows/Last Week Tonight with John Oliver (2014)/Season 8/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta.mkv', 'sonarr_episodefile_episodeids': '77394', 'sonarr_episodefile_scenename': 'Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta', 'PUID': '1000', 'sonarr_episodefile_episodenumbers': '28', 'sonarr_series_path': '/data/tvshows/Last Week Tonight with John Oliver (2014)', 'sonarr_eventtype': 'Download', 'sonarr_episodefile_id': '78350', 'sonarr_episodefile_sourcepath': '/data/usenet/tvshows/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta.mkv', 'sonarr_episodefile_episodeairdates': '2021-10-31', 'PGID': '1000', 'PWD': '/app/sonarr/bin', 'SMA_RS': 'Sonarr', 'HOME': '/root', 'sonarr_download_id': '', 'sonarr_series_type': 'Standard', 'sonarr_series_tvdbid': '278518', 'sonarr_series_tvmazeid': '263', 'No_Expand': 'true', 'sonarr_episodefile_episodecount': '1', 'sonarr_episodefile_seasonnumber': '8', 'TERM': 'xterm', 'sonarr_episodefile_episodetitles': 'Episode 237', 'No_SQLiteFunctions': 'true', 'No_PreLoadSQLite': 'true', 'SHLVL': '1', 'LANGUAGE': 'en_US.UTF-8', 'CWD': '/', 'sonarr_series_imdbid': 'tt3530232', 'sonarr_episodefile_episodeairdatesutc': '11/1/2021 3:00:00 AM', 'sonarr_episodefile_relativepath': 'Season 8/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta.mkv', 'SMA_PATH': '/usr/local/sma', 'SONARR_BRANCH': 'phantom-develop', 'XDG_DATA_HOME': '/config/.config/share', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'SMA_UPDATE': 'false', 'No_SQLiteXmlConfigFile': 'true', 'sonarr_isupgrade': 'False', '_': '/usr/local/sma/venv/bin/python3'})
2021-11-03 10:39:31 - SonarrPostProcess - DEBUG - Input file: /data/tvshows/Last Week Tonight with John Oliver (2014)/Season 8/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta.mkv.
2021-11-03 10:39:31 - SonarrPostProcess - DEBUG - Original name: Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta.
2021-11-03 10:39:31 - SonarrPostProcess - DEBUG - TVDB ID: 278518.
2021-11-03 10:39:31 - SonarrPostProcess - DEBUG - Season: 8 episode: 28.
2021-11-03 10:39:31 - SonarrPostProcess - DEBUG - Sonarr series ID: 1840.
2021-11-03 10:39:31 - resources.mediaprocessor - DEBUG - Invalid source, no data returned.
2021-11-03 10:39:31 - resources.mediaprocessor - INFO - File /data/tvshows/Last Week Tonight with John Oliver (2014)/Season 8/Last.Week.Tonight.with.John.Oliver.S08E28.1080p.HEVC.x265-MeGusta.mkv is not valid
2021-11-03 10:39:31 - SonarrPostProcess - INFO - Processing returned False.
2021-11-03 10:39:31 - SonarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
File "/usr/local/sma/postSonarr.py", line 307, in
sys.exit(1)
SystemExit: 1

QSV not working on 620slim

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:

  "devices": [
    {
      "CgroupPermissions": "rwm",
      "PathInContainer": "/dev/dri/renderD128",
      "PathOnHost": "/dev/dri/renderD128"
    }
  ]

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)

[Converter]
hwaccel-decoders = h265qsv,hevc_vaapi,hevcqsv,hevc_qsv,h264qsv,h264vaapi,h264,x264,h265,x265,hevc
hwdevices = qsv:/dev/dri/renderD128

[Video]
codec = h265qsv,hevc_vaapi,hevcqsv,hevc_qsv

[Audio]
codec = ac3

(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:

2022-01-27 04:00:02 - resources.mediaprocessor - INFO - {
    "source": [
        "/tv/The Simpsons/Season 33/The.Simpsons.S33E03.1080p.WEB.H264-CAKES[rarbg].mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "h265qsv",
        "map": 0,
        "bitrate": 4162.1856,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "preset": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "title": "FHD",
        "debug": "video",
        "device": "sma"
    },
    "audio": [
        {
            "map": 1,
            "codec": "copy",
            "channels": 2,
            "bitrate": 256,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "title": "Stereo",
            "debug": "universal-audio"
        }
    ],
    "subtitle": [
        {
            "map": 2,
            "codec": "mov_text",
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "title": null,
            "debug": "subtitle.embed-subs"
        }
    ],
    "attachment": []
}
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - Preopts
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - [
    "-fix_sub_duration",
    "-init_hw_device",
    "qsv=sma:/dev/dri/renderD128"
]
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - Postopts
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - Starting conversion.
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - FFmpeg command:
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - ======================
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - /usr/local/bin/ffmpeg -fix_sub_duration -init_hw_device qsv=sma:/dev/dri/renderD128 -i "/tv/The Simpsons/Season 33/The.Simpsons.S33E03.1080p.WEB.H264-CAKES[rarbg].mkv" -vcodec hevc_qsv -map 0:0 -field_order progressive -vb 4162k -metadata:s:v BPS=4162000 -metadata:s:v BPS-eng=4162000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -tag:v hvc1 -c:a:0 copy -map 0:1 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y "/tv/The Simpsons/Season 33/The.Simpsons.S33E03.1080p.WEB.H264-CAKES[rarbg].mp4"
2022-01-27 04:00:02 - resources.mediaprocessor - INFO - ======================
2022-01-27 04:00:02 - resources.mediaprocessor - ERROR - Error converting file, FFMPEG error.
Traceback (most recent call last):
  File "/usr/local/sma/resources/mediaprocessor.py", line 1825, in convert
    for timecode, debug in conv:
  File "/usr/local/sma/converter/__init__.py", line 334, in convert
    postopts=postopts):
  File "/usr/local/sma/converter/ffmpeg.py", line 736, in convert
    total_output, pid=p.pid)
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
2022-01-27 04:00:02 - resources.mediaprocessor - ERROR - /usr/local/bin/ffmpeg -fix_sub_duration -init_hw_device qsv=sma:/dev/dri/renderD128 -i /tv/The Simpsons/Season 33/The.Simpsons.S33E03.1080p.WEB.H264-CAKES[rarbg].mkv -vcodec hevc_qsv -map 0:0 -field_order progressive -vb 4162k -metadata:s:v BPS=4162000 -metadata:s:v BPS-eng=4162000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -tag:v hvc1 -c:a:0 copy -map 0:1 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=eng -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 0:2 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=eng -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y /tv/The Simpsons/Season 33/The.Simpsons.S33E03.1080p.WEB.H264-CAKES[rarbg].mp4
2022-01-27 04:00:02 - resources.mediaprocessor - ERROR - ffmpeg version 5.0-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      57. 17.100 / 57. 17.100
  libavcodec     59. 18.100 / 59. 18.100
  libavformat    59. 16.100 / 59. 16.100
  libavdevice    59.  4.100 / 59.  4.100
  libavfilter     8. 24.100 /  8. 24.100
  libswscale      6.  4.100 /  6.  4.100
  libswresample   4.  3.100 /  4.  3.100
  libpostproc    56.  3.100 / 56.  3.100
Device creation failed: -12.
Failed to set value 'qsv=sma:/dev/dri/renderD128' for option 'init_hw_device': Cannot allocate memory
Error parsing global options: Cannot allocate memory

2022-01-27 04:00:02 - SonarrPostProcess - INFO - Processing returned False.
2022-01-27 04:00:02 - 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

Do you know a fix for this?

Update build using args

Hi there, just want to say a huge thankyou for all your hard word, it is truly appreciated and the scripts are amazing:)
I have achieved what i need your brilliant scripts todo:)

As you sujested to make an image with sonarr/sma v3 version with ffmpeg version using --enable-libfdk_aac

docker build https://github.com/mdhiggins/sonarr-sma.git#build --build-arg ffmpeg_tag=4.2-ubuntu --build-arg sonarr_tag=preview

There has been numerous update on sonarr since i built this image last week, so Im just wondering the comman so i can force an update of your image ,but keep all the fuctionablilty of v3 sonarr and the correct version of ffmpeg?

Unable to Perform Local Rename & Conversion Prior to Moving/Sorting on NAS

Issue/Question:
Is it possible to configure my autoProcess.ini file such that files are:
Passed to Sonarr for Renaming --> Converted (locally Device1 ) --> Moved/Sorted (Device2 = NAS)
Or Would I need a custom script?

Current Configuration (2-devices):
Device1 = Server Running Docker
Device2 = NAS

Current Setup:

  1. Completed Files are Passed to Sonarr for Renaming (Device1)
  2. --> Moved/Sorted to NAS (Device1 --> Device2)
  3. <--> Device1 Converts Files over the Network (Device1 <--Network Overhead--> Device2)

Problems:

  1. Slow Due to Unnecessary local network traffic
  2. Writes files 3x to my NAS .mkv + m4v + qtfs.

Ideal Setup:

  1. Pass Completed Files to Sonarr for Renaming (Device1)
  2. --> Convert Files Locally in Temporary Directory (Device1)
  3. --> Move & Sort (Device1 --> Device2)

FFMPEG-VAAPI

Thanks for all of your great work on this project!
I am a bit of a noob so please excuse me if my comments are too ambiguous.

I have been trying to use sonarr-sma and radarr-sma containers to transcode with VAAPI hardware acceleration (jrottenberg static images). I have been using the #build tag as per the README. This has worked well with radarr-sma but there are missing dependencies for sonarr-sma which causes ffmpeg to fail.

I believe the reason may be that the ffmpeg VAAPI binaries have been based off focal. Radarr has recently been rebased to focal which is why the multi stage build works (with all required dependencies). Sonarr is still on a bionic base (mono) and therefore there are missing dependencies.

Docker on Raspberry Pi

Is there a way to get this and the Radarr one running on a Raspberry Pi docker machine?

postSonarr.sh doesn't have executable permission

I'm not certain what, if anything, has gone wrong, but it seems postSonarr.sh and maybe others, have lost permissions. Here's what I see in portainer when I connect to the container and do ls -l:

image

Is there something else that needs to be done? I'm going to run a chmod +x postSonarr.sh, but wanted to see if there's something else to do.

Both sonarr-sma & radarr-sma

When running manual.py, get the error

root@e3dcba9759e7:~# /usr/local/sma/manual.py
Traceback (most recent call last):
File "/usr/local/sma/manual.py", line 5, in
import guessit
ModuleNotFoundError: No module named 'guessit'

Learning and need help with installation

Hello I'm using docker desktop on windows and having some trouble getting set up.

It says for me to use NVENC I should choose the jrottenberg/ffmpeg's method which I got installed but I'm running into a problem getting Prowlarr to connect with Sonarr since the 'build' version is using Sonarr v2.

When I was using the "latest" version it was on v3 and I had no issues connecting with Prowlarr. I want to be able to use my GPU though so that's why I'm trying to migrate over to this build.

SMA Config not abiding by environmental variables

Set up my docker container with instructions listed in the docker-hub and github information, however it appears that the SMA part that is integrating into the linuxserver sonarr container is not following the set environmental values as expected (PUID and PGID).

Tested this on two different servers, locations and same outcome.

Error in "/usr/local/sma/resources/mediaprocessor.py", line 261, in videoStreamTitle

Getting the following error when converting from MKV to MP4. I think it is related to https://github.com/mdhiggins/sonarr-sma/issues/29. However, this fix has not been pulled into the latest sonarr and radarr containers.

Log file:
2022-06-11 21:03:22 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2022-06-11 21:03:22 - resources.readsettings - INFO - /usr/local/sma/venv/bin/python3
2022-06-11 21:03:22 - resources.readsettings - DEBUG - Loading default config file.
2022-06-11 21:03:22 - resources.readsettings - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2022-06-11 21:03:22 - SonarrPostProcess - DEBUG - environ({'SMA_UPDATE': 'false', 'sonarr_episodefile_sourcepath': '/shared/Downloaded/sonarr/For.All.Mankind.S03E01.720p.WEB.H264-GGEZ[rarbg]/for.all.mankind.s03e01.720p.web.h264-ggez.mkv', 'sonarr_isupgrade': 'False', 'PUID': '0', 'sonarr_episodefile_id': '133188', 'HOSTNAME': '3c4c6fe27088', 'LANGUAGE': 'en_US.UTF-8', 'sonarr_episodefile_relativepath': 'Season 3/For All Mankind - S03E01 - Polaris [WEBDL-720p].mkv', 'sonarr_series_id': '158', 'sonarr_series_tvdbid': '356202', 'XDG_CONFIG_HOME': '/config/xdg', 'No_PreLoadSQLite': 'true', 'sonarr_episodefile_episodeids': '169045', 'sonarr_download_client': 'qBittorent', 'sonarr_episodefile_path': '/shared/TV Shows/For All Mankind/Season 3/For All Mankind - S03E01 - Polaris [WEBDL-720p].mkv', 'No_SQLiteFunctions': 'true', 'sonarr_episodefile_sourcefolder': '/shared/Downloaded/sonarr/For.All.Mankind.S03E01.720p.WEB.H264-GGEZ[rarbg]', 'PWD': '/app/sonarr/bin', 'sonarr_episodefile_qualityversion': '1', 'sonarr_episodefile_quality': 'WEBDL-720p', 'HOME': '/root', 'LANG': 'en_US.UTF-8', 'sonarr_episodefile_seasonnumber': '3', 'sonarr_series_path': '/shared/TV Shows/For All Mankind', 'sonarr_episodefile_episodeairdatesutc': '6/10/2022 4:00:00 AM', 'PGID': '0', 'sonarr_episodefile_episodecount': '1', 'sonarr_series_title': 'For All Mankind', 'sonarr_download_client_type': 'qBittorrent', 'SMA_FFMPEG_URL': 'https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz', 'sonarr_series_tvmazeid': '41414', 'sonarr_episodefile_episodetitles': 'Polaris', 'sonarr_episodefile_episodenumbers': '1', 'TERM': 'xterm', 'sonarr_eventtype': 'Download', 'sonarr_episodefile_episodeairdates': '2022-06-10', 'SHLVL': '1', 'SMA_PATH': '/usr/local/sma', 'sonarr_series_imdbid': 'tt7772588', 'SMA_RS': 'Sonarr', 'CWD': '/', 'sonarr_series_type': 'Standard', 'PATH': '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', 'No_SQLiteXmlConfigFile': 'true', 'SONARR_BRANCH': 'main', 'sonarr_download_id': '60DF44E2FD02C77E3F245FFB732B89E55D51A17E', 'No_Expand': 'true', 'sonarr_episodefile_scenename': 'For.All.Mankind.S03E01.720p.WEB.H264-GGEZ', 'OLDPWD': '/run/s6/services/sonarr', 'sonarr_episodefile_releasegroup': 'GGEZ', '_': '/usr/local/sma/venv/bin/python3'})
2022-06-11 21:03:22 - SonarrPostProcess - DEBUG - Input file: /shared/TV Shows/For All Mankind/Season 3/For All Mankind - S03E01 - Polaris [WEBDL-720p].mkv.
2022-06-11 21:03:22 - SonarrPostProcess - DEBUG - Original name: For.All.Mankind.S03E01.720p.WEB.H264-GGEZ.
2022-06-11 21:03:22 - SonarrPostProcess - DEBUG - TVDB ID: 356202.
2022-06-11 21:03:22 - SonarrPostProcess - DEBUG - Season: 3 episode: 1.
2022-06-11 21:03:22 - SonarrPostProcess - DEBUG - Sonarr series ID: 158.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Processing /shared/TV Shows/For All Mankind/Season 3/For All Mankind - S03E01 - Polaris [WEBDL-720p].mkv.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Process started.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Found forced in stream title, setting forced disposition to True.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Input Data
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - {
"format": "matroska,webm",
"format-fullname": "Matroska / WebM",
"video": {
"index": 0,
"codec": "h264",
"pix_fmt": "yuv420p",
"profile": "high",
"fps": 23.976023976023978,
"framedata": {
"pix_fmt": "yuv420p",
"color_space": "bt709",
"color_primaries": "bt709",
"color_transfer": "bt709",
"side_data_list": [
{
"side_data_type": "H.26[45] User Data Unregistered SEI message"
}
]
},
"dimensions": "1356x678",
"level": 3.2,
"field_order": "progressive"
},
"audio": [
{
"index": 1,
"codec": "eac3",
"bitrate": 768000,
"channels": 6,
"samplerate": 48000,
"language": "eng",
"disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
}
],
"subtitle": [
{
"index": 2,
"codec": "subrip",
"disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired-captions",
"language": "eng"
},
{
"index": 3,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "eng"
},
{
"index": 4,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ara"
},
{
"index": 5,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "bul"
},
{
"index": 6,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "zho"
},
{
"index": 7,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "zho"
},
{
"index": 8,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "zho"
},
{
"index": 9,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ces"
},
{
"index": 10,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "dan"
},
{
"index": 11,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "nld"
},
{
"index": 12,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "est"
},
{
"index": 13,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "spa"
},
{
"index": 14,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "fin"
},
{
"index": 15,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "fra"
},
{
"index": 16,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "fra"
},
{
"index": 17,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "deu"
},
{
"index": 18,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ell"
},
{
"index": 19,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "heb"
},
{
"index": 20,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "hin"
},
{
"index": 21,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "hun"
},
{
"index": 22,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ind"
},
{
"index": 23,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ita"
},
{
"index": 24,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "jpn"
},
{
"index": 25,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "kor"
},
{
"index": 26,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "spa"
},
{
"index": 27,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "lav"
},
{
"index": 28,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "lit"
},
{
"index": 29,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "msa"
},
{
"index": 30,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "nor"
},
{
"index": 31,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "pol"
},
{
"index": 32,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "por"
},
{
"index": 33,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "por"
},
{
"index": 34,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "rus"
},
{
"index": 35,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "slk"
},
{
"index": 36,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "slv"
},
{
"index": 37,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "swe"
},
{
"index": 38,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "tam"
},
{
"index": 39,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "tel"
},
{
"index": 40,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "tha"
},
{
"index": 41,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "tur"
},
{
"index": 42,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "ukr"
},
{
"index": 43,
"codec": "subrip",
"disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
"language": "vie"
}
],
"attachment": []
}
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Reading video stream.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Video codec detected: h264.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Profile: high.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Stream is not HDR, color parameter bt709 does not match ['bt2020nc'] [hdr-['bt2020nc']].
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Pool of video codecs is ['h265', 'hevc'].
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Total bitrate is 3590492.0.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Total audio bitrate is 768000.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Estimated video bitrate is 2822492.0.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Using video bitrate ratio of 1.000000, which results in 2681.367400 changing to 2681.367400.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Overriding video bitrate. Codec cannot be copied because video bitrate is too high [video-max-bitrate].
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video width is over the max width, it will be downsampled. Video stream can no longer be copied [video-max-width].
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Source bit-depth 8, output 0, using depth 8.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video codec: h265.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video bitrate: 2500.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video CRF: -1.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video maxrate: None.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video bufsize: None.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video level: 0.0.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video profile: None.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video preset: None.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video pix_fmt: None.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video field order: progressive.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video width: 1280.
2022-06-11 21:03:22 - resources.mediaprocessor - DEBUG - Video debug video.max-bitrate.max-width.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Video codec parameters None.
2022-06-11 21:03:22 - resources.mediaprocessor - INFO - Creating h265 video stream from source stream 0.
2022-06-11 21:03:22 - resources.mediaprocessor - ERROR - Unable to generate options, unexpected exception occurred.
Traceback (most recent call last):
File "/usr/local/sma/resources/mediaprocessor.py", line 128, in process
options, preopts, postopts, ripsubopts, downloaded_subs = self.generateOptions(inputfile, info=info, original=original, tagdata=tagdata)
File "/usr/local/sma/resources/mediaprocessor.py", line 828, in generateOptions
video_settings['title'] = self.videoStreamTitle(info.video, video_settings, hdr=vHDR)
File "/usr/local/sma/resources/mediaprocessor.py", line 261, in videoStreamTitle
if width >= 7600 or height >= 4300:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
2022-06-11 21:03:22 - SonarrPostProcess - INFO - Processing returned False.
2022-06-11 21:03:22 - SonarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
File "/usr/local/sma/postSonarr.py", line 325, in
sys.exit(1)
SystemExit: 1

autoProcess.ini
[Converter]
ffmpeg = /usr/local/bin/ffmpeg
ffprobe = /usr/local/bin/ffprobe
threads = 0
hwaccels =
hwaccel-decoders =
hwdevices = vaapi:/dev/dri/renderD12
hwaccel-output-format = vaapi:vaapi
output-directory =
output-format = mp4
output-extension = mp4
temp-extension =
temp-output = False
minimum-size = 0
ignored-extensions = nfo, ds_store
copy-to =
move-to =
delete-original = True
process-same-extensions = True
bypass-if-copying-all = False
force-convert = False
post-process = False
wait-post-process = False
detailed-progress = False
opts-separator = ,
preopts =
postopts =
regex-directory-replace = [^\w\-_\. ]

[Permissions]
chmod = 0777
uid = 1000
gid = 1000

[Metadata]
relocate-moov = True
full-path-guess = True
tag = True
tag-language = eng
download-artwork = poster
sanitize-disposition =
strip-metadata = False
keep-titles = False

[Video]
codec = h265, hevc
max-bitrate = 2500
bitrate-ratio =
crf = -1
crf-profiles =
preset =
codec-parameters =
dynamic-parameters = False
max-width = 1280
profile =
max-level = 0.0
pix-fmt =
prioritize-source-pix-fmt = True
filter =
force-filter = False

[HDR]
codec =
pix-fmt =
space = bt2020nc
transfer = smpte2084
primaries = bt2020
preset =
codec-parameters =
filter =
force-filter = False
profile =

[Audio]
codec = ac3
languages =
default-language =
first-stream-of-language = False
allow-language-relax = True
channel-bitrate = 128
variable-bitrate = 0
max-bitrate = 0
max-channels = 0
filter =
profile =
force-filter = False
sample-rates =
sample-format =
copy-original = False
aac-adtstoasc = False
ignored-dispositions =
unique-dispositions = False
stream-codec-combinations =

[Audio.Sorting]
sorting = language, channels.d, map, d.comment
default-sorting = channels.d, map, d.comment
codecs =

[Universal Audio]
codec = aac
channel-bitrate = 128
variable-bitrate = 0
first-stream-only = False
filter =
profile =
force-filter = False

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

[Subtitle]
codec = mov_text
codec-image-based =
languages =
default-language =
first-stream-of-language = False
encoding =
burn-subtitles = False
burn-dispositions =
embed-subs = True
embed-image-subs = False
embed-only-internal-subs = False
filename-dispositions = forced
ignore-embedded-subs = False
ignored-dispositions =
unique-dispositions = False
attachment-codec =
remove-bitstream-subs = False

[Subtitle.Sorting]
sorting = language, d.comment, d.default.d, d.forced.d
codecs =

[Subtitle.CleanIt]
enabled = False
config-path =
tags =

[Subtitle.Subliminal]
download-subs = False
download-hearing-impaired-subs = False
providers =

[Subtitle.Subliminal.Auth]
opensubtitles =
tvsubtitles =

[Sonarr]
host = 127.0.0.1
port = 8989
apikey = XXXXXXXXXXXXXXXXXXXXX
ssl = False
webroot =
force-rename = False
rescan = True
block-reprocess = False

[Radarr]
host = 127.0.0.1
port = 7878
apikey = XXXXXXXXXXXXXXXXXXXXXXXX
ssl = False
webroot =
force-rename = False
rescan = True
block-reprocess = False

[Sickbeard]
host = localhost
port = 8081
ssl = False
apikey =
webroot =
username =
password =

[Sickrage]
host = localhost
port = 8081
ssl = False
apikey =
webroot =
username =
password =

[SABNZBD]
convert = True
sickbeard-category = sickbeard
sickrage-category = sickrage
sonarr-category = sonarr
radarr-category = radarr
bypass-category = bypass
output-directory =
path-mapping =

[Deluge]
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
host = localhost
port = 58846
username =
password =
output-directory =
remove = False
path-mapping =

[qBittorrent]
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
action-before =
action-after =
host = localhost
port = 8080
ssl = False
username =
password =
output-directory =
path-mapping =

[uTorrent]
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
webui = False
action-before =
action-after =
host = localhost
ssl = False
port = 8080
username =
password =
output-directory =
path-mapping =

[Plex]
host = XXXXXXXXXXXXXXXXXXXXXX
port = 32400
refresh = False
token = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Script exited with error code: 1

I recently noticed that my files were not being processed. When I run a test on the postSonarr.sh under connection I get "Script exited with error code: 1"

Post Processing Not Working

Hey Mike,

Happy New Year!

I have an issue in the past couple of days where post processing isn't working. Sonarr just kind of hangs there and the download never officially completes. I read Issue #54 from a few days ago and tried re-pulling everything but no change. Unfortunately the logs aren't much help. sma.log shows literally nothing and sonarr.txt shows nothing beyond the search is complete and report sent to SABnzbd for download. Not sure how we troubleshoot this. I think I have the same issue with radarr-sma.

Sonarr Version:
Version
4.0.0.748
Package Version
4.0.0.748 by linuxserver.io
.NET
Yes (6.0.13)
Docker
Yes
Database
Sqlite 3.44.2
AppData directory
/config
Startup directory
/app/sonarr/bin

Sonarr-sma Version:

Sonarr-sma is running as a docker container using the latest tag: The new image was upadted a few days ago and then I tried re-pulling it today as mentionned above.

REPOSITORY TAG IMAGE ID CREATED SIZE
mdhiggins/radarr-sma nightly 5bb14a1f7213 18 hours ago 346MB
mdhiggins/sonarr-sma latest 2eebce07508d 3 days ago 342MB

Sonarr.txt Log when starting a download:

2024-01-04 22:49:17.1|Info|DownloadDecisionMaker|Processing 200 releases
2024-01-04 22:49:18.0|Info|RssSyncService|RSS Sync Completed. Reports found: 200, Reports grabbed: 0
2024-01-04 23:00:27.9|Info|ReleaseSearchService|Searching indexers for [Tehran : S01E01]. 2 active indexers
2024-01-04 23:00:37.2|Info|DownloadDecisionMaker|Processing 31 releases
2024-01-04 23:00:41.2|Info|Sabnzbd|Adding report [Tehran.S01E01.Emergency.Landing.in.Tehran.1080p.Blu-ray.Remux.AVC.DTS-HD.MA.5.1-SiCFoI] to the queue.
2024-01-04 23:00:41.5|Info|DownloadService|Report sent to SABnzbd. Indexer NZBGeek. Tehran.S01E01.Emergency.Landing.in.Tehran.1080p.Blu-ray.Remux.AVC.DTS-HD.MA.5.1-SiCFoI
2024-01-04 23:00:43.8|Info|EpisodeSearchService|Episode search completed. 1 reports downloaded.

**** IT JUST HANGS HERE EVENTHOUGH THE DOWNLOAD IS COMPLETE IN SAB *****

2024-01-04 23:04:44.8|Info|RssSyncService|Starting RSS Sync
2024-01-04 23:04:46.6|Info|DownloadDecisionMaker|Processing 200 releases
2024-01-04 23:04:46.8|Info|RssSyncService|RSS Sync Completed. Reports found: 200, Reports grabbed: 0

Sma.log last entry was Jan 4th at 03:11 UTC:

-rw-rw-r-- 1 eric eric 66933537 Jan 4 03:11 sma.log
eric@ubuntu-backend-services1:/config/sickbeard_mp4_automator/sonarr-sma$ tail -f sma.log
2024-01-04 03:08:43 - qtfaststart - INFO - Patching co64 with 1577 entries
2024-01-04 03:08:43 - qtfaststart - INFO - Patching co64 with 1527 entries
2024-01-04 03:08:43 - qtfaststart - INFO - Patching co64 with 1575 entries
2024-01-04 03:08:43 - qtfaststart - INFO - Patching co64 with 1575 entries
2024-01-04 03:08:43 - qtfaststart - INFO - Patching co64 with 1579 entries
2024-01-04 03:08:43 - qtfaststart - INFO - Writing output...
2024-01-04 03:11:30 - SonarrPostProcess - INFO - Sonarr response from RescanSeries command: ID 3209915 started.
2024-01-04 03:11:40 - SonarrPostProcess - INFO - Rescan command completed.
2024-01-04 03:11:40 - SonarrPostProcess - INFO - Sonarr monitoring information updated for episode The Green Light.
2024-01-04 03:11:40 - SonarrPostProcess - INFO - Sonarr response from Rename command: ID 3209917 queued.

My setup has been unchanged and working fine since 2020 when I started using the sonarr-sma/radarr-sma containers.

Please let me know what info you need to diagnose.

Thanks,
Eric

No Sonarr activity queue

I'm not sure if this is an issue in Sonarr or in the particular latest Docker build of sonarr-sma but I'm not seeing my activity queue in Sonarr populated even though downloads are being grabbed, downloaded, and post-processed. What logs can I provide in order to solve this?

Support linuxserver/ffmpeg for building

Hey again!

I've been attempting to get hardware encoding working. Had some success using SMA_USE_REPO, but it looks like vaapi HEVC encoding is broken in the version of ffmpeg that is installed by that repo (see intel-media-driver issue here).

linuxserver.io has abandoned their mono containers and now bases their images on 22.04 Jammy, so I was hopeful that jrottenberg's binaries would be an option. They are only built up to 20.04 though, and I'm getting all sorts of dkpg errors trying to use them within the latest sonarr image.

linuxserver/ffmpeg, however, is built for Jammy and includes vaapi, oneVPL, and nvenc support. My docker-fu isn't good enough to know if it's possible to use this the same way, but it would be a convenient alternative to having to mount a binary into the container and keep that updated manually.

Requesting NVENC enabled script or environment variable.

Good morning,

I have been utiilizing your docker for a few months now and find it great. I would like to know if there is a method to utilize NVENC hardware acceleration for ffmpeg. I feel like there is a method I can employ by changing the script it calls but I cannot find it. I am utilizing your docker but am unable to locate any autoprocess.ini or the postSonarr/postRadarr.py files. I have tried mounting all the volumes used in your docker and tried finding it through the docker console. Any assistance or updated release would be appreciated!

Thank you.

ffmpeg vaapi error

I have sonarr-sma and radarr-sma containers set up using the same docker-compose.yaml structure but hwaccel processing has started failing in my sonarr-sma container recently. I've tried ubuntu/alpine builds and different versions of ffmpeg without luck. Any help would be great.

When I don't build the ffmpeg error in sma.log seems to be

[AVHWDeviceContext @ 0x5606b1fecac0] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value 'vaapi=sma:/dev/dri/renderD128' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

or when I do build I get errors like 'could not allocate memory'.

Here's an example of a failed manual conversion on sonarr-sma and a successful conversion of the same file in radarr-sma

sonarr-sma manual.py

2022-08-21 15:48:30 - MANUAL - INFO - Manual processor started.
2022-08-21 15:48:30 - MANUAL - INFO - Python 64-bit 3.8.10 (default, Jun 22 2022, 20:18:18) 
[GCC 9.4.0].
2022-08-21 15:48:30 - MANUAL - INFO - Guessit version: 3.4.3.
2022-08-21 15:48:30 - MANUAL - INFO - /usr/local/sma/venv/bin/python3
2022-08-21 15:48:30 - MANUAL - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2022-08-21 15:48:30 - MANUAL - WARNING - Force-convert is true, so process-same-extensions is being overridden to true as well
2022-08-21 15:48:31 - MANUAL - INFO - Processing file /volume1/Downloads/test/test_file.mkv
2022-08-21 15:48:31 - MANUAL - INFO - Input Data
2022-08-21 15:48:31 - MANUAL - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 14120976,
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 23.976023976023978,
        "framedata": {
            "pix_fmt": "yuv420p",
            "color_space": "bt709",
            "color_primaries": "bt709",
            "color_transfer": "bt709"
        },
        "dimensions": "1920x1080",
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "fra",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        },
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired",
            "language": "fra"
        },
        {
            "index": 4,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired",
            "language": "eng"
        }
    ],
    "attachment": []
}
2022-08-21 15:48:31 - MANUAL - INFO - Reading video stream.
2022-08-21 15:48:31 - MANUAL - INFO - Video codec detected: h264.
2022-08-21 15:48:31 - MANUAL - INFO - Pix Fmt: yuv420p.
2022-08-21 15:48:31 - MANUAL - INFO - Profile: high.
2022-08-21 15:48:31 - MANUAL - INFO - Video codec parameters None.
2022-08-21 15:48:31 - MANUAL - INFO - Creating h265vaapi video stream from source stream 0.
2022-08-21 15:48:31 - MANUAL - INFO - Reading audio streams.
2022-08-21 15:48:31 - MANUAL - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2022-08-21 15:48:31 - MANUAL - INFO - Audio detected for stream 1 - eac3 fra 6 channel.
2022-08-21 15:48:31 - MANUAL - INFO - Creating ac3 audio stream from source stream 1.
2022-08-21 15:48:31 - MANUAL - INFO - Audio detected for stream 2 - eac3 eng 6 channel.
2022-08-21 15:48:31 - MANUAL - INFO - Creating ac3 audio stream from source stream 2.
2022-08-21 15:48:31 - MANUAL - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2022-08-21 15:48:31 - MANUAL - INFO - Final sorting:
2022-08-21 15:48:31 - MANUAL - INFO - ['0->0', '1->1']
2022-08-21 15:48:31 - MANUAL - INFO - Final sorting:
2022-08-21 15:48:31 - MANUAL - INFO - ['0->0', '1->1']
2022-08-21 15:48:31 - MANUAL - INFO - Default audio stream set to fra ac3 6 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2022-08-21 15:48:31 - MANUAL - INFO - Reading subtitle streams.
2022-08-21 15:48:31 - MANUAL - INFO - Subtitle detected for stream 3 - subrip fra.
2022-08-21 15:48:31 - MANUAL - INFO - Subtitle detected for stream 4 - subrip eng.
2022-08-21 15:48:31 - MANUAL - INFO - Stream 4 is text-based subtitle for codec subrip.
2022-08-21 15:48:44 - MANUAL - INFO - Scanned for external subtitles and found 2 results in your approved languages.
2022-08-21 15:48:44 - MANUAL - INFO - Skipping external subtitle file test_file.eng.srt, no appropriate codecs found or embed disabled.
2022-08-21 15:48:44 - MANUAL - INFO - Skipping external subtitle file test_file.eng.2.srt, no appropriate codecs found or embed disabled.
2022-08-21 15:48:44 - MANUAL - INFO - Final sorting:
2022-08-21 15:48:44 - MANUAL - INFO - []
2022-08-21 15:48:44 - MANUAL - INFO - vaapi hwaccel is supported by this ffmpeg build and will be used [hwaccels].
2022-08-21 15:48:44 - MANUAL - INFO - Output Data
2022-08-21 15:48:44 - MANUAL - INFO - {
    "source": [
        "/volume1/Downloads/test/test_file.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "h265vaapi",
        "map": 0,
        "bitrate": 8000,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "preset": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.max-bitrate",
        "title": "FHD",
        "device": "sma"
    },
    "audio": [
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "fra",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "debug": "audio",
            "title": "5.1 Channel"
        },
        {
            "map": 2,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "debug": "audio",
            "title": "5.1 Channel"
        }
    ],
    "subtitle": [],
    "attachment": []
}
2022-08-21 15:48:44 - MANUAL - INFO - Preopts
2022-08-21 15:48:44 - MANUAL - INFO - [
    "-init_hw_device",
    "vaapi=sma:/dev/dri/renderD128",
    "-hwaccel_device",
    "sma",
    "-hwaccel",
    "vaapi",
    "-hwaccel_output_format",
    "vaapi"
]
2022-08-21 15:48:44 - MANUAL - INFO - Postopts
2022-08-21 15:48:44 - MANUAL - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA",
    "-map_metadata",
    "-1",
    "-max_muxing_queue_size",
    "9999"
]
2022-08-21 15:48:44 - MANUAL - INFO - Subtitle Extracts
2022-08-21 15:48:44 - MANUAL - INFO - [
    {
        "source": [
            "/volume1/Downloads/test/test_file.mkv"
        ],
        "subtitle": [
            {
                "map": 4,
                "codec": "srt",
                "language": "eng",
                "debug": "subtitle"
            }
        ],
        "format": "srt",
        "disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired",
        "language": "eng",
        "index": 4
    }
]
2022-08-21 15:48:44 - MANUAL - INFO - Ripping eng subtitle from source stream 4 into external file.
2022-08-21 15:48:54 - MANUAL - INFO - /volume1/Downloads/test/test_file.eng.3.srt created.
2022-08-21 15:48:54 - MANUAL - INFO - Starting conversion.
2022-08-21 15:48:55 - MANUAL - INFO - FFmpeg command:
2022-08-21 15:48:55 - MANUAL - INFO - ======================
2022-08-21 15:48:55 - MANUAL - INFO - /usr/bin/ffmpeg -init_hw_device vaapi=sma:/dev/dri/renderD128 -hwaccel_device sma -hwaccel vaapi -hwaccel_output_format vaapi -i "/volume1/Downloads/test/test_file.mkv" -vcodec hevc_vaapi -map 0:0 -field_order progressive -vb 8000k -metadata:s:v BPS=8000000 -metadata:s:v BPS-eng=8000000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -tag:v hvc1 -filter_hw_device sma -vf "format=nv12|vaapi,hwupload" -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=fra -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 ac3 -map 0:2 -ac:a:1 6 -b:a:1 768k -metadata:s:a:1 BPS=768000 -metadata:s:a:1 BPS-eng=768000 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -map_metadata -1 -max_muxing_queue_size 9999 -y "/volume1/Downloads/test/test_file.mp4"
2022-08-21 15:48:55 - MANUAL - INFO - ======================
2022-08-21 15:48:55 - MANUAL - ERROR - Error converting file, FFMPEG error.
Traceback (most recent call last):
  File "/usr/local/sma/resources/mediaprocessor.py", line 2174, in convert
    for timecode, debug in conv:
  File "/usr/local/sma/converter/__init__.py", line 329, in convert
    for timecode, debug in self.ffmpeg.convert(outfile,
  File "/usr/local/sma/converter/ffmpeg.py", line 760, in convert
    raise FFMpegConvertError('Exited with code %d' % p.returncode, cmd,
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
2022-08-21 15:48:55 - MANUAL - ERROR - /usr/bin/ffmpeg -init_hw_device vaapi=sma:/dev/dri/renderD128 -hwaccel_device sma -hwaccel vaapi -hwaccel_output_format vaapi -i /volume1/Downloads/test/test_file.mkv -vcodec hevc_vaapi -map 0:0 -field_order progressive -vb 8000k -metadata:s:v BPS=8000000 -metadata:s:v BPS-eng=8000000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -tag:v hvc1 -filter_hw_device sma -vf format=nv12|vaapi,hwupload -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 title=5.1 Channel -metadata:s:a:0 handler_name=5.1 Channel -metadata:s:a:0 language=fra -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 ac3 -map 0:2 -ac:a:1 6 -b:a:1 768k -metadata:s:a:1 BPS=768000 -metadata:s:a:1 BPS-eng=768000 -metadata:s:a:1 title=5.1 Channel -metadata:s:a:1 handler_name=5.1 Channel -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -map_metadata -1 -max_muxing_queue_size 9999 -y /volume1/Downloads/test/test_file.mp4
2022-08-21 15:48:55 - MANUAL - ERROR - ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
[AVHWDeviceContext @ 0x5606b1fecac0] Failed to initialise VAAPI connection: -1 (unknown libva error).
Device creation failed: -5.
Failed to set value 'vaapi=sma:/dev/dri/renderD128' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

2022-08-21 15:48:55 - MANUAL - ERROR - There was an error processing file /volume1/Downloads/test/test_file.mkv, no output data received

radarr-sma manual.py

2022-08-21 15:49:01 - MANUAL - INFO - Manual processor started.
2022-08-21 15:49:01 - MANUAL - INFO - Python 64-bit 3.9.13 (main, Jul 26 2022, 13:12:30) 
[GCC 10.3.1 20211027].
2022-08-21 15:49:01 - MANUAL - INFO - Guessit version: 3.4.3.
2022-08-21 15:49:01 - MANUAL - INFO - /usr/local/sma/venv/bin/python3
2022-08-21 15:49:01 - MANUAL - INFO - Loading config file /usr/local/sma/config/autoProcess.ini.
2022-08-21 15:49:01 - MANUAL - WARNING - Force-convert is true, so process-same-extensions is being overridden to true as well
2022-08-21 15:49:02 - MANUAL - INFO - Processing file /volume1/Downloads/test/test_file.mkv
2022-08-21 15:49:02 - MANUAL - INFO - Input Data
2022-08-21 15:49:02 - MANUAL - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 14120976,
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 23.976023976023978,
        "framedata": {
            "pix_fmt": "yuv420p",
            "color_space": "bt709",
            "color_primaries": "bt709",
            "color_transfer": "bt709"
        },
        "dimensions": "1920x1080",
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "fra",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        },
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired"
        }
    ],
    "subtitle": [
        {
            "index": 3,
            "codec": "subrip",
            "disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired",
            "language": "fra"
        },
        {
            "index": 4,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired",
            "language": "eng"
        }
    ],
    "attachment": []
}
2022-08-21 15:49:02 - MANUAL - INFO - Reading video stream.
2022-08-21 15:49:02 - MANUAL - INFO - Video codec detected: h264.
2022-08-21 15:49:02 - MANUAL - INFO - Pix Fmt: yuv420p.
2022-08-21 15:49:02 - MANUAL - INFO - Profile: high.
2022-08-21 15:49:02 - MANUAL - INFO - Video codec parameters None.
2022-08-21 15:49:02 - MANUAL - INFO - Creating h265vaapi video stream from source stream 0.
2022-08-21 15:49:02 - MANUAL - INFO - Reading audio streams.
2022-08-21 15:49:02 - MANUAL - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2022-08-21 15:49:02 - MANUAL - INFO - Audio detected for stream 1 - eac3 fra 6 channel.
2022-08-21 15:49:02 - MANUAL - INFO - Creating ac3 audio stream from source stream 1.
2022-08-21 15:49:02 - MANUAL - INFO - Audio detected for stream 2 - eac3 eng 6 channel.
2022-08-21 15:49:02 - MANUAL - INFO - Creating ac3 audio stream from source stream 2.
2022-08-21 15:49:02 - MANUAL - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2022-08-21 15:49:02 - MANUAL - INFO - Final sorting:
2022-08-21 15:49:02 - MANUAL - INFO - ['0->0', '1->1']
2022-08-21 15:49:02 - MANUAL - INFO - Final sorting:
2022-08-21 15:49:02 - MANUAL - INFO - ['0->0', '1->1']
2022-08-21 15:49:02 - MANUAL - INFO - Default audio stream set to fra ac3 6 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2022-08-21 15:49:02 - MANUAL - INFO - Reading subtitle streams.
2022-08-21 15:49:02 - MANUAL - INFO - Subtitle detected for stream 3 - subrip fra.
2022-08-21 15:49:02 - MANUAL - INFO - Subtitle detected for stream 4 - subrip eng.
2022-08-21 15:49:02 - MANUAL - INFO - Stream 4 is text-based subtitle for codec subrip.
2022-08-21 15:49:16 - MANUAL - INFO - Scanned for external subtitles and found 3 results in your approved languages.
2022-08-21 15:49:16 - MANUAL - INFO - Skipping external subtitle file test_file.eng.srt, no appropriate codecs found or embed disabled.
2022-08-21 15:49:16 - MANUAL - INFO - Skipping external subtitle file test_file.eng.2.srt, no appropriate codecs found or embed disabled.
2022-08-21 15:49:16 - MANUAL - INFO - Skipping external subtitle file test_file.eng.3.srt, no appropriate codecs found or embed disabled.
2022-08-21 15:49:16 - MANUAL - INFO - Final sorting:
2022-08-21 15:49:16 - MANUAL - INFO - []
2022-08-21 15:49:16 - MANUAL - INFO - vaapi hwaccel is supported by this ffmpeg build and will be used [hwaccels].
2022-08-21 15:49:16 - MANUAL - INFO - Output Data
2022-08-21 15:49:16 - MANUAL - INFO - {
    "source": [
        "/volume1/Downloads/test/test_file.mkv"
    ],
    "format": "mp4",
    "video": {
        "codec": "h265vaapi",
        "map": 0,
        "bitrate": 8000,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": null,
        "preset": null,
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.max-bitrate",
        "title": "FHD",
        "device": "sma"
    },
    "audio": [
        {
            "map": 1,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "fra",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "debug": "audio",
            "title": "5.1 Channel"
        },
        {
            "map": 2,
            "codec": "ac3",
            "channels": 6,
            "bitrate": 768,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "eng",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired",
            "bsf": null,
            "debug": "audio",
            "title": "5.1 Channel"
        }
    ],
    "subtitle": [],
    "attachment": []
}
2022-08-21 15:49:16 - MANUAL - INFO - Preopts
2022-08-21 15:49:16 - MANUAL - INFO - [
    "-init_hw_device",
    "vaapi=sma:/dev/dri/renderD128",
    "-hwaccel_device",
    "sma",
    "-hwaccel",
    "vaapi",
    "-hwaccel_output_format",
    "vaapi"
]
2022-08-21 15:49:16 - MANUAL - INFO - Postopts
2022-08-21 15:49:16 - MANUAL - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA",
    "-map_metadata",
    "-1",
    "-max_muxing_queue_size",
    "9999"
]
2022-08-21 15:49:16 - MANUAL - INFO - Subtitle Extracts
2022-08-21 15:49:16 - MANUAL - INFO - [
    {
        "source": [
            "/volume1/Downloads/test/test_file.mkv"
        ],
        "subtitle": [
            {
                "map": 4,
                "codec": "srt",
                "language": "eng",
                "debug": "subtitle"
            }
        ],
        "format": "srt",
        "disposition": "-default-dub-original-comment-lyrics-karaoke-forced+hearing_impaired-visual_impaired",
        "language": "eng",
        "index": 4
    }
]
2022-08-21 15:49:16 - MANUAL - INFO - Ripping eng subtitle from source stream 4 into external file.
2022-08-21 15:49:26 - MANUAL - INFO - /volume1/Downloads/test/test_file.eng.4.srt created.
2022-08-21 15:49:26 - MANUAL - INFO - Starting conversion.
2022-08-21 15:49:26 - MANUAL - INFO - FFmpeg command:
2022-08-21 15:49:26 - MANUAL - INFO - ======================
2022-08-21 15:49:26 - MANUAL - INFO - /usr/bin/ffmpeg -init_hw_device vaapi=sma:/dev/dri/renderD128 -hwaccel_device sma -hwaccel vaapi -hwaccel_output_format vaapi -i "/volume1/Downloads/test/test_file.mkv" -vcodec hevc_vaapi -map 0:0 -field_order progressive -vb 8000k -metadata:s:v BPS=8000000 -metadata:s:v BPS-eng=8000000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -tag:v hvc1 -filter_hw_device sma -vf "format=nv12|vaapi,hwupload" -c:a:0 ac3 -map 0:1 -ac:a:0 6 -b:a:0 768k -metadata:s:a:0 BPS=768000 -metadata:s:a:0 BPS-eng=768000 -metadata:s:a:0 "title=5.1 Channel" -metadata:s:a:0 "handler_name=5.1 Channel" -metadata:s:a:0 language=fra -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 ac3 -map 0:2 -ac:a:1 6 -b:a:1 768k -metadata:s:a:1 BPS=768000 -metadata:s:a:1 BPS-eng=768000 -metadata:s:a:1 "title=5.1 Channel" -metadata:s:a:1 "handler_name=5.1 Channel" -metadata:s:a:1 language=eng -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -map_metadata -1 -max_muxing_queue_size 9999 -y "/volume1/Downloads/test/test_file.mp4"
2022-08-21 15:49:26 - MANUAL - INFO - ======================
2022-08-21 16:00:41 - MANUAL - INFO - /volume1/Downloads/test/test_file.mp4 created.
2022-08-21 16:00:41 - MANUAL - INFO - Relocating MOOV atom to start of file.

autoProcess.ini

[Converter]
ffmpeg = ffmpeg
ffprobe = ffprobe
threads = 0
hwaccels = vaapi
hwaccel-decoders = hevc_vaapi, h264_vaapi, mjpeg_vaapi, mpeg2_vaapi, vp8_vaapi, vp9_vaapi
hwdevices = vaapi:/dev/dri/renderD128
hwaccel-output-format = vaapi:vaapi
output-directory = 
output-format = mp4
output-extension = mp4
temp-extension = 
minimum-size = 0
ignored-extensions = nfo, ds_store
copy-to = 
move-to = 
delete-original = True
sort-streams = True
process-same-extensions = True
bypass-if-copying-all = False
force-convert = True
post-process = False
wait-post-process = False
detailed-progress = False
opts-separator = ,
preopts = 
postopts = -map_metadata,-1,-max_muxing_queue_size,9999
regex-directory-replace = [^\w\-_\. ]
temp-output = False

[Permissions]
chmod = 0664
uid = -1
gid = -1

[Metadata]
relocate-moov = True
full-path-guess = True
tag = False
tag-language = eng
download-artwork = False
sanitize-disposition = 
strip-metadata = False
keep-titles = False

[Video]
codec = h265vaapi, hevc, h265, x265, x264, h264, libx265, hevc_v4l2m2m
max-bitrate = 8000
bitrate-ratio = 
qp = 18
crf = -1
crf-profiles = 
preset = 
codec-parameters = 
dynamic-parameters = False
max-width = 0
profile = 
max-level = 0.0
pix-fmt = 
prioritize-source-pix-fmt = True
filter = 
force-filter = False

[HDR]
codec = h265vaapi, hevc, h265, x265, x264, h264, libx265, hevc_v4l2m2m
pix-fmt = yuv420p10le
space = bt2020nc
transfer = smpte2084
primaries = bt2020
preset = 
codec-parameters = 
filter = 
force-filter = False
profile = 

[Audio]
codec = ac3
languages = 
default-language = 
first-stream-of-language = False
allow-language-relax = True
channel-bitrate = 128
variable-bitrate = 0
max-bitrate = 0
max-channels = 6
prefer-more-channels = True
profile = 
filter = 
force-filter = False
sample-rates = 
sample-format = 
copy-original = False
aac-adtstoasc = False
ignore-truehd = mp4, m4v
ignored-dispositions = 
unique-dispositions = False
stream-codec-combinations = 

[Universal Audio]
codec = 
channel-bitrate = 128
variable-bitrate = 0
first-stream-only = False
profile = 
filter = 
force-filter = False

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

[Subtitle]
codec = srt
codec-image-based = 
languages = eng,swe
default-language = eng
first-stream-of-language = False
encoding = 
burn-subtitles = False
burn-dispositions = 
embed-subs = False
embed-image-subs = False
embed-only-internal-subs = False
filename-dispositions = forced
ignore-embedded-subs = False
ignored-dispositions = 
unique-dispositions = False
attachment-codec = 
remove-bitstream-subs = False

[Subtitle.Subliminal]
download-subs = False
download-hearing-impaired-subs = False
providers = 

[Subtitle.Subliminal.Auth]
opensubtitles = 
tvsubtitles = 

[Sonarr]
host = 127.0.0.1
port = 8989
apikey = snip
ssl = False
webroot = 
force-rename = False
rescan = True
block-reprocess = False

[Radarr]
host = 127.0.0.1
port = 7878
apikey = snip
ssl = False
webroot = 
force-rename = False
rescan = True
block-reprocess = False

[Sickbeard]
host = localhost
port = 8081
ssl = False
apikey = 
webroot = 
username = 
password = 

[Sickrage]
host = localhost
port = 8081
ssl = False
apikey = 
webroot = 
username = 
password = 

[SABNZBD]
convert = True
sickbeard-category = sickbeard
sickrage-category = sickrage
sonarr-category = tv
radarr-category = movies
bypass-category = bypass
output-directory = 
path-mapping = 

[Deluge]
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = tv
radarr-label = movies
bypass-label = bypass
convert = True
host = 192.168.10.200
port = 58846
username = localclient
password = snip
output-directory = 
remove = True
path-mapping = 

[qBittorrent]
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
action-before = 
action-after = 
host = localhost
port = 8080
ssl = False
username = 
password = 
output-directory = 
path-mapping = 

[uTorrent]
sickbeard-label = sickbeard
sickrage-label = sickrage
sonarr-label = sonarr
radarr-label = radarr
bypass-label = bypass
convert = True
webui = False
action-before = 
action-after = 
host = localhost
ssl = False
port = 8080
username = 
password = 
output-directory = 
path-mapping = 

[Plex]
host = 192.168.10.200
port = 32400
refresh = True
token = snip

[Subtitle.CleanIt]
enabled = False
config-path = 
tags = 

[Audio.Sorting]
sorting = language, channels.d, map, d.comment
default-sorting = channels.d, map, d.comment
codecs = 

[Subtitle.Sorting]
sorting = language, d.comment, d.default.d, d.forced.d
codecs = 

docker-compose.yaml

version: "3"
services:
    sonarr:
        image: mdhiggins/sonarr-sma:latest
        container_name: sonarr
        network_mode: host
        deploy:
          resources:
            limits:
                memory: 3584M
#        build:
#          context: https://github.com/mdhiggins/sonarr-sma.git#build
#          args:
#            - ffmpeg_tag=4.2-vaapi
#            - ffmpeg_tag=4.3-vaapi1804
#            - ffmpeg_tag=5.1-vaapi2004
#            - sonarr_tag=develop-3.0.8.1538-ls289
#            - extra_packages=
        volumes:
            - /volume1/Docker/mounts/sonarr/config:/config
            - /volume1/Docker/mounts/sma:/usr/local/sma/config
            - /volume1/Video:/volume1/Video
            - /volume1/Downloads:/volume1/Downloads
            - /volume1/Docker:/volume1/Docker
            - /dev/dri:/dev/dri
        environment:
            - TZ=Europe/Dublin
            - PUID=1026
            - PGID=100
            - HOST=127.0.0.1
            - UMASK=022
            - SMA_PATH=/usr/local/sma
            - SMA_UPDATE=true
            - SMA_HWACCEL=true
            - SMA_USE_REPO=true
        restart: unless-stopped
        devices:
            - /dev/dri/renderD128:/dev/dri/renderD128

Not sure if relevant but I was having some issues with dependencies and log ownership so I run a script with these on both containers when they go up

docker exec -it sonarr pip3 install --upgrade setuptools
docker exec -it sonarr wget -c -P /tmp pip3 install -U -r https://raw.githubusercontent.com/mdhiggins/sickbeard_mp4_automator/master/setup/requirements.txt
docker exec -it sonarr pip3 install -U -r /tmp/requirements.txt --ignore-installed
docker exec -it sonarr chown 1026:100 '/usr/local/sma/config/sma.log'

Is there any obvious reason it would be failing in sonarr-sma but working in radarr-sma? I can see they are on different versions of Python but beyond that I'm not sure.

Enabling vaapi

I try to enable vaapi on both sonarr-sma and radarr-sma but get the same error in the log:

E: Package 'libva' has no installation candidate

when i check ffmpeg -hwaccel i get:

ffmpeg: error while loading shared libraries: libva.so.2: cannot open shared object file: No such file or directory

How can I confirm it is utilizing the gpu when re-encoding?

Conversion failing with error is not in a valid format

Hello!

Thanks for providing this great script, been using it for ages. I've very recently run in to problems tho, files are failing to convert with error message(the only changes that i know of is updating the containers and the host OS):

021-02-28 11:41:01 - resources.mediaprocessor - DEBUG - Invalid source, no data returned.

and

2021-02-27 17:25:26 - resources.mediaprocessor - INFO - File .mkv is not valid
2021-02-27 17:25:26 - SonarrPostProcess - INFO - Processing returned False.
2021-02-27 17:25:26 - SonarrPostProcess - ERROR - Error processing file
Traceback (most recent call last):
  File "/usr/local/sma/postSonarr.py", line 231, in <module>
    sys.exit(1)
SystemExit: 1

Been trying to run it manually from inside the container, but im facing the same error message there:

Manual processor started.
Python 64-bit 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0].
Guessit version: 3.3.1.
/usr/local/sma/venv/bin/python3
Loading config file /usr/local/sma/autoProcess.ini.
File XXX.mkv is not in a valid format

I saw in another thread recommending to run ffprobe -show_streams but when running that i get:

root@docker01:/usr/local/sma/config# ffprobe
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ffprobe)
ffprobe: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/local/lib/libavdevice.so.58)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libavfilter.so.7)
ffprobe: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/local/lib/libavformat.so.58)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libavcodec.so.58)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libswresample.so.3)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libswscale.so.5)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libavutil.so.56)
ffprobe: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by /usr/local/lib/libavutil.so.56)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libass.so.9)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libvidstab.so.1.1)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libsrt.so.1)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libvpx.so.6)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libaom.so.0)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libfdk-aac.so.1)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libmp3lame.so.0)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libopenjp2.so.7)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libopus.so.0)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libvorbis.so.0)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libwebp.so.7)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libx264.so.148)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libx265.so.176)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libxvidcore.so.4)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libkvazaar.so.4)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libxml2.so.2)
ffprobe: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /usr/local/lib/libpng16.so.16)

This is my docker-compose file:

    version: "3"
    services:
      sonarr:
        container_name: sonarr
        build:
          context: https://github.com/mdhiggins/sonarr-sma.git#build
          args:
            - sonarr_tag=preview
            - ffmpeg_tag=4.2-vaapi
        network_mode: host
        environment:
          - PUID=1000
          - PGID=1000
          - TZ=Europe/Stockholm
          - UMASK_SET=022 #optional
          - SMA_UPDATE=true
        devices:
          - /dev/dri:/dev/dri  

I update the container with the following command: docker-compose build --pull --no-cache

Any pointers would be greatly appreciated, thanks in advance!

ERROR: mapping values are not allowed here

For starters thank you for the images and the mp4_automation script.

I received the below error when trying to run the docker-compose script on Debian 10 (Buster) with docker-compose version 1.21.0

ERROR: yaml.scanner.ScannerError: mapping values are not allowed here
in "./docker-compose.yml", line 2, column 9

My docker-compose.yml file looked like:

yaml
  sonarr:
    image: mdhiggins/sonarr-sma:build
    container_name: sonarr
    volumes:
      - /opt/appdata/sonarr:/config
      - /opt/appdata/sma:/usr/local/sma/config
      - /home/username/media/tv:/tv
      - /home/username/downloads:/downloads
    ports:
      - 8989:8989
    restart: always
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC

I was able to start the container successfully with the below:

version: "2.1"
services:
  sonarr:
    image: mdhiggins/sonarr-sma:build
    container_name: sonarr
    volumes:
      - /opt/appdata/sonarr:/config
      - /opt/appdata/sma:/usr/local/sma/config
      - /home/username/media/tv:/tv
      - /home/username/downloads:/downloads
    ports:
      - 8989:8989
    restart: always
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC

This applies to your radarr-sma docker image as well.

ffmpeg error?

Hi bro, just did a new build using:

docker build https://github.com/mdhiggins/sonarr-sma.git#build --build-arg ffmpeg_tag=4.4-ubuntu --build-arg sonarr_tag=preview

I need the libfdk_aac in ffmpeg build is the must have.

all compiled ok and runs...but when i run the ffmpeg command on console i get:

root@b2a58463d15a:/# whereis ffmpeg
ffmpeg: /usr/local/bin/ffmpeg
root@b2a58463d15a:/# ffmpeg
ffmpeg: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by /usr/local/lib/libavdevice.so.58) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libavfilter.so.7)
ffmpeg: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by /usr/local/lib/libavformat.so.58) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libavcodec.so.58)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libswresample.so.3) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libswscale.so.5)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libavutil.so.56) ffmpeg: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.28' not found (required by /usr/local/lib/libavutil.so.56)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libvmaf.so.1) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libass.so.9)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libvidstab.so.1.1) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libsrt.so.1)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libvpx.so.6) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libaom.so.0)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libfdk-aac.so.1) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libmp3lame.so.0)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libopenjp2.so.7) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libopus.so.0)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libvorbis.so.0) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libwebp.so.7)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libx264.so.148) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libx265.so.192)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libxvidcore.so.4) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libkvazaar.so.6)
ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libxml2.so.2) ffmpeg: /lib/x86_64-linux-gnu/libm.so.6: version GLIBC_2.29' not found (required by /usr/local/lib/libpng16.so.16)
root@b2a58463d15a:/#

any idea why or how to fix please and thankyou once again for your great work??

No module named 'requests'

Hi,

I'm running mdhiggins/sonarr-sma:latest but can't run sma. After a little digging, manual execution of postsonarr.py I get:

root@sonarr:/usr/local/sma# python3 postSonarr.py Traceback (most recent call last): File "postSonarr.py", line 4, in <module> import requests ModuleNotFoundError: No module named 'requests'

Easy fix to add this I suppose, just wanting to bring this to your attention.

Unable to send OnDownload notification

Hi Higgins,

After using:
docker build https://github.com/mdhiggins/sonarr-sma.git#build --build-arg ffmpeg_tag=4.2-ubuntu --build-arg sonarr_tag=preview

To build sonarr preview image with ffmpeg (libfdk_aac) codec

When i miport an episode it fails with sonarr event:

Unable to send OnDownload notification to: Mp4 Automator: ApplicationName='/usr/local/sma/postSonarr.sh', CommandLine='', CurrentDirectory='', Native error= Access denied

So I double check the permissions on the postSonarr.sh file within the image.
When i make postSonarr.sh writable the error goes away until the image is update again.

-rw-r--r-- 1 root root 72 Nov 2 11:25 postSonarr.sh

Just wondering is the a way to ensure when image is updated that the file states writable?

ffmpeg can't be found

Hi,

after some recent updates, i now get error about the location of ffmpeg:

  Component Message Time
  python3 converter.ffmpeg.FFMpegError: ffmpeg binary not found: /usr/local/bin/ffmpeg/ffmpeg Yesterday
  python3 raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/ffmpeg.py", line 410, in init Yesterday
  python3 ffprobe_path=ffprobe_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/init.py", line 27, in init Yesterday
  python3 self.converter = Converter(settings.ffmpeg, settings.ffprobe) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/mkvtomp4.py", line 29, in init Yesterday
  python3 converter = MkvtoMp4(settings) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/postSonarr.py", line 30, in Yesterday
  python3 Traceback (most recent call last): Yesterday
  python3 converter.ffmpeg.FFMpegError: ffmpeg binary not found: /usr/local/bin/ffmpeg/ffmpeg Yesterday
  python3 raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/ffmpeg.py", line 410, in init Yesterday
  python3 ffprobe_path=ffprobe_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/init.py", line 27, in init Yesterday
  python3 self.converter = Converter(settings.ffmpeg, settings.ffprobe) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/mkvtomp4.py", line 29, in init Yesterday
  python3 converter = MkvtoMp4(settings) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/postSonarr.py", line 30, in Yesterday
  python3 Traceback (most recent call last): Yesterday
  python3 converter.ffmpeg.FFMpegError: ffmpeg binary not found: /usr/local/bin/ffmpeg/ffmpeg Yesterday
  python3 raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/ffmpeg.py", line 410, in init Yesterday
  python3 ffprobe_path=ffprobe_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/init.py", line 27, in init Yesterday
  python3 self.converter = Converter(settings.ffmpeg, settings.ffprobe) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/mkvtomp4.py", line 29, in init Yesterday
  python3 converter = MkvtoMp4(settings) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/postSonarr.py", line 30, in Yesterday
  python3 Traceback (most recent call last): Yesterday
  python3 converter.ffmpeg.FFMpegError: ffmpeg binary not found: /usr/local/bin/ffmpeg/ffmpeg Yesterday
  python3 raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/ffmpeg.py", line 410, in init Yesterday
  python3 ffprobe_path=ffprobe_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/init.py", line 27, in init Yesterday
  python3 self.converter = Converter(settings.ffmpeg, settings.ffprobe) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/mkvtomp4.py", line 29, in init Yesterday
  python3 converter = MkvtoMp4(settings) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/postSonarr.py", line 30, in Yesterday
  python3 Traceback (most recent call last): Yesterday
  python3 converter.ffmpeg.FFMpegError: ffmpeg binary not found: /usr/local/bin/ffmpeg/ffmpeg Yesterday
  python3 raise FFMpegError("ffmpeg binary not found: " + self.ffmpeg_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/ffmpeg.py", line 410, in init Yesterday
  python3 ffprobe_path=ffprobe_path) Yesterday
  python3 File "/usr/local/bin/sma/sickbeard_mp4_automator/converter/init.py", line 27, in init Yesterday
  python3 self.converter = Converter(settings.ffmpeg, settings.ffprobe) Yesterday

Unable to locate package libnppig10 in build

Hi, not sure if I'm doing something wrong, but just tried to rebuild my container which has the following in the docker-compose file:

    build:
      context: https://github.com/mdhiggins/sonarr-sma.git#build
      args:
        - ffmpeg_tag=4.3.2-vaapi1804
        - sonarr_tag=latest

The command I'm using to build is
docker-compose build --force-rm --no-cache

This has always previously worked, but I now get the following error:

Get:22 http://archive.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [26.7 kB]
Fetched 12.3 MB in 4s (3,009 kB/s)
Reading package lists...
W: Conflicting distribution: http://download.mono-project.com/repo/ubuntu bionic/snapshots/5.20 InRelease (expected bionic/snapshots/5.20 but got bionic)
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package libnppig10
E: Unable to locate package libnppicc10
E: Unable to locate package libnppidei10
Removing intermediate container f43da793117d
The command '/bin/sh -c apt-get update &&   apt-get install -y     git     wget     python3     python3-pip     libnppig10     libnppicc10     libnppidei10 &&   mkdir ${SMA_PATH} &&   git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git ${SMA_PATH} &&   python3 -m pip install --user --upgrade pip &&   python3 -m pip install --user virtualenv &&   python3 -m virtualenv ${SMA_PATH}/venv &&   ${SMA_PATH}/venv/bin/pip install -r ${SMA_PATH}/setup/requirements.txt &&   chgrp users /usr/local/bin/ffmpeg &&   chgrp users /usr/local/bin/ffprobe &&   chmod g+x /usr/local/bin/ffmpeg &&   chmod g+x /usr/local/bin/ffprobe &&   apt-get purge --auto-remove -y &&   apt-get clean &&   rm -rf     /tmp/*     /var/lib/apt/lists/*     /var/tmp/*' returned a non-zero code: 100
ERROR: Service 'sonarr' failed to build

The "Conflicting distribution" part has been happening for a while, but so far appears to be benign. It's the "Unable to locate package" lines that seem to be causing the problem, and I assume causing the apt-get install for libnppig10, libnppicc10 and libnppidei10 to fail. Had a bit of a try at troubleshooting, but to be honest I have no idea whether it's an issue with my build process, the linuxserver container, the ffmpeg one, or the sma build scripts.

Any advice appreciated.

Use External mp4 ?

mdhiggins firstly bro...a huge thankyou for your brilliant work:)

I have mp3 automator edited files to encode multiple version of the same source file fee from sonarr and radarr. such as 1080 & 720. My sonarr & radarr are not dockers, but installed scripts.

So my question is..
if i decided to use your sonarr-sma : preview image, can i make it pass the series data etc.. use my edited mp4automator files?

Issue with

Running the below config.
Post sonarr is running
Path: /usr/local/bin/sma/env/bin/python3
Arguments: /usr/local/bin/sma/sickbeard_mp4_automator/postSonarr.py

Below is my sonarr-sma

Mount 1: /nzbget-downloads:/nzbget-downloads
Mount 2: /media:/media
Mount 3: /docker-appdata/mp4-automator/autoProcess.ini:/usr/local/bin/sma/sickbeard_mp4_automator/autoProcess.ini
Mount 4: /docker-app-data/linuxserver-sonarr:/config

Here is my lsio-nzbget

Mount 1: /nzbget-downloads:/nzbget-downloads
Mount 2: /docker-app-data/linuxserver-nzbget:/config

autoProcess.ini

[Sonarr]
host = 192.168.1.253
port = 8989
web_root = 
ssl = False
apikey = 651dcfdd456446b0acdeb0bc52587d0c

[MP4]
ffmpeg = /usr/local/bin/ffmpeg/ffmpeg
ffprobe = /usr/local/bin/ffmpeg/ffprobe
threads = 0
output_directory = 
copy_to = 
move_to = 
output_extension = mp4
output_format = mp4
delete_original = True
relocate_moov = True
video-codec = h264,x264
video-bitrate = 
video-crf = 
video-max-width = 
video-profile = 
h264-max-level = 
use-qsv-decoder-with-encoder = True
use-hevc-qsv-decoder = False
enable_dxva2_gpu_decode = False
ios-audio = True
ios-first-track-only = False
ios-audio-filter = 
ios-move-last = False
max-audio-channels = 
audio-codec = aac
audio-language = 
audio-default-language = 
audio-channel-bitrate = 128
audio-filter = 
audio-copy-original = False
audio-first-track-of-language = False
subtitle-codec = mov_text
subtitle-language = 
subtitle-default-language = 
subtitle-encoding = 
fullpathguess = True
convert-mp4 = False
tagfile = True
tag-language = en
download-artwork = Poster
download-subs = False
embed-subs = True
embed-only-internal-subs = False
sub-providers = addic7ed,podnapisi,thesubdb,opensubtitles
permissions = 0777
post-process = False
pix-fmt = 
aac_adtstoasc = False
postopts = 
preopts = 

Do I need to run the nzbget post process script as well?
Reason I ask is because the LSIO nzbget doesnt have python by default added.

Below are errors in sonarr's log

19-3-9 05:46:18.6|Error|python3|Traceback (most recent call last):
19-3-9 05:46:18.6|Error|python3|  File "/usr/local/bin/sma/sickbeard_mp4_automator/postSonarr.py", line 39, in <module>
19-3-9 05:46:18.6|Error|python3|    season = int(os.environ.get('sonarr_episodefile_seasonnumber'))
19-3-9 05:46:18.6|Error|python3|TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

making it copy source file before encoding

Im trying to generate a copy of the source file from sonarr to another location, BEFORE encoding via mp4 automator.
I've edited the postsonarr.sh file as the following and gave write permissions etc.. but still fails:( recking my head on it and i know im doing something stupid. please can u see why it wont work?

my_postsonarr.sh

#!/usr/bin/env bash

file='$sonarr_episodefile_sourcepath'
dest='/downloads/backup/'

cp $file $dest

$SMA_PATH/venv/bin/python3 $SMA_PATH/postSonarr.py

Thankyou in advance.

ffmpeg and ffprobe don't work since update to Sonarr 4

I updated my sonarr-sma container today and now post-processing fails:

root@docker:/usr/local/sma/config# tail sma.log
  File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/ffprobe'
2024-01-01 12:37:59 - resources.mediaprocessor - INFO - File /storage/plex/TV/... is not valid
2024-01-01 12:37:59 - SonarrPostProcess - ERROR - Processing returned False.
2024-01-01 12:37:59 - SonarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
  File "/usr/local/sma/postSonarr.py", line 230, in <module>
    sys.exit(1)
SystemExit: 1
root@docker:/usr/local/sma/config# /usr/local/bin/ffprobe
bash: /usr/local/bin/ffprobe: cannot execute: required file not found
root@docker:/usr/local/sma/config# /usr/local/bin/ffmpeg
bash: /usr/local/bin/ffmpeg: cannot execute: required file not found

Post Processing Scripts

Hi wondering why Post Processing Scripts aren't doing as told..

Testing plex_autoscan.py (edited url to correspond to my instance of plex_autoscan)

  1. I can manually use curl to send POST to plex_autoscan to trigger.
  2. ENV $SMA_FILES always seems to be empty.. I've consoled into the container and echoed $SMA_FILES (and the other ENV SMA Variables from the other repo you have for SMA)
  3. I even created output.sh to echo out to output.txt with the variables and its always blank.

I've mounted the volume for post_process to try to edit out, even went into the container and installed VIM/NANO to edit the files, played with permissions (+x) to the scripts.. I can get it running, but its not doing anything, and I can't for the life of me find a place to change the debug/verbose setting for the scripts.

Thanks.

i.e

2020-05-21 00:24:16 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/plex_autoscan.py'.

2020-05-21 00:24:16 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/runme.py'.

2020-05-21 00:24:16 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/runme.sh'.

2020-05-21 00:24:17 - resources.mediaprocessor - INFO - Running script '/usr/local/sma/resources/../post_process/sample.bat'.

kubernetes

I see that ffmpeg is not baked into the image, it's downloaded each time you run the image.
This might work fine within docker, but with kubernetes, it's a bit of a problem. It takes a long time to download ffmpeg and within this time, kubernetes kills the container and restarts it. I could probably work around this by modifying the startup probe to allow it long enough for the ffmpeg downloads, but downloading ffmpeg every time the container restarts is going to result in a poor experience.

Is there a chance of getting an image with ffmpeg baked in?
Failing that, an option to have ffmpeg downloaded to a volume instead of just /usr/local/bin/ would allow the first container start to download ffmpeg and subsequent starts could reuse the existing ffmpeg in the volume.

SonarrPostProcess - ERROR - Unable to restore scene information.

I have switched over to user sonarr-sma since yesterday and I am seeing the following error for multiple conversions in my sma.log file. Is this something to be concerned about or safe to ignore?

2021-06-04 05:12:49 - SonarrPostProcess - ERROR - Unable to restore scene information.
Traceback (most recent call last):
  File "/usr/local/sma/postSonarr.py", line 281, in <module>
    mf = getEpisodeFile(baseURL, headers, sonarrepinfo['episodeFile']['id'], log)
KeyError: 'episodeFile'
2021-06-04 05:12:49 - SonarrPostProcess - INFO - Sonarr response RenameSeries command: ID <redacted> queued.

NVENC capable FFMPEG build for alpine

hello,
I am trying to build sonarr-sma with ffmpeg nvidia, but am running into errors. I am attempting to build it with docker compose like this

    container_name: sonarr-sma
    build:
      context: https://github.com/mdhiggins/sonarr-sma.git#build
      args:
        - ffmpeg_tag=4.4-nvidia2004
        - sonarr_tag=develop
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu, utility]
    volumes:
      - $DOCKERDIR/sonarr-sma/config:/config
      - $DOCKERDIR/sonarr-sma/sma:/usr/local/sma/config
      - '${DLDIR}/completed:/data/completed'
      - '${TVDIR}:/TV_Shows'
    networks:
      - t2_proxy
    restart: always
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - SMA_HWACCEL=true
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all

    labels:
      - "traefik.enable=true"
      - "diun.enable=true"
      - "flame.type=application" # "app" works too
      - "flame.name=sonarr-sma"
      # HTTP Routers
      - "traefik.http.routers.sonarr-sma-rtr.entrypoints=https"
      - "traefik.http.routers.sonarr-sma-rtr.rule=Host(`sma.$DOMAINNAME`)"
      ## Middlewares
      - "traefik.http.routers.sonarr-sma-rtr.middlewares=chain-authelia@file"      
      ## HTTP Services
      - "traefik.http.routers.sonarr-sma-rtr.service=sonarr-sma-svc"
      - "traefik.http.services.sonarr-sma-svc.loadbalancer.server.port=8989"

being my last attempt. I initially built it with ffmpeg_tag=4.4-nvidia and sonarr_tag=latest but ran into the issue

libnppig.so.10 cannot open shared object file: No such file or directory

when attempting to run ffmpeg or ffprobe. I read in mdhiggins/sickbeard_mp4_automator/issues/1470 that I needed to match the version so switched the tag to ffmpeg_tag=4.4-nvidia1804 for it to be no joy. I attempted a few other tags only to run into the same issue. I could manually run ffprobe and ffmpeg if I went into the container and did export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 but did not know how to apply it when built. I attempted messing with the dockerfile but was unsuccessful.

I then attempted to try to build with sonarr_tag=develop and ffmpeg_tag=4.4-nvidia2004 as seen by a couple of other users in issues, but it looks like the develop branch has moved their image to alpine which does not seem to work with jrottenberg's nvidia images I attempted a few other tags but I kept getting the errors below.

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/ffprobe'
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/ffmpeg'

Attempting to run manual.py,

abc@c650bbf26c8b:/$ "/usr/local/sma/venv/bin/python3" "/usr/local/sma/manual.py" -i "/TV_Shows/xxx/Season 1/xxx.mkv"
Manual processor started.
Python 64-bit 3.9.7 (default, Nov 24 2021, 21:15:59) 
[GCC 10.3.1 20211027].
Guessit version: 3.4.3.
/usr/local/sma/venv/bin/python3
Loading config file /usr/local/sma/config/autoProcess.ini. isValidSource unexpectedly threw an exception, returning None.
Traceback (most recent call last):
  File "/usr/local/sma/resources/mediaprocessor.py", line 314, in isValidSource
    info = self.converter.probe(inputfile)
  File "/usr/local/sma/converter/__init__.py", line 344, in probe
    return self.ffmpeg.probe(fname, posters_as_video)
  File "/usr/local/sma/converter/ffmpeg.py", line 610, in probe
    stdout_data = self._get_stdout([
  File "/usr/local/sma/converter/ffmpeg.py", line 560, in _get_stdout
    p = self._spawn(cmds)
  File "/usr/local/sma/converter/ffmpeg.py", line 553, in _spawn
    return Popen(cmds, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/ffprobe'

errors out like above. The only attempt I tried to do to fix this was this stackflow and adding libc6-compat as an extra package to install but to no avail.
I have verified that the files /usr/local/bin/ffprobe and /usr/local/bin/ffmpeg do exist in those locations as well.

I don't know what else to attempt so any insight would be greatly appreciated.

Perform conversion prior to transferring file to NAS

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.

Plex standard config

Hi,

Sorry to add this non-issue here, but do you have a standard config file, or a recommendation of settings, that just "work" to give you a great video file for Plex? I'm not a huge videophile and I'm not into the technical weeds of video, just want to convert files that work without Plex doing any unnecessary work when i use it from my TV, PC, phone or tablet.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.