web-stories-wp
web-stories-wp copied to clipboard
Media: Video Segmentation Prototype
Feature Description
Related: #12093
It would be great if we could offer users an option to automatically split videos into smaller parts.
Example: you upload a 2 minute video and we allow you to split it into 15 seconds long segments (so 8 parts in total), putting every segment on its own page.
Imagine doing this already on initial upload, before we actually upload to the server. That would be super cool.
For this prototype we can create a new feature flag and some simple button (and maybe a range slider to set the segmentation length) somewhere that triggers this action.
Alternatives Considered
Additional Context
FFmpeg segment muxer seems to be what we need for this. Best to test this locally:
-f segment -segment_time <duration>
For the ffmpeg.wasm implementation, handling multiple outputs:
https://github.com/ffmpegwasm/ffmpeg.wasm/blob/9c14cca3cdf1fc0f2328f05586b48b74d1150816/examples/node/multiple-output.js?rgh-link-date=2020-05-05T09%3A58%3A47Z
Noting in the meeting, but transcoding videos will do not have progress bar. See #5982 for previous discussion. It maybe important to have progress bar, as a video may break into say 30 pieces. With a progress bar, this is confusing for the users as it is hard to know the progress, how long this is going to take.
It might be possible to use ffmpeg.setProgress. We could add a new property called progress to the item in the MediaUploadQueue. As this media queue is now used in media library as of #12123, we maybe able to get progress state there. The only issue with this, is changing state lots, which may result in LOTS of repaints.