A simple MP4 video trimmer using the WebCodecs API
https://miru.media/video-trimmer
``sh`
npm install media-trimmer
`js
import { trim } from 'media-trimmer'
try {
// The input video must be a .mp4/.mov file with a video track`
// and the browser must support video encoding with the WebCodecs API
await trim('video.mp4', {
start: 2, // start time in seconds
end: 10, // end time in seconds
mute: false, // ignore the audio track?
})
} catch (error) {
alert(error)
}
It also comes with a Web Component UI:
`html