web-stories-wp icon indicating copy to clipboard operation
web-stories-wp copied to clipboard

Video Optimization: Cropping

Open swissspidy opened this issue 4 years ago • 4 comments

Feature Description

We should be able to cut off-screen parts of videos upon request (cropping the visible parts of the image).

Example use cases:

  • A video element is partially off canvas
  • Video is scaled/zoomed in the editor

Alternatives Considered

Additional Context

https://ffmpeg.org/ffmpeg-filters.html#crop


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance Criteria

Implementation Brief

swissspidy avatar Jan 20 '21 14:01 swissspidy

Is this possible with ffmpeg.wasm? I can't see options in the docs for this. I may have missed it.

spacedmonkey avatar Jan 20 '21 16:01 spacedmonkey

Yes, ffmpeg supports cropping: https://ffmpeg.org/ffmpeg-filters.html#crop

swissspidy avatar Jan 20 '21 17:01 swissspidy

To confirm, we mean, cropping the image or cropping the video length? Or both?

spacedmonkey avatar Jan 20 '21 18:01 spacedmonkey

Cropping the visible image.

Cropping the length (trimming) is something for waay in the future.

swissspidy avatar Jan 20 '21 23:01 swissspidy