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 200 forks source link

Keep all audio in sonarr radarr post process #1686

Closed jakanaka closed 1 year ago

jakanaka commented 1 year ago

Describe the bug I want to keep all the audio track of a file in sonarr radarr post process. Supposes i have 3 audio tracks in the file. Sometimes 1 is kept, sometime 2 sometimes all. Many torrent i use does not level torrent as dual audio. I am not sure how the post process is selecting the tracks. Probably following the sonarr radarr config. I want keep all audio regardless of config, like it does with manual run

Command or context you are trying to run Sonarrr Radarr post process

autoProcess.ini settings

[Converter]
ffmpeg = ffmpeg.exe
ffprobe = ffprobe.exe
threads = 0
hwaccels = 
hwaccel-decoders = hevc_cuvid, h264_cuda, hevc_cuda, h264_cuvid
hwdevices = 
hwaccel-output-format = cuda:cuda
output-directory =  <reducted>
output-directory-space-ratio = 0.0
output-format = mp4
output-extension = mp4
temp-extension = tmp
minimum-size = 0
ignored-extensions = nfo, ds_store
copy-to = 
move-to = 
delete-original = True
process-same-extensions = False
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 = 0644
uid = -1
gid = -1

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

[Video]
codec = h264_nvenc, x264, h264
max-bitrate = 3560
bitrate-ratio = 
crf = -1
crf-profiles = 
preset = slow
codec-parameters = 
dynamic-parameters = False
max-width = 0
profile = high
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 = high
codec-parameters = 
filter = 
force-filter = False
profile = 

[Audio]
codec = aac
languages = 
default-language = eng
include-original-language = True
first-stream-of-language = False
channel-bitrate = 256
variable-bitrate = 0
max-bitrate = 256
max-channels = 2
filter = 
profile = 
force-filter = False
sample-rates = 
sample-format = 
copy-original = False
aac-adtstoasc = False
ignored-dispositions = 
force-default = True
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 = 
channel-bitrate = 256
variable-bitrate = 0
first-stream-only = True
filter = 
profile = 
force-filter = False

[Audio.ChannelFilters]

[Subtitle]
codec = mov_text
codec-image-based = 
languages = eng
default-language = eng
include-original-language = False
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 = 
force-default = False
unique-dispositions = False
attachment-codec = 
remove-bitstream-subs = False

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

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

[Subtitle.FFSubsync]
enabled = True

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

[Subtitle.Subliminal.Auth]
opensubtitles =  <reducted>

[Sonarr]
host = localhost
port =  <reducted>
apikey =  <reducted>
ssl = False
webroot = 
force-rename = False
rescan = True
block-reprocess = True
in-progress-check = True

[Radarr]
host = localhost
port =  <reducted>
apikey =  <reducted>
ssl = False
webroot = 
force-rename = False
rescan = True
block-reprocess = True
in-progress-check = True

