Cut Video with a Greedy Algorithm
Note
Now all the plugins has supported English. I'm still improving the website...
This article will resolve
LeetCode | Difficulty |
---|---|
1024. Video Stitching | 🟠 |
I have previously shared several videos, which served as my introduction to video editing. As an amateur editor, I am not aiming to create grand cinematic special effects, but rather simple video tutorials. This is not particularly challenging; the main task is to make the video flow smoothly. Therefore, the most frequently used features are cutting, deleting, and splicing video clips.
Readers who have never edited videos might not know that in most editing software, once a video is cut into segments, each segment can be restored to the original video.
For example, take a 10-second video. If you cut it in the middle into two 5-second videos, each of these 5-second videos can be restored to the original 10-second video. It's like an earthworm that can be cut into four parts to play mahjong, or into eleven parts to make a soccer team.
When editing videos, each video segment can be abstracted into intervals, with time being the interval endpoints. Some of these intervals intersect, while others do not...
Suppose the editing software does not support restoring video segments to the original video. If given several video segments, how can I restore them to the original video?