Reputation: 846
I want to capture some thumbnails from a video file which was loaded from an input file (client side).
Doing so, I have to create an Object URL by createObjectURL, then assign the Base64 value to video.src
.
The problem is this didn't work with AVI format (DivX, XviD, MPEG2).
How to make it work with AVI? Or do you know any library which can capture image from a video file client side?
Any help would be appreciated.
Upvotes: 0
Views: 672
Reputation: 136986
A BlobURL is just an URL pointing to some data stored in your browser's memory.
So yes, you can very well create a BlobURL that will point to an avi file, or any kind of file actually.
Your problem here is that your browser doesn't know how to decode this file. Even if it were served from a server, it wouldn't be able to read it and thus to render it so you can grab your thumbnail.
There is no workaround to that, except maybe converting this file to a format your browser does support (e.g mp4.H264+AAC is pretty well supported).
But to do it on client side is not trivial, to my knowledge only ffmpeg-js could maybe allow us to do so, but I've never tried it myself, and I'm not sure how stable the port is, nor what's the current browser support is (for sure, it requires at least WebAssembly).
Upvotes: 1