Skip to content

Commit

Permalink
added force processing option
Browse files Browse the repository at this point in the history
  • Loading branch information
yajrendrag committed Oct 28, 2024
1 parent 59c8659 commit 8ca85fd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions source/encoder_audio_libfdk_aac/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

**<span style="color:#56adda">0.0.9</span>**
- added force processing option

**<span style="color:#56adda">0.0.8</span>**
- set channels to 6 if channels > 6

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion source/encoder_audio_libfdk_aac/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"on_worker_process": 0
},
"tags": "audio,encoder,ffmpeg,library file test",
"version": "0.0.8"
"version": "0.0.9"
}
7 changes: 6 additions & 1 deletion source/encoder_audio_libfdk_aac/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
class Settings(PluginSettings):
settings = {
"advanced": False,
"force_processing": False,
"max_muxing_queue_size": 2048,
"main_options": "",
"advanced_options": "",
Expand All @@ -47,6 +48,9 @@ def __init__(self, *args, **kwargs):
"advanced": {
"label": "Write your own FFmpeg params",
},
"force_processing": {
"label": "process streams even if audio is already aac encoded",
},
"max_muxing_queue_size": self.__set_max_muxing_queue_size_form_settings(),
"main_options": self.__set_main_options_form_settings(),
"advanced_options": self.__set_advanced_options_form_settings(),
Expand Down Expand Up @@ -137,12 +141,13 @@ def calculate_bitrate(stream_info: dict):
return int(channels) * 64

def test_stream_needs_processing(self, stream_info: dict):
force_processing = self.settings.get_setting('force_processing')
# Ignore streams already of the required codec_name
if ('tags' in stream_info and 'ENCODER' in stream_info.get('tags') and self.encoder in stream_info.get('tags')['ENCODER']):
logger.debug("codec name: '{}', ENCODER: '{}'".format(stream_info.get('codec_name'), stream_info.get('tags')['ENCODER']))
if stream_info.get('codec_name').lower() in [self.codec] and (
'tags' in stream_info and 'ENCODER' in stream_info.get('tags') and
self.encoder in stream_info.get('tags')['ENCODER']):
self.encoder in stream_info.get('tags')['ENCODER'] and not force_processing):
return False
return True

Expand Down

0 comments on commit 8ca85fd

Please sign in to comment.