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.52k stars 202 forks source link

X264 Conversion postRadarr.py error #1592

Closed GeekItTillItMhz closed 2 years ago

GeekItTillItMhz commented 2 years ago

Describe the bug Trying to convert MKV to MP4 with x264. I seem to be getting an error in postRadarr.py that is related to width and height.

Command or context you are trying to run postRadarr.py

autoProcess.ini settings

[Converter]
ffmpeg = ffmpeg
ffprobe = 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 = tmp
minimum-size = 0
ignored-extensions = nfo, ds_store
copy-to = 
move-to = 
delete-original = True
sort-streams = True
process-same-extensions = True
force-convert = False
post-process = False
wait-post-process = False
detailed-progress = False
preopts = 
postopts = 
bypass-if-copying-all = False
opts-separator = ,
regex-directory-replace = [^\w\-_\. ]
temp-output = 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 = 
strip-metadata = False
keep-titles = False

[Video]
codec = x264, h264
max-bitrate = 4000
crf = -1
crf-profiles = 
preset = fast
codec-parameters = 
dynamic-parameters = False
max-width = 1280
profile = baseline
max-level = 0.0
pix-fmt = 
filter = 
force-filter = False
bitrate-ratio = 
prioritize-source-pix-fmt = True

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

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

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

[Subtitle]
codec = mov_text
codec-image-based = 
languages = english,en,EN,English
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

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

[Radarr]
host = 127.0.0.1
port = 7878
apikey = Omitted
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 = 

[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 = 

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

[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.Subliminal.Auth]
opensubtitles = 
tvsubtitles = 

[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 = 

Log files

2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Input Data
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 8344698,
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 23.976023976023978,
        "framedata": {
            "pix_fmt": "yuv420p",
            "color_space": "bt709",
            "color_primaries": "bt709",
            "color_transfer": "bt709"
        },
        "dimensions": "1920x800",
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "ita",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 2,
            "codec": "ac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "ita",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 3,
            "codec": "eac3",
            "bitrate": 768000,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 4,
            "codec": "ac3",
            "bitrate": 640000,
            "channels": 6,
            "samplerate": 48000,
            "language": "eng",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "index": 5,
            "codec": "subrip",
            "disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired-captions",
            "language": "ita"
        },
        {
            "index": 6,
            "codec": "subrip",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "ita"
        },
        {
            "index": 7,
            "codec": "subrip",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        },
        {
            "index": 8,
            "codec": "subrip",
            "disposition": "+default-dub-original-comment-lyrics-karaoke+forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        }
    ],
    "attachment": []
}
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Reading video stream.
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Video codec detected: h264.
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Profile: high.
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Video codec parameters None.
2022-06-07 23:04:56 - resources.mediaprocessor - INFO - Creating x264 video stream from source stream 0.
2022-06-07 23:04:56 - 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-07 23:04:56 - RadarrPostProcess - INFO - Processing returned False.
2022-06-07 23:04:56 - RadarrPostProcess - ERROR - Error processing file.
Traceback (most recent call last):
  File "/usr/local/sma/postRadarr.py", line 304, in <module>
    sys.exit(1)
SystemExit: 1

FFMpeg headers (From Docker Container)

ffmpeg version 5.0.1-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

System Information

Expected behavior Conversion to start

mdhiggins commented 2 years ago

6e3010cabe5c251f121722fa013e063f19fe218a

This should fix it

Related to the recent custom title rework not handling NoneType like it was supposed to, let me know if that works

Edit: Also thank you for using the template, makes it much easier to get to the root cause

GeekItTillItMhz commented 2 years ago

Works great! The conversion started.

Thank you for your work and diligence to this project.