mdhiggins / sickbeard_mp4_automator

Automatically convert video files to a standardized format with metadata tagging to create a beautiful and uniform media library
MIT License
1.53k stars 201 forks source link

ffmpeg error when attempting manual.py #1370

Closed bcrdncola closed 3 years ago

bcrdncola commented 3 years ago

I have SMA setup on a Synology NAS with the ultimate goal of getting it running as an NZB postprocess.

I've gotten everything setup correctly to the best of my knowledge, installed all of the requirements with pip, but when running manual.py I get a couple mediainfo errors, and (more critical for my needs) a no output data recieved error on ffmpeg. What am I missing here?

autoProcess.ini

ffmpeg = /volume1/Media/sickbeard/ffmpeg/ffmpeg
ffprobe = /volume1/Media/sickbeard/ffmpeg/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 = /volume1/Convert
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 = False
force-convert = False
post-process = False
wait-post-process = False
detailed-progress = False
preopts = 
postopts = 
bypass-if-copying-all = False

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

[Metadata]
relocate-moov = True
full-path-guess = True
tag = True
tag-language = eng
download-artwork = poster
sanitize-disposition = 

[Video]
codec = h264, x264
max-bitrate = 0
crf = -1
crf-profiles = 
preset = 
codec-parameters = 
dynamic-parameters = False
max-width = 0
profile = 
max-level = 0.0
pix-fmt = 
filter = 
force-filter = False

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

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

[Universal Audio]
codec = aac
channel-bitrate = 128
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 = 
burn-subtitles = False
burn-dispositions = 
download-subs = False
download-hearing-impaired-subs = False
download-providers = 
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 = 

[Sonarr]
host = localhost
port = 8989
apikey = 
ssl = False
webroot = 
force-rename = False

[Radarr]
host = localhost
port = 7878
apikey = 
ssl = False
webroot = 
force-rename = False

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

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

[CouchPotato]
host = localhost
port = 5050
username = 
password = 
apikey = 
delay = 65
method = renamer
delete-failed = False
ssl = False
webroot = 

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

[Deluge]
couchpotato-label = couchpotato
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]
couchpotato-label = couchpotato
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]
couchpotato-label = couchpotato
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 = localhost
port = 32400
refresh = False
token = 

sma.log

2020-12-02 19:53:15 - MANUAL - INFO - Manual processor started.
2020-12-02 19:53:15 - MANUAL - INFO - /usr/local/bin/python3
2020-12-02 19:53:15 - MANUAL - INFO - Loading config file /volume1/Media/sickbeard/config/autoProcess.ini.
2020-12-02 19:53:16 - MANUAL - ERROR - Pymediainfo exception
Traceback (most recent call last):
  File "/volume1/Media/sickbeard/resources/mediaprocessor.py", line 283, in isValidSource
    media_info = MediaInfo.parse(inputfile)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/pymediainfo/__init__.py", line 311, in parse
    lib, handle, lib_version_str, lib_version = cls._get_library(library_file)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/pymediainfo/__init__.py", line 195, in _get_library
    lib = lib_type(library)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libmediainfo.so.0: cannot open shared object file: No such file or directory
2020-12-02 19:53:16 - MANUAL - INFO - Processing file /volume1/Media/test/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mkv
2020-12-02 19:53:16 - MANUAL - ERROR - Pymediainfo exception
Traceback (most recent call last):
  File "/volume1/Media/sickbeard/resources/mediaprocessor.py", line 283, in isValidSource
    media_info = MediaInfo.parse(inputfile)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/pymediainfo/__init__.py", line 311, in parse
    lib, handle, lib_version_str, lib_version = cls._get_library(library_file)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/pymediainfo/__init__.py", line 195, in _get_library
    lib = lib_type(library)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/ctypes/__init__.py", line 347, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libmediainfo.so.0: cannot open shared object file: No such file or directory
