Skip to content

Commit

Permalink
Fixed video notes being cropped on the smallest of the dimensions too
Browse files Browse the repository at this point in the history
  • Loading branch information
revolter committed Dec 20, 2021
1 parent 9772aba commit a232b6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
VIDEO_CODEC_NAMES = ['h264', 'hevc', 'mpeg4', 'vp6', 'vp8']
VIDEO_NOTE_CROP_OFFSET_PARAMS = 'abs(in_w - in_h) / 2'
VIDEO_NOTE_CROP_SIZE_PARAMS = 'min(in_w, in_h)'
VIDEO_NOTE_SCALE_SIZE_PARAMS = 'min(min(in_w, in_h), {})'.format(MAX_VIDEO_NOTE_SIZE)


class OutputType:
Expand Down
5 changes: 5 additions & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ def convert(output_type: str, input_video_url: typing.Optional[str] = None, inpu
constants.VIDEO_NOTE_CROP_SIZE_PARAMS,
constants.VIDEO_NOTE_CROP_SIZE_PARAMS
)
.filter(
'scale',
constants.VIDEO_NOTE_SCALE_SIZE_PARAMS,
constants.VIDEO_NOTE_SCALE_SIZE_PARAMS
)
)

ffmpeg_output: ffmpeg.nodes.OutputStream
Expand Down

0 comments on commit a232b6c

Please sign in to comment.