[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 =  <reducted>
password =  <reducted>
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 =  <reducted>
ssl = False
username = <reducted>
password =  <reducted>
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 = 8182
username = 
password = 
output-directory = 
path-mapping = 

[Plex]
host = localhost
port = 32400
refresh = False
token = 
username = 
password = 
servername = 
ssl = True
ignore-certs = False
path-mapping = 

Log files Include log files for the specific job (not just a dump of all your logs for the past month) that's causing the issue. Please turn on debug level logging Log files are found in your script root config folder ./sma/config/sma.log

FFMpeg headers Run ffmpeg and post the headers, example [headers]https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/FFMPEG-Headers

System Information

Expected behavior A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

Issues posted without any logs or autoProcess settings will be closed

VampiricAlien commented 1 year ago

aac audio is selected, if you want the script to keep other audio tracks replace aac with copy or audio1, audio2, Audio3, and you also have eng set as language

[Audio]
codec = aac, eac3
languages = 
default-language = 
include-original-language = True
first-stream-of-language = False
channel-bitrate = 256
variable-bitrate = 0
max-bitrate = 256
max-channels = 2
filter = 
profile = 
force-filter = False
sample-rates = 
sample-format = 
copy-original = False
aac-adtstoasc = False
ignored-dispositions = 
force-default = True
unique-dispositions = False
stream-codec-combinations = 

[Audio.Sorting]
sorting = language, channels.d, map, d.comment
default-sorting = channels.d, map, d.comment
codecs = 
jakanaka commented 1 year ago

aac audio is selected, if you want the script to keep other audio tracks replace aac with copy or audio1, audio2, Audio3, and you also have eng set as language

[Audio]
codec = aac, eac3
languages = 
default-language = 
include-original-language = True
first-stream-of-language = False
channel-bitrate = 256
variable-bitrate = 0
max-bitrate = 256
max-channels = 2
filter = 
profile = 
force-filter = False
sample-rates = 
sample-format = 
copy-original = False
aac-adtstoasc = False
ignored-dispositions = 
force-default = True
unique-dispositions = False
stream-codec-combinations = 

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

https://github.com/mdhiggins/sickbeard_mp4_automator/wiki/AutoProcess-Settings#audio

according to the wiki,

codec csv ac3 Approved audio codecs. Codecs not on this list are converted to the first codec on the list
languages csv   Approved audio stream languages. Languages not on this list will not be used. Leave blank to approve all languages
default-language str   If audio stream language is undefined, assumed this language

so my

codec = aac
languages = 
default-language = eng

setting should catch all audios

jakanaka commented 1 year ago

@mdhiggins sir, can you help me with this? this problem only occurs on the post processing. it works fine if added manually

mdhiggins commented 1 year ago

There is no difference between manual and postSonarr/postRadarr they all use the same functions to perform the conversion. Post some logs of conversions not behaving as expected if you want further assistance

The codec is irrelevant though the only thing that would not include an audio track from source material would be language or ignore-disposition settings but this behavior is not different across the various scripts. They all point to mediaprocessor.py

jakanaka commented 1 year ago

There is no difference between manual and postSonarr/postRadarr they all use the same functions to perform the conversion. Post some logs of conversions not behaving as expected if you want further assistance

The codec is irrelevant though the only thing that would not include an audio track from source material would be language or ignore-disposition settings but this behavior is not different across the various scripts. They all point to mediaprocessor.py

Yes, i have take a look at the mediaprocessor.py file. They all seem to call it.

Here is the log from the sonarr post process. The error related to to the ffsubsyc is related to https://github.com/mdhiggins/sickbeard_mp4_automator/blob/ced493e63fcc32f353e76d9d8fe14398eb703770/resources/mediaprocessor.py#L1817 , making it ".sync.srt" solves the issue

2023-11-03 21:46:04 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2023-11-03 21:46:04 - resources.readsettings - INFO - C:\Users\user\AppData\Local\Programs\Python\Python311\python.exe
2023-11-03 21:46:04 - resources.readsettings - INFO - Loading config file C:\utils\sickbeard_mp4_automator\config\autoProcess.ini.
2023-11-03 21:46:05 - resources.mediaprocessor - INFO - Processing K:\TV\Scam 2003 - The Telgi Story (2023) [tvdbid-436591]\S01\Scam 2003 - The Telgi Story - S01E09 - 1080p.mkv.
2023-11-03 21:46:05 - resources.metadata - ERROR - Unable to retrieve rating.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Input Data
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 3190407,
        "pix_fmt": "yuvj420p",
        "profile": "main",
        "fps": 25.0,
        "framedata": {
            "pix_fmt": "yuvj420p",
            "color_space": "bt709",
            "color_primaries": "bt709",
            "color_transfer": "bt709",
            "side_data_list": [
                {
                    "side_data_type": "H.26[45] User Data Unregistered SEI message"
                }
            ]
        },
        "dimensions": "1920x1080",
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "bitrate": 448000,
            "channels": 6,
            "samplerate": 48000,
            "language": "hin",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "ben",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 3,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "guj",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 4,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "kan",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 5,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "mal",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 6,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "mar",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 7,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "tam",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 8,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "tel",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "index": 9,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        }
    ],
    "attachment": [
        {
            "index": 11,
            "codec": "unknown",
            "filename": "kodi-metadata",
            "mimetype": "application/xml"
        }
    ]
}
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Reading video stream.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Video codec detected: h264.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Pix Fmt: yuvj420p.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Profile: main.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Video codec parameters None.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Creating h264_nvenc video stream from source stream 0.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Reading audio streams.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 hin 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Creating aac audio stream from source stream 1.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 2 - eac3 ben 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 3 - eac3 guj 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 4 - eac3 kan 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 5 - eac3 mal 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 6 - eac3 mar 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 7 - eac3 tam 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Audio detected for stream 8 - eac3 tel 6 channel.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Final sorting:
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - ['0->0']
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Final sorting:
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - ['0->0']
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Default audio stream set to hin aac 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Reading subtitle streams.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Subtitle detected for stream 9 - subrip eng.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Stream 9 is text-based subtitle for codec subrip.
2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Ripping eng subtitle from source stream 9 into external file.
2023-11-03 21:46:10 - resources.mediaprocessor - INFO - D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt created.
2023-11-03 21:46:10 - resources.mediaprocessor - INFO - Subtitle D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt extracted for cleaning/syncing [subtitles.cleanit, subtitles.ffsubsync].
2023-11-03 21:46:13 - resources.mediaprocessor - ERROR - Exception syncing subtitle D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt.
Traceback (most recent call last):
  File "C:\utils\sickbeard_mp4_automator\resources\mediaprocessor.py", line 1823, in syncExternalSub
    result = ffsubsync.run(self.args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\ffsubsync\ffsubsync.py", line 509, in run
    sync_was_successful = _run_impl(args, result)
                          ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\ffsubsync\ffsubsync.py", line 458, in _run_impl
    return try_sync(args, reference_pipe, result)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\ffsubsync\ffsubsync.py", line 225, in try_sync
    raise exc
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\ffsubsync\ffsubsync.py", line 207, in try_sync
    out_subs.write_file(srtout)
  File "C:\Users\user\AppData\Local\Programs\Python\Python311\Lib\site-packages\ffsubsync\generic_subtitles.py", line 159, in write_file
    raise NotImplementedError("unsupported output format: %s" % out_format)
NotImplementedError: unsupported output format: sync
2023-11-03 21:46:13 - resources.mediaprocessor - INFO - Attempting to download subtitles.
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 1 results in your approved languages.
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream by importing Text-based subtitle Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt [embed-subs].
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Final sorting:
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - ['0->0']
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - h264_cuvid decoder is supported by this ffmpeg build and will also be used [hwaccel-decoders].
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Output Data
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - {
    "source": [
        "K:\\TV\\Scam 2003 - The Telgi Story (2023) [tvdbid-436591]\\S01\\Scam 2003 - The Telgi Story - S01E09 - 1080p.mkv",
        "D:\\temp\\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt"
    ],
    "format": "mp4",
    "video": {
        "codec": "h264_nvenc",
        "map": 0,
        "bitrate": 2560,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": "high",
        "preset": "slow",
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.max-bitrate.profile",
        "title": "FHD"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "hin",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        }
    ],
    "subtitle": [
        {
            "source": 1,
            "map": 0,
            "codec": "mov_text",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng",
            "debug": "subtitle.embed-subs",
            "title": null
        }
    ],
    "attachment": []
}
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Preopts
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - [
    "-fix_sub_duration",
    "-vcodec",
    "h264_cuvid"
]
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Postopts
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Downloaded Subtitles
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - []
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - Starting conversion.
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - FFmpeg command:
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - ======================
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - C:\utils\ffmpeg\bin\ffmpeg.exe -fix_sub_duration -vcodec h264_cuvid -i "K:\TV\Scam 2003 - The Telgi Story (2023) [tvdbid-436591]\S01\Scam 2003 - The Telgi Story - S01E09 - 1080p.mkv" -i "D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt" -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2560k -metadata:s:v BPS=2560000 -metadata:s:v BPS-eng=2560000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -preset slow -profile:v high -tag:v avc1 -c:a:0 aac -map 0:1 -ac:a:0 2 -b:a:0 160k -metadata:s:a:0 BPS=160000 -metadata:s:a:0 BPS-eng=160000 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=hin -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -c:s:0 mov_text -map 1:0 -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 "D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.tmp"
2023-11-03 21:46:15 - resources.mediaprocessor - INFO - ======================
2023-11-03 21:50:46 - resources.mediaprocessor - INFO - D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.tmp created.
2023-11-03 21:50:46 - resources.mediaprocessor - INFO - Output file is in output_dir D:\temp, moving back to original directory K:\TV\Scam 2003 - The Telgi Story (2023) [tvdbid-436591]\S01.
2023-11-03 21:50:47 - SonarrPostProcess - ERROR - Sonarr monitor status update failed.
Traceback (most recent call last):
  File "C:\utils\sickbeard_mp4_automator\postSonarr.py", line 260, in <module>
    inProcess = settings.Sonarr['in-progress-check'] and downloadedEpisodesScanInProgress(baseURL, headers, episodefile_sourcefolder, log)
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\utils\sickbeard_mp4_automator\postSonarr.py", line 80, in downloadedEpisodesScanInProgress
    if c.get('name') == "DownloadedEpisodesScan":
       ^^^^^
AttributeError: 'str' object has no attribute 'get'

as you can see it only made acc for the original audio 2023-11-03 21:46:06 - resources.mediaprocessor - INFO - Creating aac audio stream from source stream 1.

jakanaka commented 1 year ago

here is the manual processor output, i have edit the .sync part so there is no error about it

Manual processor started.
Python 64-bit 3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)].
Guessit version: 3.7.1.
C:\Users\user\AppData\Local\Programs\Python\Python311\python.exe
Loading config file C:\utils\sickbeard_mp4_automator\config\autoProcess.ini.
Processing file D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.mkv
Input Data
{
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 3190407,
        "pix_fmt": "yuvj420p",
        "profile": "main",
        "fps": 25.0,
        "framedata": {
            "pix_fmt": "yuvj420p",
            "color_space": "bt709",
            "color_primaries": "bt709",
            "color_transfer": "bt709",
            "side_data_list": [
                {
                    "side_data_type": "H.26[45] User Data Unregistered SEI message"
                }
            ]
        },
        "dimensions": "1920x1080",
        "level": 4.0,
        "field_order": "progressive"
    },
    "audio": [
        {
            "index": 1,
            "codec": "eac3",
            "bitrate": 448000,
            "channels": 6,
            "samplerate": 48000,
            "language": "hin",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "ben",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 3,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "guj",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 4,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "kan",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 5,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "mal",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 6,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "mar",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 7,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "tam",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        },
        {
            "index": 8,
            "codec": "eac3",
            "bitrate": 256000,
            "channels": 6,
            "samplerate": 48000,
            "language": "tel",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "index": 9,
            "codec": "subrip",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng"
        }
    ],
    "attachment": [
        {
            "index": 11,
            "codec": "unknown",
            "filename": "kodi-metadata",
            "mimetype": "application/xml"
        }
    ]
}
Reading video stream.
Video codec detected: h264.
Pix Fmt: yuvj420p.
Profile: main.
Video codec parameters None.
Creating h264_nvenc video stream from source stream 0.
Reading audio streams.
The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
Audio detected for stream 1 - eac3 hin 6 channel.
Creating aac audio stream from source stream 1.
Audio detected for stream 2 - eac3 ben 6 channel.
Creating aac audio stream from source stream 2.
Audio detected for stream 3 - eac3 guj 6 channel.
Creating aac audio stream from source stream 3.
Audio detected for stream 4 - eac3 kan 6 channel.
Creating aac audio stream from source stream 4.
Audio detected for stream 5 - eac3 mal 6 channel.
Creating aac audio stream from source stream 5.
Audio detected for stream 6 - eac3 mar 6 channel.
Creating aac audio stream from source stream 6.
Audio detected for stream 7 - eac3 tam 6 channel.
Creating aac audio stream from source stream 7.
Audio detected for stream 8 - eac3 tel 6 channel.
Creating aac audio stream from source stream 8.
Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
Final sorting:
['0->0', '1->1', '2->2', '3->3', '4->4', '5->5', '6->6', '7->7']
Final sorting:
['0->0', '1->1', '2->2', '3->3', '4->4', '5->5', '6->6', '7->7']
Default audio stream set to hin aac 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
Reading subtitle streams.
Subtitle detected for stream 9 - subrip eng.