2020-12-02 19:53:16 - MANUAL - INFO - Input Data
2020-12-02 19:53:16 - MANUAL - INFO - {
    "video": {
        "index": 0,
        "fps": 23.976023976023978,
        "level": 5.0,
        "profile": "high 10",
        "field_order": "progressive",
        "pix_fmt": "yuv420p10le",
        "dimensions": "1280x720",
        "codec": "h264"
    },
    "audio": [
        {
            "index": 1,
            "channels": 2,
            "disposition": "-lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-visual_impaired",
            "samplerate": 48000,
            "language": "jpn",
            "codec": "aac"
        }
    ],
    "format-fullname": "Matroska / WebM",
    "format": "matroska,webm",
    "subtitle": [
        {
            "index": 2,
            "disposition": "-lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-visual_impaired",
            "language": "eng",
            "codec": "ass"
        }
    ],
    "attachment": [
        {
            "index": 3,
            "codec": "ttf"
        },
        {
            "index": 4,
            "codec": "ttf"
        },
        {
            "index": 5,
            "codec": "ttf"
        },
        {
            "index": 6,
            "codec": "ttf"
        },
        {
            "index": 7,
            "codec": "ttf"
        },
        {
            "index": 8,
            "codec": "ttf"
        },
        {
            "index": 9,
            "codec": "ttf"
        }
    ]
}
2020-12-02 19:53:16 - MANUAL - INFO - Reading video stream.
2020-12-02 19:53:16 - MANUAL - INFO - Video codec detected: h264.
2020-12-02 19:53:16 - MANUAL - INFO - Pix Fmt: yuv420p10le.
2020-12-02 19:53:16 - MANUAL - INFO - Profile: high 10.
2020-12-02 19:53:16 - MANUAL - INFO - Video codec parameters None.
2020-12-02 19:53:16 - MANUAL - INFO - Creating copy video stream from source stream 0.
2020-12-02 19:53:16 - MANUAL - INFO - Reading audio streams.
2020-12-02 19:53:16 - MANUAL - INFO - Audio detected for stream 1 - aac jpn 2 channel.
2020-12-02 19:53:16 - MANUAL - INFO - Creating copy audio stream from source stream 1.
2020-12-02 19:53:16 - MANUAL - INFO - Default audio stream set to jpn copy 2 channel stream [default-more-channels: True].
2020-12-02 19:53:16 - MANUAL - INFO - Reading subtitle streams.
2020-12-02 19:53:16 - MANUAL - INFO - Text-based subtitle detected for stream 2 - ass eng.
2020-12-02 19:53:16 - MANUAL - INFO - Creating mov_text subtitle stream from source stream 2.
2020-12-02 19:53:16 - MANUAL - INFO - Scanned for external subtitles and found 0 results in your approved languages.
2020-12-02 19:53:16 - MANUAL - INFO - Output Data
2020-12-02 19:53:16 - MANUAL - INFO - {
    "video": {
        "preset": null,
        "maxrate": null,
        "bitrate": 4881.826,
        "filter": null,
        "field_order": "progressive",
        "params": null,
        "codec": "copy",
        "crf": -1,
        "map": 0,
        "debug": "video",
        "level": 0.0,
        "width": null,
        "pix_fmt": null,
        "profile": null,
        "bufsize": null,
        "title": "HD"
    },
    "source": [
        "/volume1/Media/test/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mkv"
    ],
    "audio": [
        {
            "map": 1,
            "bitrate": 256,
            "disposition": "-lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-visual_impaired",
            "channels": 2,
            "filter": null,
            "bsf": null,
            "title": "Stereo",
            "samplerate": null,
            "debug": "universal-audio",
            "language": "jpn",
            "codec": "copy"
        }
    ],
    "format": "mp4",
    "subtitle": [
        {
            "map": 2,
            "debug": "subtitle.embed-subs",
            "disposition": "-lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-visual_impaired",
            "codec": "mov_text",
            "language": "eng",
            "title": ""
        }
    ],
    "attachment": []
}
2020-12-02 19:53:16 - MANUAL - INFO - Preopts
2020-12-02 19:53:16 - MANUAL - INFO - [
    "-fix_sub_duration"
]
2020-12-02 19:53:16 - MANUAL - INFO - Postopts
2020-12-02 19:53:16 - MANUAL - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2020-12-02 19:53:16 - MANUAL - INFO - Starting conversion.
2020-12-02 19:53:16 - MANUAL - INFO - FFmpeg command:
2020-12-02 19:53:16 - MANUAL - INFO - ======================
2020-12-02 19:53:16 - MANUAL - INFO - /volume1/Media/sickbeard/ffmpeg/ffmpeg -fix_sub_duration -i /volume1/Media/test/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mkv -vcodec copy -map 0:0 -metadata:s:v title=HD -metadata:s:v handler_name=HD -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=jpn -disposition:a:0 -lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-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 -lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y /volume1/Convert/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mp4
2020-12-02 19:53:16 - MANUAL - INFO - ======================
2020-12-02 19:53:16 - MANUAL - ERROR - Error converting file, FFMPEG error.
Traceback (most recent call last):
  File "/volume1/Media/sickbeard/resources/mediaprocessor.py", line 1519, in convert
    for timecode, debug in conv:
  File "/volume1/Media/sickbeard/converter/__init__.py", line 309, in convert
    timeout=timeout, preopts=preopts, postopts=postopts):
  File "/volume1/Media/sickbeard/converter/ffmpeg.py", line 707, in convert
    total_output, pid=p.pid)
