diff --git a/README.md b/README.md index 2684729..d6dbb21 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ Example: `C:\Users\Kyrch\AppData\Local\AnimeThemes\beta_batch_encoder\beta_batch **Video Filters** +* `No Filters` Add a line without filter * `scale=-1:720` Add downscale to 720p * `scale=-1:720,hqdn3d=0:0:3:3,gradfun,unsharp` Add downscale to 720p and filters by AnimeThemes * `hqdn3d=0:0:3:3,gradfun,unsharp` Add filters by AnimeThemes diff --git a/beta_batch_encoder/_encode_webm.py b/beta_batch_encoder/_encode_webm.py index 6de574b..6a84ee8 100644 --- a/beta_batch_encoder/_encode_webm.py +++ b/beta_batch_encoder/_encode_webm.py @@ -154,7 +154,7 @@ class EncodeWebM: if config_filter is not None: video_filters.append(config_filter) - if not video_filters or len(video_filters[0].strip()) == 0: + if not video_filters or len(video_filters[0].strip()) == 0 or 'No Filters' in video_filters: return '' return ' -vf ' + ','.join(video_filters) @@ -191,13 +191,6 @@ class EncodeWebM: for encoding_mode in encoding_config.encoding_modes: if BitrateMode.CBR.name == encoding_mode.upper(): file_commands.append(self.get_first_pass(BitrateMode.CBR, threads=encoding_config.threads)) - if encoding_config.include_unfiltered: - file_commands.append(self.get_second_pass(BitrateMode.CBR, - threads=encoding_config.threads, - video_filters=EncodeWebM.get_video_filters(), - limit_size_enable=encoding_config.limit_size_enable, - webm_filename=self.get_webm_filename( - cbr_bitrate=self.cbr_bitrate))) for filter_name, filter_value in encoding_config.video_filters: file_commands.append(self.get_second_pass(BitrateMode.CBR, threads=encoding_config.threads, @@ -210,11 +203,6 @@ class EncodeWebM: elif BitrateMode.VBR.name == encoding_mode.upper(): for crf in encoding_config.crfs: file_commands.append(self.get_first_pass(BitrateMode.VBR, crf=crf, threads=encoding_config.threads)) - if encoding_config.include_unfiltered: - file_commands.append( - self.get_second_pass(BitrateMode.VBR, crf=crf, threads=encoding_config.threads, video_filters=EncodeWebM.get_video_filters(), - limit_size_enable=encoding_config.limit_size_enable, - webm_filename=self.get_webm_filename(crf=crf))) for filter_name, filter_value in encoding_config.video_filters: file_commands.append(self.get_second_pass(BitrateMode.VBR, crf=crf, threads=encoding_config.threads, @@ -227,12 +215,6 @@ class EncodeWebM: elif BitrateMode.CQ.name == encoding_mode.upper(): for crf in encoding_config.crfs: file_commands.append(self.get_first_pass(BitrateMode.CQ, crf=crf, threads=encoding_config.threads)) - if encoding_config.include_unfiltered: - file_commands.append( - self.get_second_pass(BitrateMode.CQ, crf=crf, threads=encoding_config.threads, video_filters=self.get_video_filters(), - limit_size_enable=encoding_config.limit_size_enable, - webm_filename=self.get_webm_filename(crf=crf, - cbr_bitrate=self.cbr_bitrate))) for filter_name, filter_value in encoding_config.video_filters: file_commands.append(self.get_second_pass(BitrateMode.CQ, crf=crf, threads=encoding_config.threads, diff --git a/beta_batch_encoder/_interface.py b/beta_batch_encoder/_interface.py index 4cfa365..ec9beb6 100644 --- a/beta_batch_encoder/_interface.py +++ b/beta_batch_encoder/_interface.py @@ -113,6 +113,7 @@ class Interface: # Prompt the user for our list of video filters def video_filters(encoding_config): video_filters_options = { + 'No Filters': 'no-vf', 'scale=-1:720': '720p', 'scale=-1:720,hqdn3d=0:0:3:3,gradfun,unsharp': 'filtered-720p', 'hqdn3d=0:0:3:3,gradfun,unsharp': 'filtered', @@ -121,6 +122,9 @@ class Interface: 'unsharp': 'unsharp', 'Custom': 'custom' } + + if encoding_config.include_unfiltered: + encoding_config.video_filters.append(('no-vf', 'No Filters')) question = [inquirer.Checkbox('video_filters', message='Select Video Filters (Space to select)', choices=video_filters_options.keys(), default=[tp[1] for tp in encoding_config.video_filters])] diff --git a/beta_batch_encoder/_source_file.py b/beta_batch_encoder/_source_file.py index 8354e02..aa62cb6 100644 --- a/beta_batch_encoder/_source_file.py +++ b/beta_batch_encoder/_source_file.py @@ -131,20 +131,6 @@ class SourceFile: except ValueError: logging.error('Stream selection must be an integer') - # Include the source file candidate? - @staticmethod - def yes_or_no(file): - yes = {'yes', 'y', ''} - no = {'no', 'n'} - while True: - choice = input(f'Include file \'{file}\': ').lower() - if choice in yes: - return True - elif choice in no: - return False - else: - logging.error('Please respond with \'y\' or \'n\'') - # If our source file audio stream is not a 2-channel stereo layout, we need to resample it before normalization def apply_audio_resampling(self, audio_filters): channels = int(self.audio_format['streams'][0].get('channels', 2)) diff --git a/setup.py b/setup.py index 4a153f9..8a2ccc8 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open('README.md') as f: setup( name='animethemes-beta-batch-encoder', - version='1.3.1', + version='1.4', author='AnimeThemes', author_email='admin@animethemes.moe', url='https://github.com/AnimeThemes/animethemes-batch-encoder',