Stream 9 is text-based subtitle for codec subrip.
Ripping eng subtitle from source stream 9 into external file.

d:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt created.
Subtitle d:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt extracted for cleaning/syncing [subtitles.cleanit, subtitles.ffsubsync].
Attempting to download subtitles.
Scanned for external subtitles and found 2 results in your approved languages.

Creating mov_text subtitle stream by importing Text-based subtitle Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt [embed-subs].

Creating mov_text subtitle stream by importing Text-based subtitle Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt [embed-subs].
Final sorting:
['0->0', '1->1']
h264_cuvid decoder is supported by this ffmpeg build and will also be used [hwaccel-decoders].
Output Data
{
    "source": [
        "D:\\temp\\Scam 2003 - The Telgi Story - S01E09 - 1080p.mkv",
        "d:\\temp\\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt",
        "D:\\temp\\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt"
    ],
    "format": "mp4",
    "video": {
        "codec": "h264_nvenc",
        "map": 0,
        "bitrate": 2560,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": "high",
        "preset": "slow",
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.max-bitrate.profile",
        "title": "FHD"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "hin",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 2,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "ben",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 3,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "guj",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 4,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "kan",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 5,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "mal",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 6,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "mar",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 7,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "tam",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        },
        {
            "map": 8,
            "codec": "aac",
            "channels": 2,
            "bitrate": 160,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "tel",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo"
        }
    ],
    "subtitle": [
        {
            "source": 1,
            "map": 0,
            "codec": "mov_text",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng",
            "debug": "subtitle.embed-subs",
            "title": null
        },
        {
            "source": 2,
            "map": 0,
            "codec": "mov_text",
            "disposition": "-default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng",
            "debug": "subtitle.embed-subs",
            "title": null
        }
    ],
    "attachment": []
}
Preopts
[
    "-fix_sub_duration",
    "-vcodec",
    "h264_cuvid"
]
Postopts
[
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
Downloaded Subtitles
[]
Starting conversion.

FFmpeg command:
======================
C:\utils\ffmpeg\bin\ffmpeg.exe -fix_sub_duration -vcodec h264_cuvid -i "D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.mkv" -i "d:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt" -i "D:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.eng.srt" -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2560k -metadata:s:v BPS=2560000 -metadata:s:v BPS-eng=2560000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -preset slow -profile:v high -tag:v avc1 -c:a:0 aac -map 0:1 -ac:a:0 2 -b:a:0 160k -metadata:s:a:0 BPS=160000 -metadata:s:a:0 BPS-eng=160000 -metadata:s:a:0 title=Stereo -metadata:s:a:0 handler_name=Stereo -metadata:s:a:0 language=hin -disposition:a:0 +default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 aac -map 0:2 -ac:a:1 2 -b:a:1 160k -metadata:s:a:1 BPS=160000 -metadata:s:a:1 BPS-eng=160000 -metadata:s:a:1 title=Stereo -metadata:s:a:1 handler_name=Stereo -metadata:s:a:1 language=ben -disposition:a:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:2 aac -map 0:3 -ac:a:2 2 -b:a:2 160k -metadata:s:a:2 BPS=160000 -metadata:s:a:2 BPS-eng=160000 -metadata:s:a:2 title=Stereo -metadata:s:a:2 handler_name=Stereo -metadata:s:a:2 language=guj -disposition:a:2 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:3 aac -map 0:4 -ac:a:3 2 -b:a:3 160k -metadata:s:a:3 BPS=160000 -metadata:s:a:3 BPS-eng=160000 -metadata:s:a:3 title=Stereo -metadata:s:a:3 handler_name=Stereo -metadata:s:a:3 language=kan -disposition:a:3 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:4 aac -map 0:5 -ac:a:4 2 -b:a:4 160k -metadata:s:a:4 BPS=160000 -metadata:s:a:4 BPS-eng=160000 -metadata:s:a:4 title=Stereo -metadata:s:a:4 handler_name=Stereo -metadata:s:a:4 language=mal -disposition:a:4 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:5 aac -map 0:6 -ac:a:5 2 -b:a:5 160k -metadata:s:a:5 BPS=160000 -metadata:s:a:5 BPS-eng=160000 -metadata:s:a:5 title=Stereo -metadata:s:a:5 handler_name=Stereo -metadata:s:a:5 language=mar -disposition:a:5 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:6 aac -map 0:7 -ac:a:6 2 -b:a:6 160k -metadata:s:a:6 BPS=160000 -metadata:s:a:6 BPS-eng=160000 -metadata:s:a:6 title=Stereo -metadata:s:a:6 handler_name=Stereo -metadata:s:a:6 language=tam -disposition:a:6 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:7 aac -map 0:8 -ac:a:7 2 -b:a:7 160k -metadata:s:a:7 BPS=160000 -metadata:s:a:7 BPS-eng=160000 -metadata:s:a:7 title=Stereo -metadata:s:a:7 handler_name=Stereo -metadata:s:a:7 language=tel -disposition:a:7 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 1:0 -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 -c:s:1 mov_text -map 2:0 -metadata:s:s:1 title= -metadata:s:s:1 handler_name= -metadata:s:s:1 language=eng -disposition:s:1 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f mp4 -threads 0 -metadata:g encoding_tool=SMA -strict -2 -y "d:\temp\Scam 2003 - The Telgi Story - S01E09 - 1080p.tmp"
mdhiggins commented 1 year ago

Are you running manual.py with any command line parameters?

jakanaka commented 1 year ago

Are you running manual.py with any command line parameters?

I only pass the config file by -c and input by -i

mdhiggins commented 1 year ago

So the issue here is most likely languages being filtered out based on your settings but I'm not sure why it would be different between the two scripts unless something is modifying the settings before it gets to mediaprocessor.py

Can you potentially re-run things from both sonarr and manual just like above with debug level logging enableed? (see the wiki for how to turn this on)

jakanaka commented 1 year ago

So the issue here is most likely languages being filtered out based on your settings but I'm not sure why it would be different between the two scripts unless something is modifying the settings before it gets to mediaprocessor.py

Can you potentially re-run things from both sonarr and manual just like above with debug level logging enableed? (see the wiki for how to turn this on)

on manual, the log is from this line

https://github.com/mdhiggins/sickbeard_mp4_automator/blob/ced493e63fcc32f353e76d9d8fe14398eb703770/resources/mediaprocessor.py#L1088

i have removed this try catch block from here as it seems to related to custom function

https://github.com/mdhiggins/sickbeard_mp4_automator/blob/ced493e63fcc32f353e76d9d8fe14398eb703770/resources/mediaprocessor.py#L895

There are also two continue here, i have added the logic to add the line number to the log if audio is skipped here

https://github.com/mdhiggins/sickbeard_mp4_automator/blob/ced493e63fcc32f353e76d9d8fe14398eb703770/resources/mediaprocessor.py#L908

https://github.com/mdhiggins/sickbeard_mp4_automator/blob/ced493e63fcc32f353e76d9d8fe14398eb703770/resources/mediaprocessor.py#L910C20-L910C20

i will check any try and put the log here

mdhiggins commented 1 year ago

Have you implemented a custom skipStream function?

jakanaka commented 1 year ago

Have you implemented a custom skipStream function?

I have not, can you take a look at my config if i did something wrong

mdhiggins commented 1 year ago

Custom functions aren't in the config file, hence the ask, I have looked at your config I'm not seeing anything obvious that should be causing it, I have a suspicion where the problem may be though I don't have an explanation for why it would be different between manual and postSonarr though so if you could post the debug logs that would help me narrow it down

jakanaka commented 1 year ago

Custom functions aren't in the config file, hence the ask, I have looked at your config I'm not seeing anything obvious that should be causing it, I have a suspicion where the problem may be though I don't have an explanation for why it would be different between manual and postSonarr though so if you could post the debug logs that would help me narrow it down

i've enable debug logging and downloaded a dual audio content. let's see what happens. btw it sometimes takes all audio, sometime takes few, sometime one. since the beginning i am facing this

mdhiggins commented 1 year ago

From your previous example logs, did you change any settings in between? Specifically did you modify the include-original-language setting by any chance?

jakanaka commented 1 year ago

Custom functions aren't in the config file, hence the ask, I have looked at your config I'm not seeing anything obvious that should be causing it, I have a suspicion where the problem may be though I don't have an explanation for why it would be different between manual and postSonarr though so if you could post the debug logs that would help me narrow it down

2023-11-05 01:39:25 - SonarrPostProcess - INFO - Sonarr extra script post processing started.
2023-11-05 01:39:25 - resources.readsettings - INFO - C:\Users\user\AppData\Local\Programs\Python\Python311\python.exe
2023-11-05 01:39:25 - resources.readsettings - DEBUG - Loading default config file.
2023-11-05 01:39:25 - resources.readsettings - INFO - Loading config file C:\utils\sickbeard_mp4_automator\config\autoProcess.ini.
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - environ({'ALLUSERSPROFILE': 'C:\\ProgramData', 'APPDATA': 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Roaming', 'CLINK_DIR': 'C:\\Program Files (x86)\\clink', 'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files', 'COMMONPROGRAMFILES(X86)': 'C:\\Program Files (x86)\\Common Files', 'COMMONPROGRAMW6432': 'C:\\Program Files\\Common Files', 'COMPUTERNAME': 'CYBERSPACE', 'COMSPEC': 'C:\\Windows\\system32\\cmd.exe', 'DRIVERDATA': 'C:\\Windows\\System32\\Drivers\\DriverData', 'LOCALAPPDATA': 'C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local', 'NO_EXPAND': 'true', 'NO_PRELOADSQLITE': 'true', 'NO_SQLITEFUNCTIONS': 'true', 'NO_SQLITEXMLCONFIGFILE': 'true', 'NUMBER_OF_PROCESSORS': '12', 'OS': 'Windows_NT', 'PATH': 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\WS4W\\;C:\\Program Files\\WireGuard\\;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files (x86)\\cloudflared\\.;C:\\utils\\FileBot\\;C:\\utils\\PSTools;C:\\Program Files\\WireSock VPN Client\\bin\\;C:\\Program Files\\Certbot\\bin;C:\\Windows\\system32\\config\\systemprofile\\AppData\\Local\\Microsoft\\WindowsApps', 'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC', 'PROCESSOR_ARCHITECTURE': 'AMD64', 'PROCESSOR_IDENTIFIER': 'Intel64 Family 6 Model 158 Stepping 10, GenuineIntel', 'PROCESSOR_LEVEL': '6', 'PROCESSOR_REVISION': '9e0a', 'PROGRAMDATA': 'C:\\ProgramData', 'PROGRAMFILES': 'C:\\Program Files', 'PROGRAMFILES(X86)': 'C:\\Program Files (x86)', 'PROGRAMW6432': 'C:\\Program Files', 'PROMPT': '$P$G', 'PSMODULEPATH': 'C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules', 'PUBLIC': 'C:\\Users\\Public', 'SONARR_DELETEDPATHS': 'P:\\tv\\Loki\\S02\\Loki - S02E05 - 1080p.mp4', 'SONARR_DELETEDRELATIVEPATHS': 'S02\\Loki - S02E05 - 1080p.mp4', 'SONARR_DOWNLOAD_CLIENT': 'qBittorrent', 'SONARR_DOWNLOAD_CLIENT_TYPE': 'qBittorrent', 'SONARR_DOWNLOAD_ID': '86FDF6101342AFB59ED8A0C9056B071BB300118C', 'SONARR_EPISODEFILE_EPISODEAIRDATES': '2023-11-02', 'SONARR_EPISODEFILE_EPISODEAIRDATESUTC': '11/3/2023 1:00:00 AM', 'SONARR_EPISODEFILE_EPISODECOUNT': '1', 'SONARR_EPISODEFILE_EPISODEIDS': '33995', 'SONARR_EPISODEFILE_EPISODENUMBERS': '5', 'SONARR_EPISODEFILE_EPISODETITLES': 'Science/Fiction', 'SONARR_EPISODEFILE_ID': '167481', 'SONARR_EPISODEFILE_PATH': 'P:\\tv\\Loki\\S02\\Loki - S02E05 - 1080p.mkv', 'SONARR_EPISODEFILE_QUALITY': 'WEBDL-1080p', 'SONARR_EPISODEFILE_QUALITYVERSION': '2', 'SONARR_EPISODEFILE_RELATIVEPATH': 'S02\\Loki - S02E05 - 1080p.mkv', 'SONARR_EPISODEFILE_RELEASEGROUP': 'AmarHSCookieNai', 'SONARR_EPISODEFILE_SCENENAME': 'Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai', 'SONARR_EPISODEFILE_SEASONNUMBER': '2', 'SONARR_EPISODEFILE_SOURCEFOLDER': 'D:\\torrents', 'SONARR_EPISODEFILE_SOURCEPATH': 'D:\\torrents\\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv', 'SONARR_EVENTTYPE': 'Download', 'SONARR_ISUPGRADE': 'True', 'SONARR_SERIES_ID': '66', 'SONARR_SERIES_IMDBID': 'tt9140554', 'SONARR_SERIES_PATH': 'P:\\tv\\Loki', 'SONARR_SERIES_TITLE': 'Loki', 'SONARR_SERIES_TVDBID': '362472', 'SONARR_SERIES_TVMAZEID': '41007', 'SONARR_SERIES_TYPE': 'Standard', 'SYSTEMDRIVE': 'C:', 'SYSTEMROOT': 'C:\\Windows', 'TEMP': 'C:\\Windows\\TEMP', 'TMP': 'C:\\Windows\\TEMP', 'USERDOMAIN': 'WORKGROUP', 'USERNAME': 'CYBERSPACE$', 'USERPROFILE': 'C:\\Windows\\system32\\config\\systemprofile', 'WINDIR': 'C:\\Windows', 'ZES_ENABLE_SYSMAN': '1'})
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - Block reprocess enabled for Sonarr
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - Input file: P:\tv\Loki\S02\Loki - S02E05 - 1080p.mkv.
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - Original name: Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - TVDB ID: 362472.
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - Season: 2 episode: 5.
2023-11-05 01:39:25 - SonarrPostProcess - DEBUG - Sonarr series ID: 66.
2023-11-05 01:39:26 - resources.mediaprocessor - INFO - Processing P:\tv\Loki\S02\Loki - S02E05 - 1080p.mkv.
2023-11-05 01:39:26 - resources.metadata - DEBUG - Input IDs:
2023-11-05 01:39:26 - resources.metadata - DEBUG - TMDBID: None
2023-11-05 01:39:26 - resources.metadata - DEBUG - IMDBID: tt9140554
2023-11-05 01:39:26 - resources.metadata - DEBUG - TVDBID: 362472
2023-11-05 01:39:26 - resources.metadata - DEBUG - Using TMDB ID: 84958
2023-11-05 01:39:26 - resources.metadata - DEBUG - Tagging language determined to be None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Process started.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Appending eng to allowed audio languages [include-original-language].
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Input Data
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 5352066,
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 24.0,
        "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": "1920x1080",
        "level": 4.0,
        "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"
        },
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 192000,
            "channels": 6,
            "samplerate": 48000,
            "language": "hin",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "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": "ind"
        },
        {
            "index": 5,
            "codec": "subrip",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "msa"
        },
        {
            "index": 6,
            "codec": "subrip",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "tha"
        }
    ],
    "attachment": []
}
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Reading video stream.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Video codec detected: h264.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Pix Fmt: yuv420p.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Profile: high.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Stream is not HDR, color parameter bt709 does not match ['bt2020nc'] [hdr-['bt2020nc']].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Pool of video codecs is ['h264_nvenc', 'x264', 'h264'].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Total bitrate is 6314732.0.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Total audio bitrate is 960000.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Estimated video bitrate is 5354732.0.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Using video bitrate ratio of 1.000000, which results in 5086.995400 changing to 5086.995400.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Overriding video bitrate. Codec cannot be copied because video bitrate is too high [video-max-bitrate].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Source bit-depth 8, output 0, using depth 8.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video codec: h264_nvenc.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video bitrate: 2560.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video CRF: -1.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video maxrate: None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video bufsize: None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video level: 0.0.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video profile: high.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video preset: slow.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video pix_fmt: None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video field order: progressive.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video width: None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Video debug video.max-bitrate.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Video codec parameters None.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Creating h264_nvenc video stream from source stream 0.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Reading audio streams.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Pool universal audio codecs is [].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Pool of audio codecs is ['aac'].
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Audio detected for stream 1 - eac3 eng 6 channel.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Audio stream 1 is flagged as default, forcing inclusion [Audio.force-default].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Audio source exceeds maximum channels, can not be copied. Settings channels to 2 [audio-max-channels].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Calculated bitrate of 392 exceeds maximum bitrate 196, setting to max value [audio-max-bitrate].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Audio codec: aac.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Channels: 2.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Bitrate: 196.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - VBR: 0.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Audio Profile: None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Language: eng.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Filter: None.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Disposition: +default-dub+original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Debug: audio.max-channels.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Creating aac audio stream from source stream 1.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Audio detected for stream 2 - eac3 hin 6 channel.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Purging the following streams:
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - []
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Triggering audio track sort [audio.sorting-sorting].
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Sorting streams with keys ['language', 'channels.d', 'map', 'd.comment'].
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Final sorting:
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - ['0->0']
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Sorting streams with keys ['channels.d', 'map', 'd.comment'].
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Final sorting:
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - ['0->0']
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Sorting audio streams for default audio stream designation.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - 1 total audio streams with 1 set to default disposition. 1 defaults in your preferred language (eng), 0 in other languages.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Default audio stream already inherited from source material, will not override to audio-language-default.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Default audio stream set to eng aac 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Reading subtitle streams.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Subtitle detected for stream 3 - subrip eng.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - isImageBasedSubtitle FFmpeg command:
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - C:\utils\ffmpeg\bin\ffmpeg.exe -i "P:\tv\Loki\S02\Loki - S02E05 - 1080p.mkv" -c:s:0 srt -map 0:3 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=und -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f srt -t 00:00:01 -f null -
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Stream 3 is text-based subtitle for codec subrip.
2023-11-05 01:39:28 - resources.mediaprocessor - INFO - Ripping eng subtitle from source stream 3 into external file.
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - Subtitle extraction FFmpeg command:
2023-11-05 01:39:28 - resources.mediaprocessor - DEBUG - C:\utils\ffmpeg\bin\ffmpeg.exe -i "P:\tv\Loki\S02\Loki - S02E05 - 1080p.mkv" -c:s:0 srt -map 0:3 -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 srt -y "D:\temp\Loki - S02E05 - 1080p.eng.srt"
2023-11-05 01:39:29 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:30 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:30 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:31 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:31 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:32 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:32 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:33 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:34 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:34 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:34 - resources.mediaprocessor - DEBUG - 
2023-11-05 01:39:34 - resources.mediaprocessor - INFO - D:\temp\Loki - S02E05 - 1080p.eng.srt created.
2023-11-05 01:39:34 - resources.mediaprocessor - DEBUG - Processing subtitle file suffix eng.
2023-11-05 01:39:34 - resources.mediaprocessor - DEBUG - Found language match eng.
2023-11-05 01:39:34 - resources.mediaprocessor - INFO - Subtitle D:\temp\Loki - S02E05 - 1080p.eng.srt extracted for cleaning/syncing [subtitles.cleanit, subtitles.ffsubsync].
2023-11-05 01:39:34 - resources.mediaprocessor - DEBUG - Syncing subtitle with path D:\temp\Loki - S02E05 - 1080p.eng.srt [subtitles.ffsubsync].
2023-11-05 01:39:53 - resources.mediaprocessor - DEBUG - {'retval': 0, 'offset_seconds': 0.0, 'framerate_scale_factor': 1.0, 'sync_was_successful': True}
2023-11-05 01:39:53 - resources.mediaprocessor - INFO - Subtitle detected for stream 4 - subrip ind.
2023-11-05 01:39:53 - resources.mediaprocessor - INFO - Subtitle detected for stream 5 - subrip msa.
2023-11-05 01:39:53 - resources.mediaprocessor - INFO - Subtitle detected for stream 6 - subrip tha.
2023-11-05 01:39:53 - resources.mediaprocessor - INFO - Attempting to download subtitles.
2023-11-05 01:39:53 - resources.mediaprocessor - DEBUG - Refining subliminal search using included metadata
2023-11-05 01:39:54 - resources.mediaprocessor - DEBUG - Found original filename, adding data from Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.
2023-11-05 01:39:54 - resources.mediaprocessor - DEBUG - Source Web, release group AmarHSCookieNai, resolution 1080p, streaming service None.
2023-11-05 01:39:54 - resources.mediaprocessor - INFO - Scanned for external subtitles and found 1 results in your approved languages.
2023-11-05 01:39:54 - resources.mediaprocessor - DEBUG - isImageBasedSubtitle FFmpeg command:
2023-11-05 01:39:54 - resources.mediaprocessor - DEBUG - C:\utils\ffmpeg\bin\ffmpeg.exe -i "D:\temp\Loki - S02E05 - 1080p.eng.srt" -c:s:0 srt -map 0:0 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=und -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f srt -t 00:00:01 -f null -
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Creating mov_text subtitle stream by importing Text-based subtitle Loki - S02E05 - 1080p.eng.srt [embed-subs].
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Path: D:\temp\Loki - S02E05 - 1080p.eng.srt.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Codec: mov_text.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Langauge: eng.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Disposition: -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Sorting streams with keys ['language', 'd.comment', 'd.default.d', 'd.forced.d'].
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Final sorting:
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - ['0->0']
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Subtitle streams detected, adding fix_sub_duration option to preopts.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Selected hwaccel options:
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - []
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Selected hwaccel decoder pairs:
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - ['hevc_cuvid', 'h264_cuda', 'hevc_cuda', 'h264_cuvid']
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - FFMPEG hwaccels:
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - ['cuda', 'dxva2', 'qsv', 'd3d11va', 'opencl', 'vulkan']
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Input format yuv420p bit depth 8.
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - h264_cuvid decoder is supported by this ffmpeg build and will also be used [hwaccel-decoders].
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Decoder formats:
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - ['cuda', 'nv12', 'p010le', 'p016le']
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - canBypassConvert returned False.
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Output Data
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - {
    "source": [
        "P:\\tv\\Loki\\S02\\Loki - S02E05 - 1080p.mkv",
        "D:\\temp\\Loki - S02E05 - 1080p.eng.srt"
    ],
    "format": "mp4",
    "video": {
        "codec": "h264_nvenc",
        "map": 0,
        "bitrate": 2560,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": "high",
        "preset": "slow",
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.max-bitrate",
        "title": "FHD"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 196,
            "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,
            "debug": "audio.max-channels",
            "title": "Stereo (Original)"
        }
    ],
    "subtitle": [
        {
            "source": 1,
            "map": 0,
            "codec": "mov_text",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng",
            "debug": "subtitle.embed-subs",
            "title": null
        }
    ],
    "attachment": []
}
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Preopts
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - [
    "-fix_sub_duration",
    "-vcodec",
    "h264_cuvid"
]
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Postopts
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Downloaded Subtitles
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - []
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - Starting conversion.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Input directory: P:\tv\Loki\S02.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - File name: Loki - S02E05 - 1080p.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Input extension: mkv.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Output directory: D:\temp.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Output extension: D:\temp.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Output file: D:\temp\Loki - S02E05 - 1080p.tmp.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Input directory: P:\tv\Loki\S02.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - File name: Loki - S02E05 - 1080p.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Input extension: mkv.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Output directory: D:\temp.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Output extension: D:\temp.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Output file: D:\temp\Loki - S02E05 - 1080p.mp4.
2023-11-05 01:39:55 - resources.mediaprocessor - DEBUG - Final output file: D:\temp\Loki - S02E05 - 1080p.mp4.
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - FFmpeg command:
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - ======================
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - C:\utils\ffmpeg\bin\ffmpeg.exe -fix_sub_duration -vcodec h264_cuvid -i "P:\tv\Loki\S02\Loki - S02E05 - 1080p.mkv" -i "D:\temp\Loki - S02E05 - 1080p.eng.srt" -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2560k -metadata:s:v BPS=2560000 -metadata:s:v BPS-eng=2560000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -preset slow -profile:v high -tag:v avc1 -c:a:0 aac -map 0:1 -ac:a:0 2 -b:a:0 196k -metadata:s:a:0 BPS=196000 -metadata:s:a:0 BPS-eng=196000 -metadata:s:a:0 "title=Stereo (Original)" -metadata:s:a:0 "handler_name=Stereo (Original)" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub+original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -strict experimental -c:s:0 mov_text -map 1:0 -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 "D:\temp\Loki - S02E05 - 1080p.tmp"
2023-11-05 01:39:55 - resources.mediaprocessor - INFO - ======================
jakanaka commented 1 year ago