converter.ffmpeg.FFMpegConvertError: <unprintable FFMpegConvertError object>
2020-12-02 19:53:16 - MANUAL - ERROR - /volume1/Media/sickbeard/ffmpeg/ffmpeg -fix_sub_duration -i /volume1/Media/test/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mkv -vcodec copy -map 0:0 -metadata:s:v title=HD -metadata:s:v handler_name=HD -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=jpn -disposition:a:0 -lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-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 -lyrics-comment-original-dub-karaoke-hearing_impaired+default-forced-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -y /volume1/Convert/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mp4
2020-12-02 19:53:16 - MANUAL - ERROR - ffmpeg version N-55112-g7eb9cf593e-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2020 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      56. 61.100 / 56. 61.100
  libavcodec     58.114.100 / 58.114.100
  libavformat    58. 64.100 / 58. 64.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 91.100 /  7. 91.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Input #0, matroska,webm, from '/volume1/Media/test/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mkv':
  Metadata:
    encoder         : libebml v1.3.1 + libmatroska v1.4.2
    creation_time   : 2015-11-26T07:25:47.000000Z
  Duration: 00:25:41.01, start: 0.000000, bitrate: 4881 kb/s
    Chapter #0:0: start 0.000000, end 122.664000
    Metadata:
      title           : Prologue
    Chapter #0:1: start 122.664000, end 215.005000
    Metadata:
      title           : Opening
    Chapter #0:2: start 215.005000, end 748.997000
    Metadata:
      title           : Part A
    Chapter #0:3: start 748.997000, end 759.008000
    Metadata:
      title           : Eyecatch
    Chapter #0:4: start 759.008000, end 1434.975000
    Metadata:
      title           : Part B
    Chapter #0:5: start 1434.975000, end 1524.939000
    Metadata:
      title           : Ending
    Chapter #0:6: start 1524.939000, end 1541.013000
    Metadata:
      title           : Preview
    Stream #0:0(jpn): Video: h264 (High 10), yuv420p10le(tv, bt709, progressive), 1280x720, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      title           : 10bit H.264 - 720p
      BPS             : 4616599
      BPS-eng         : 4616599
      DURATION        : 00:25:40.956000000
      DURATION-eng    : 00:25:40.956000000
      NUMBER_OF_FRAMES: 36946
      NUMBER_OF_FRAMES-eng: 36946
      NUMBER_OF_BYTES : 889247050
      NUMBER_OF_BYTES-eng: 889247050
      _STATISTICS_WRITING_APP: mkvmerge v8.2.0 ('World of Adventure') 32bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.2.0 ('World of Adventure') 32bit
      _STATISTICS_WRITING_DATE_UTC: 2015-11-26 07:25:47
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-26 07:25:47
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(jpn): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : 2.0 AAC
      BPS             : 256445
      BPS-eng         : 256445
      DURATION        : 00:25:41.013000000
      DURATION-eng    : 00:25:41.013000000
      NUMBER_OF_FRAMES: 72235
      NUMBER_OF_FRAMES-eng: 72235
      NUMBER_OF_BYTES : 49398270
      NUMBER_OF_BYTES-eng: 49398270
      _STATISTICS_WRITING_APP: mkvmerge v8.2.0 ('World of Adventure') 32bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.2.0 ('World of Adventure') 32bit
      _STATISTICS_WRITING_DATE_UTC: 2015-11-26 07:25:47
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-26 07:25:47
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: ass (default)
    Metadata:
      title           : gg
      BPS             : 127
      BPS-eng         : 127
      DURATION        : 00:25:14.510000000
      DURATION-eng    : 00:25:14.510000000
      NUMBER_OF_FRAMES: 376
      NUMBER_OF_FRAMES-eng: 376
      NUMBER_OF_BYTES : 24146
      NUMBER_OF_BYTES-eng: 24146
      _STATISTICS_WRITING_APP: mkvmerge v8.2.0 ('World of Adventure') 32bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v8.2.0 ('World of Adventure') 32bit
      _STATISTICS_WRITING_DATE_UTC: 2015-11-26 07:25:47
      _STATISTICS_WRITING_DATE_UTC-eng: 2015-11-26 07:25:47
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3: Attachment: ttf
    Metadata:
      filename        : KozMinPro-Regular.ttf
      mimetype        : application/x-truetype-font
    Stream #0:4: Attachment: ttf
    Metadata:
      filename        : LIDSTFCE.TTF
      mimetype        : application/x-truetype-font
    Stream #0:5: Attachment: ttf
    Metadata:
      filename        : META-MEDIUM-ROMAN.TTF
      mimetype        : application/x-truetype-font
    Stream #0:6: Attachment: ttf
    Metadata:
      filename        : plantc.ttf
      mimetype        : application/x-truetype-font
    Stream #0:7: Attachment: ttf
    Metadata:
      filename        : Vnthfapf.TTF
      mimetype        : application/x-truetype-font
    Stream #0:8: Attachment: ttf
    Metadata:
      filename        : aparajb.ttf
      mimetype        : application/x-truetype-font
    Stream #0:9: Attachment: ttf
    Metadata:
      filename        : IwaNGoPro-Md-AW.ttf
      mimetype        : application/x-truetype-font
/volume1/Convert/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mp4: No such file or directory

2020-12-02 19:53:16 - MANUAL - ERROR - There was an error processing file /volume1/Media/test/Attack on Titan - S01E01 - To You, in 2000 Years- The Fall of Shiganshina, Part 1.mkv, no output data received
mdhiggins commented 3 years ago

Looks like FFMpeg is erroring out while trying to read the input file. Might just be an FFMpeg issue or a corrupt source file. Do other files error? If you run the FFMpeg command on its own (it's in the logs, you may need to add quotes to some parameters) does that give any more error information?

bcrdncola commented 3 years ago

Ah that helped! Looks like I had a mistake in my output folder destination, and since the folder didn't exist ffmpeg was erroring out. Fixing the output folder in the autoProcess.ini corrected my issue,