mdhiggins / sonarr-sma

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

ffmpeg vaapi error #40

Closed niallobr closed 2 years ago

niallobr commented 2 years ago

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.

niallobr commented 2 years ago

After some searching, installing the below driver and re-initialising the device seems to have fixed it

docker exec -it sonarr apt install intel-media-va-driver-non-free -y
docker exec -it sonarr ffmpeg -init_hw_device vaapi=foo:/dev/dri/renderD128

Will leave open for now in case it's something that needs to be added to the image

mdhiggins commented 2 years ago

Before you installed that package, was the intel-media-va-driver package installed? It should have been

Just curious if the non-free package is actually required or if the free one wasn't getting installed for some reason

mdhiggins commented 2 years ago

Actually, looks like it's just more hardware dependent, some need non-free

updated to include this package at least on the ubuntu based images