From your previous example logs, did you change any settings in between? Specifically did you modify the include-original-language setting by any chance?

include-original-language is set to true as my config posted here

mdhiggins commented 1 year ago

Think I found the problem, but I still don't have a reason for manual.py differing hence why I was asking if its possible you changed that one specific setting in between the previous tests

Can you run that same Loki episode through manual.py with debug logging and see if the result differs

jakanaka commented 1 year ago

Think I found the problem, but I still don't have a reason for manual.py differing hence why I was asking if its possible you changed that one specific setting in between the previous tests

Can you run that same Loki episode through manual.py with debug logging and see if the result differs

here, same file but running with python manual.py -i

2023-11-05 02:01:29 - MANUAL - INFO - Manual processor started.
2023-11-05 02:01:29 - MANUAL - INFO - Python 64-bit 3.11.2 (tags/v3.11.2:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)].
2023-11-05 02:01:29 - MANUAL - INFO - Guessit version: 3.7.1.
2023-11-05 02:01:29 - MANUAL - INFO - C:\Users\user\AppData\Local\Programs\Python\Python311\python.exe
2023-11-05 02:01:29 - MANUAL - DEBUG - Loading default config file.
2023-11-05 02:01:29 - MANUAL - INFO - Loading config file C:\utils\sickbeard_mp4_automator\config\autoProcess.ini.
2023-11-05 02:01:30 - MANUAL - INFO - Processing file Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv
2023-11-05 02:01:30 - MANUAL - DEBUG - Process started.
2023-11-05 02:01:30 - MANUAL - INFO - Input Data
2023-11-05 02:01:30 - MANUAL - INFO - {
    "format": "matroska,webm",
    "format-fullname": "Matroska / WebM",
    "video": {
        "index": 0,
        "codec": "h264",
        "bitrate": 5352066,
        "pix_fmt": "yuv420p",
        "profile": "high",
        "fps": 24.0,
        "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": "1920x1080",
        "level": 4.0,
        "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"
        },
        {
            "index": 2,
            "codec": "eac3",
            "bitrate": 192000,
            "channels": 6,
            "samplerate": 48000,
            "language": "hin",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions"
        }
    ],
    "subtitle": [
        {
            "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": "ind"
        },
        {
            "index": 5,
            "codec": "subrip",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "msa"
        },
        {
            "index": 6,
            "codec": "subrip",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "tha"
        }
    ],
    "attachment": []
}
2023-11-05 02:01:30 - MANUAL - INFO - Reading video stream.
2023-11-05 02:01:30 - MANUAL - INFO - Video codec detected: h264.
2023-11-05 02:01:30 - MANUAL - INFO - Pix Fmt: yuv420p.
2023-11-05 02:01:30 - MANUAL - INFO - Profile: high.
2023-11-05 02:01:30 - MANUAL - DEBUG - Stream is not HDR, color parameter bt709 does not match ['bt2020nc'] [hdr-['bt2020nc']].
2023-11-05 02:01:30 - MANUAL - DEBUG - Pool of video codecs is ['h264_nvenc', 'x264', 'h264'].
2023-11-05 02:01:30 - MANUAL - DEBUG - Total bitrate is 6314732.0.
2023-11-05 02:01:30 - MANUAL - DEBUG - Total audio bitrate is 960000.
2023-11-05 02:01:30 - MANUAL - DEBUG - Estimated video bitrate is 5354732.0.
2023-11-05 02:01:30 - MANUAL - DEBUG - Using video bitrate ratio of 1.000000, which results in 5086.995400 changing to 5086.995400.
2023-11-05 02:01:30 - MANUAL - DEBUG - Overriding video bitrate. Codec cannot be copied because video bitrate is too high [video-max-bitrate].
2023-11-05 02:01:30 - MANUAL - DEBUG - Source bit-depth 8, output 0, using depth 8.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video codec: h264_nvenc.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video bitrate: 2560.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video CRF: -1.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video maxrate: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video bufsize: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video level: 0.0.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video profile: high.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video preset: slow.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video pix_fmt: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video field order: progressive.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video width: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Video debug video.max-bitrate.
2023-11-05 02:01:30 - MANUAL - INFO - Video codec parameters None.
2023-11-05 02:01:30 - MANUAL - INFO - Creating h264_nvenc video stream from source stream 0.
2023-11-05 02:01:30 - MANUAL - INFO - Reading audio streams.
2023-11-05 02:01:30 - MANUAL - INFO - The following stream indexes have been identified as being copies: [] [stream-codec-combinations].
2023-11-05 02:01:30 - MANUAL - DEBUG - Pool universal audio codecs is [].
2023-11-05 02:01:30 - MANUAL - DEBUG - Pool of audio codecs is ['aac'].
2023-11-05 02:01:30 - MANUAL - INFO - Audio detected for stream 1 - eac3 eng 6 channel.
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio stream 1 is flagged as default, forcing inclusion [Audio.force-default].
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio source exceeds maximum channels, can not be copied. Settings channels to 2 [audio-max-channels].
2023-11-05 02:01:30 - MANUAL - DEBUG - Calculated bitrate of 392 exceeds maximum bitrate 196, setting to max value [audio-max-bitrate].
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio codec: aac.
2023-11-05 02:01:30 - MANUAL - DEBUG - Channels: 2.
2023-11-05 02:01:30 - MANUAL - DEBUG - Bitrate: 196.
2023-11-05 02:01:30 - MANUAL - DEBUG - VBR: 0.
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio Profile: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Language: eng.
2023-11-05 02:01:30 - MANUAL - DEBUG - Filter: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Disposition: +default-dub+original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
2023-11-05 02:01:30 - MANUAL - DEBUG - Debug: audio.max-channels.
2023-11-05 02:01:30 - MANUAL - INFO - Creating aac audio stream from source stream 1.
2023-11-05 02:01:30 - MANUAL - INFO - Audio detected for stream 2 - eac3 hin 6 channel.
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio source exceeds maximum channels, can not be copied. Settings channels to 2 [audio-max-channels].
2023-11-05 02:01:30 - MANUAL - DEBUG - Calculated bitrate of 392 exceeds maximum bitrate 196, setting to max value [audio-max-bitrate].
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio codec: aac.
2023-11-05 02:01:30 - MANUAL - DEBUG - Channels: 2.
2023-11-05 02:01:30 - MANUAL - DEBUG - Bitrate: 196.
2023-11-05 02:01:30 - MANUAL - DEBUG - VBR: 0.
2023-11-05 02:01:30 - MANUAL - DEBUG - Audio Profile: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Language: hin.
2023-11-05 02:01:30 - MANUAL - DEBUG - Filter: None.
2023-11-05 02:01:30 - MANUAL - DEBUG - Disposition: -default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
2023-11-05 02:01:30 - MANUAL - DEBUG - Debug: audio.max-channels.
2023-11-05 02:01:30 - MANUAL - INFO - Creating aac audio stream from source stream 2.
2023-11-05 02:01:30 - MANUAL - DEBUG - Purging the following streams:
2023-11-05 02:01:30 - MANUAL - DEBUG - []
2023-11-05 02:01:30 - MANUAL - INFO - Found 0 streams that can be removed from the output file since they will be duplicates [stream-codec-combinations].
2023-11-05 02:01:30 - MANUAL - DEBUG - Triggering audio track sort [audio.sorting-sorting].
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorting streams with keys ['language', 'channels.d', 'map', 'd.comment'].
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted ascending with language:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted descending with channels:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted ascending with map:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted ascending with d.comment:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - INFO - Final sorting:
2023-11-05 02:01:30 - MANUAL - INFO - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorting streams with keys ['channels.d', 'map', 'd.comment'].
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted descending with channels:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted ascending with map:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorted ascending with d.comment:
2023-11-05 02:01:30 - MANUAL - DEBUG - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - INFO - Final sorting:
2023-11-05 02:01:30 - MANUAL - INFO - ['0->0', '1->1']
2023-11-05 02:01:30 - MANUAL - DEBUG - Sorting audio streams for default audio stream designation.
2023-11-05 02:01:30 - MANUAL - DEBUG - 2 total audio streams with 1 set to default disposition. 1 defaults in your preferred language (eng), 0 in other languages.
2023-11-05 02:01:30 - MANUAL - DEBUG - Default audio stream already inherited from source material, will not override to audio-language-default.
2023-11-05 02:01:30 - MANUAL - INFO - Default audio stream set to eng aac 2 channel stream [audio-default-sorting: ['channels.d', 'map', 'd.comment']].
2023-11-05 02:01:30 - MANUAL - INFO - Reading subtitle streams.
2023-11-05 02:01:30 - MANUAL - INFO - Subtitle detected for stream 3 - subrip eng.
2023-11-05 02:01:30 - MANUAL - DEBUG - isImageBasedSubtitle FFmpeg command:
2023-11-05 02:01:30 - MANUAL - DEBUG - C:\utils\ffmpeg\bin\ffmpeg.exe -i Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv -c:s:0 srt -map 0:3 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=und -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f srt -t 00:00:01 -f null -
2023-11-05 02:01:30 - MANUAL - INFO - Stream 3 is text-based subtitle for codec subrip.
2023-11-05 02:01:30 - MANUAL - DEBUG - D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.srt exists, appending 2 to filename.
2023-11-05 02:01:30 - MANUAL - INFO - Ripping eng subtitle from source stream 3 into external file.
2023-11-05 02:01:30 - MANUAL - DEBUG - Subtitle extraction FFmpeg command:
2023-11-05 02:01:30 - MANUAL - DEBUG - C:\utils\ffmpeg\bin\ffmpeg.exe -i Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv -c:s:0 srt -map 0:3 -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 srt -y D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt
2023-11-05 02:01:30 - MANUAL - DEBUG - 
2023-11-05 02:01:30 - MANUAL - DEBUG - 
2023-11-05 02:01:30 - MANUAL - INFO - D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt created.
2023-11-05 02:01:31 - MANUAL - DEBUG - Processing subtitle file suffix eng.
2023-11-05 02:01:31 - MANUAL - DEBUG - Found language match eng.
2023-11-05 02:01:31 - MANUAL - DEBUG - Processing subtitle file suffix 2.
2023-11-05 02:01:31 - MANUAL - INFO - Subtitle D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt extracted for cleaning/syncing [subtitles.cleanit, subtitles.ffsubsync].
2023-11-05 02:01:31 - MANUAL - DEBUG - Syncing subtitle with path D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt [subtitles.ffsubsync].
2023-11-05 02:01:35 - MANUAL - DEBUG - {'retval': 0, 'offset_seconds': 0.0, 'framerate_scale_factor': 1.0, 'sync_was_successful': True}
2023-11-05 02:01:35 - MANUAL - INFO - Subtitle detected for stream 4 - subrip ind.
2023-11-05 02:01:35 - MANUAL - INFO - Subtitle detected for stream 5 - subrip msa.
2023-11-05 02:01:35 - MANUAL - INFO - Subtitle detected for stream 6 - subrip tha.
2023-11-05 02:01:35 - MANUAL - INFO - Attempting to download subtitles.
2023-11-05 02:01:35 - MANUAL - INFO - Scanned for external subtitles and found 1 results in your approved languages.
2023-11-05 02:01:35 - MANUAL - DEBUG - isImageBasedSubtitle FFmpeg command:
2023-11-05 02:01:35 - MANUAL - DEBUG - C:\utils\ffmpeg\bin\ffmpeg.exe -i D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt -c:s:0 srt -map 0:0 -metadata:s:s:0 title= -metadata:s:s:0 handler_name= -metadata:s:s:0 language=und -disposition:s:0 -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -f srt -t 00:00:01 -f null -
2023-11-05 02:01:35 - MANUAL - INFO - Creating mov_text subtitle stream by importing Text-based subtitle Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt [embed-subs].
2023-11-05 02:01:35 - MANUAL - DEBUG - Path: D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt.
2023-11-05 02:01:35 - MANUAL - DEBUG - Codec: mov_text.
2023-11-05 02:01:35 - MANUAL - DEBUG - Langauge: eng.
2023-11-05 02:01:35 - MANUAL - DEBUG - Disposition: -default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions.
2023-11-05 02:01:35 - MANUAL - DEBUG - Sorting streams with keys ['language', 'd.comment', 'd.default.d', 'd.forced.d'].
2023-11-05 02:01:35 - MANUAL - INFO - Final sorting:
2023-11-05 02:01:35 - MANUAL - INFO - ['0->0']
2023-11-05 02:01:35 - MANUAL - DEBUG - Subtitle streams detected, adding fix_sub_duration option to preopts.
2023-11-05 02:01:35 - MANUAL - DEBUG - Selected hwaccel options:
2023-11-05 02:01:35 - MANUAL - DEBUG - []
2023-11-05 02:01:35 - MANUAL - DEBUG - Selected hwaccel decoder pairs:
2023-11-05 02:01:35 - MANUAL - DEBUG - ['hevc_cuvid', 'h264_cuda', 'hevc_cuda', 'h264_cuvid']
2023-11-05 02:01:35 - MANUAL - DEBUG - FFMPEG hwaccels:
2023-11-05 02:01:35 - MANUAL - DEBUG - ['cuda', 'dxva2', 'qsv', 'd3d11va', 'opencl', 'vulkan']
2023-11-05 02:01:35 - MANUAL - DEBUG - Input format yuv420p bit depth 8.
2023-11-05 02:01:35 - MANUAL - INFO - h264_cuvid decoder is supported by this ffmpeg build and will also be used [hwaccel-decoders].
2023-11-05 02:01:35 - MANUAL - DEBUG - Decoder formats:
2023-11-05 02:01:35 - MANUAL - DEBUG - ['cuda', 'nv12', 'p010le', 'p016le']
2023-11-05 02:01:35 - MANUAL - DEBUG - canBypassConvert returned False.
2023-11-05 02:01:35 - MANUAL - INFO - Output Data
2023-11-05 02:01:35 - MANUAL - INFO - {
    "source": [
        "Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv",
        "D:\\temp\\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt"
    ],
    "format": "mp4",
    "video": {
        "codec": "h264_nvenc",
        "map": 0,
        "bitrate": 2560,
        "crf": -1,
        "maxrate": null,
        "bufsize": null,
        "level": 0.0,
        "profile": "high",
        "preset": "slow",
        "pix_fmt": null,
        "field_order": "progressive",
        "width": null,
        "filter": null,
        "params": null,
        "framedata": null,
        "bsf": null,
        "debug": "video.max-bitrate",
        "title": "FHD"
    },
    "audio": [
        {
            "map": 1,
            "codec": "aac",
            "channels": 2,
            "bitrate": 196,
            "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,
            "debug": "audio.max-channels",
            "title": "Stereo (Original)"
        },
        {
            "map": 2,
            "codec": "aac",
            "channels": 2,
            "bitrate": 196,
            "profile": null,
            "quality": 0,
            "filter": null,
            "samplerate": null,
            "sampleformat": "",
            "language": "hin",
            "disposition": "-default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "bsf": null,
            "debug": "audio.max-channels",
            "title": "Stereo (Dub)"
        }
    ],
    "subtitle": [
        {
            "source": 1,
            "map": 0,
            "codec": "mov_text",
            "disposition": "+default-dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions",
            "language": "eng",
            "debug": "subtitle.embed-subs",
            "title": null
        }
    ],
    "attachment": []
}
2023-11-05 02:01:35 - MANUAL - INFO - Preopts
2023-11-05 02:01:35 - MANUAL - INFO - [
    "-fix_sub_duration",
    "-vcodec",
    "h264_cuvid"
]
2023-11-05 02:01:35 - MANUAL - INFO - Postopts
2023-11-05 02:01:35 - MANUAL - INFO - [
    "-threads",
    "0",
    "-metadata:g",
    "encoding_tool=SMA"
]
2023-11-05 02:01:35 - MANUAL - INFO - Downloaded Subtitles
2023-11-05 02:01:35 - MANUAL - INFO - []
2023-11-05 02:01:35 - MANUAL - INFO - Starting conversion.
2023-11-05 02:01:35 - MANUAL - DEBUG - Input directory: C:\utils\sickbeard_mp4_automator.
2023-11-05 02:01:35 - MANUAL - DEBUG - File name: Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.
2023-11-05 02:01:35 - MANUAL - DEBUG - Input extension: mkv.
2023-11-05 02:01:35 - MANUAL - DEBUG - Output directory: D:\temp.
2023-11-05 02:01:35 - MANUAL - DEBUG - Output extension: D:\temp.
2023-11-05 02:01:35 - MANUAL - DEBUG - Output file: D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.tmp.
2023-11-05 02:01:35 - MANUAL - DEBUG - Input directory: C:\utils\sickbeard_mp4_automator.
2023-11-05 02:01:35 - MANUAL - DEBUG - File name: Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.
2023-11-05 02:01:35 - MANUAL - DEBUG - Input extension: mkv.
2023-11-05 02:01:35 - MANUAL - DEBUG - Output directory: D:\temp.
2023-11-05 02:01:35 - MANUAL - DEBUG - Output extension: D:\temp.
2023-11-05 02:01:35 - MANUAL - DEBUG - Output file: D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mp4.
2023-11-05 02:01:35 - MANUAL - DEBUG - Final output file: D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mp4.
2023-11-05 02:01:35 - MANUAL - INFO - FFmpeg command:
2023-11-05 02:01:35 - MANUAL - INFO - ======================
2023-11-05 02:01:35 - MANUAL - INFO - C:\utils\ffmpeg\bin\ffmpeg.exe -fix_sub_duration -vcodec h264_cuvid -i Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv -i D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.eng.2.srt -vcodec h264_nvenc -map 0:0 -field_order progressive -vb 2560k -metadata:s:v BPS=2560000 -metadata:s:v BPS-eng=2560000 -metadata:s:v title=FHD -metadata:s:v handler_name=FHD -preset slow -profile:v high -tag:v avc1 -c:a:0 aac -map 0:1 -ac:a:0 2 -b:a:0 196k -metadata:s:a:0 BPS=196000 -metadata:s:a:0 BPS-eng=196000 -metadata:s:a:0 "title=Stereo (Original)" -metadata:s:a:0 "handler_name=Stereo (Original)" -metadata:s:a:0 language=eng -disposition:a:0 +default-dub+original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:a:1 aac -map 0:2 -ac:a:1 2 -b:a:1 196k -metadata:s:a:1 BPS=196000 -metadata:s:a:1 BPS-eng=196000 -metadata:s:a:1 "title=Stereo (Dub)" -metadata:s:a:1 "handler_name=Stereo (Dub)" -metadata:s:a:1 language=hin -disposition:a:1 -default+dub-original-comment-lyrics-karaoke-forced-hearing_impaired-visual_impaired-captions -c:s:0 mov_text -map 1:0 -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 -strict -2 -y D:\temp\Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.tmp
2023-11-05 02:01:35 - MANUAL - INFO - ======================
mdhiggins commented 1 year ago

