diff --git a/README.md b/README.md index 26232ff8..b814fdfc 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ General MP4 Configuration - `audio-language` = 3 letter language code for audio streams you wish to copy. Leave blank to copy all. Separate multiple audio streams with commas (ex: eng,spa) - `audio-default-language` = If an audio stream with an unidentified/untagged language is detected, you can default that language tag to whatever this value is (ex: eng). This is useful for many single-audio releases which don't bother to tag the audio stream as anything - `audio-filter` = Applies FFMPEG audio filter. Make sure you specify all parameters are you would using the `-af` option with FFMPEG command line + - `aac_adtstoasc` = Applies the aac_adtstoasc filter to AAC channels being copied. Useful if your source of mkv's uses raw ADTS AAC containers but can cause some playback issues with certain audio encoders - `subtitle-codec` = set your desired subtitle codec. If you're embedding subs, `mov_text` is the only option supported. If you're creating external subtitle files, `srt` or `webvtt` are accepted. - `subtitle-language` = same as audio-language but for subtitles. Set to `nil` to disable copying of subtitles. - `subtitle-language-default` = same as audio-language-default but for subtitles diff --git a/autoProcess.ini.sample b/autoProcess.ini.sample index 9a67bb7a..fa28c28e 100644 --- a/autoProcess.ini.sample +++ b/autoProcess.ini.sample @@ -54,6 +54,7 @@ sub-providers = addic7ed,podnapisi,thesubdb,opensubtitles permissions = 0777 post-process = False pix-fmt = +aac_adtstoasc = False [CouchPotato] host = localhost diff --git a/mkvtomp4.py b/mkvtomp4.py index 4d62386e..bb850a12 100644 --- a/mkvtomp4.py +++ b/mkvtomp4.py @@ -31,6 +31,7 @@ def __init__(self, settings=None, iOSFirst=False, iOS_filter=None, maxchannels=None, + aac_adtstoasc=False, awl=None, swl=None, adl=None, @@ -84,6 +85,7 @@ def __init__(self, settings=None, self.maxchannels = maxchannels self.awl = awl self.adl = adl + self.aac_adtstoasc = aac_adtstoasc # Subtitle settings self.scodec = scodec self.swl = swl @@ -130,6 +132,7 @@ def importSettings(self, settings): self.maxchannels = settings.maxchannels self.awl = settings.awl self.adl = settings.adl + self.aac_adtstoasc = settings.aac_adtstoasc # Subtitle settings self.scodec = settings.scodec self.swl = settings.swl @@ -422,7 +425,7 @@ def generateOptions(self, inputfile, original=None): 'disposition': disposition, }}) - if acodec == 'copy' and a.codec == 'aac': + if acodec == 'copy' and a.codec == 'aac' and self.aac_adtstoasc: audio_settings[l]['bsf'] = 'aac_adtstoasc' l = l + 1 diff --git a/readSettings.py b/readSettings.py index f7ffa605..bc36d546 100644 --- a/readSettings.py +++ b/readSettings.py @@ -79,6 +79,7 @@ def __init__(self, directory, filename, logger=None): 'video-bitrate': '', 'video-max-width': '', 'h264-max-level': '', + 'aac_adtstoasc': 'False', 'use-qsv-decoder-with-encoder': 'True', 'subtitle-codec': 'mov_text', 'subtitle-language': '', @@ -299,6 +300,8 @@ def __init__(self, directory, filename, logger=None): except: self.postprocess = False + self.aac_adtstoasc = config.getboolean(section, 'aac_adtstoasc') + # Setup variable for maximum audio channels self.maxchannels = config.get(section, 'max-audio-channels') if self.maxchannels == "":