Get thumbnails from video files (mp4) in a browser using ffmpeg via wasm
npm install video-thumbnailer
You can find full example in example/src/routes/+page.svelte built with SvelteKit
import { VideoThumbnailer } from "video-thumbnailer";
await thumbnailer.load();
// or you can select a File from the browser
const urlOrFile =
"https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4";
// contains a Blob that can be directly set to img.src
const { blob, metadata } = await thumbnailer.getThumbnail(urlOrFile);
To run the demo:
cd example
npm run dev
# navigate to http://localhost:5173
To build the library:
cd video-thumbnailer
npm run build
Copyright © 2023 Eugene Hauptmann