Figured it out

076bbdd39f26e586874165e018aee306386e4200 should fix it

This is a bug with the include-original-language option

This option looks at the tagdata for the file to determine what the original language is and adds it to your language whitelist if its not there. Problem was I wasn't checking if the list was empty (in which case all languages get allowed) so it was going from [] which would allow all languages to ['eng'] which only allowed english as a result of that option unintentionally

The final piece is that when you were running manual.py it looks like you were NOT tagging the file and thus not including the tagdata (I can tell this from 2023-11-05 02:01:30 - MANUAL - INFO - Processing file Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv because if it had tagdata it would say "Processing %s Season %02d Episode %02d - %s" . Because mediaprocessor.py didn't have any tagdata to use to determine the original language, that option was ignored and thus the bug was bypassed

Adding a simple check to make sure the language whitelist isn't empty beforehand should fix it, which is what I did

mdhiggins commented 1 year ago

ff289e112fb46b8ca2e0dcbf79234a619ee51120 applies the same fix approach for subtitles

jakanaka commented 1 year ago

Figured it out

076bbdd should fix it

This is a bug with the include-original-language option

This option looks at the tagdata for the file to determine what the original language is and adds it to your language whitelist if its not there. Problem was I wasn't checking if the list was empty (in which case all languages get allowed) so it was going from [] which would allow all languages to ['eng'] which only allowed english as a result of that option unintentionally

The final piece is that when you were running manual.py it looks like you were NOT tagging the file and thus not including the tagdata (I can tell this from 2023-11-05 02:01:30 - MANUAL - INFO - Processing file Loki.S02E05.Science.Fiction.REPACK.1080p.WEB-DL.DUAL.DDP5.1.Atmos.H.264-AmarHSCookieNai.mkv because if it had tagdata it would say "Processing %s Season %02d Episode %02d - %s" . Because mediaprocessor.py didn't have any tagdata to use to determine the original language, that option was ignored and thus the bug was bypassed

Adding a simple check to make sure the language whitelist isn't empty beforehand should fix it, which is what I did

thank you sir, while you are at it, can you fix the .sync format error. just making it .sync.srt should do the job and the error

                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\utils\sickbeard_mp4_automator\postSonarr.py", line 80, in downloadedEpisodesScanInProgress
    if c.get('name') == "DownloadedEpisodesScan":
       ^^^^^
AttributeError: 'str' object has no attribute 'get'

https://github.com/mdhiggins/sickbeard_mp4_automator/issues/1686#issuecomment-1793519747

mdhiggins commented 1 year ago

1122cc3e7681c520debff4a307cfb40602243cb2

Like that?

Also not sure what that unrelated Sonarr error is

https://sonarr.tv/docs/api/#/Command/get_api_v3_command

Command shouldn't be returning a string but I can adjust the exception catch

7477a8e3acdffcca1e7c596db2fe5bbdfadebe96

jakanaka commented 1 year ago

thank you sir