Skip to content

Commit a232b6c

Browse files
committed
Fixed video notes being cropped on the smallest of the dimensions too
1 parent 9772aba commit a232b6c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
VIDEO_CODEC_NAMES = ['h264', 'hevc', 'mpeg4', 'vp6', 'vp8']
2121
VIDEO_NOTE_CROP_OFFSET_PARAMS = 'abs(in_w - in_h) / 2'
2222
VIDEO_NOTE_CROP_SIZE_PARAMS = 'min(in_w, in_h)'
23+
VIDEO_NOTE_SCALE_SIZE_PARAMS = 'min(min(in_w, in_h), {})'.format(MAX_VIDEO_NOTE_SIZE)
2324

2425

2526
class OutputType:

src/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ def convert(output_type: str, input_video_url: typing.Optional[str] = None, inpu
176176
constants.VIDEO_NOTE_CROP_SIZE_PARAMS,
177177
constants.VIDEO_NOTE_CROP_SIZE_PARAMS
178178
)
179+
.filter(
180+
'scale',
181+
constants.VIDEO_NOTE_SCALE_SIZE_PARAMS,
182+
constants.VIDEO_NOTE_SCALE_SIZE_PARAMS
183+
)
179184
)
180185

181186
ffmpeg_output: ffmpeg.nodes.OutputStream

0 commit comments

Comments
 (0)