Skip to content

Commit

Permalink
Merge pull request #6 from mmenanno/use-height-for-scaling
Browse files Browse the repository at this point in the history
use height for proportionate scaling instead of width
  • Loading branch information
Josh5 authored May 15, 2024
2 parents 2d9bdde + 4d52067 commit a899092
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/plugin_stream_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,14 @@ def build_filter_chain(self, stream_info, stream_id):
software_filters.append('crop={}'.format(self.crop_value))
if self.settings.get_setting('target_resolution') not in ['source']:
vid_width, vid_height = self.scale_resolution(stream_info)
if vid_width:
# Apply scale with only width to keep aspect ratio
if vid_height:
# Apply scale with only height to keep aspect ratio
if self.settings.get_setting('video_encoder') in qsv_encoder.provides():
required_hw_smart_filters.append({'scale': [vid_width, vid_height]})
elif self.settings.get_setting('video_encoder') in nvenc_encoder.provides():
required_hw_smart_filters.append({'scale': [vid_width, vid_height]})
else:
software_filters.append('scale={}:-1'.format(vid_width))
software_filters.append('scale=-1:{}'.format(vid_height))

# Apply custom software filters
if self.settings.get_setting('apply_custom_filters'):
Expand Down

0 comments on commit a899092

Please sign in to comment.