Is there a way to generate Video from image ArrayBuffer data instead of fetching the image?
I have referred the examples given in the repo where it uses ffmpeg.FS to fetch images. I want that instead of fetching the files locally, it uses the image array buffers (blobs) that we can pass from other functions to generate videos from that.
async function blobToUint8Array(blob) {
const arrayBuffer = await new Response(blob).arrayBuffer();
var uint8View = new Uint8Array(arrayBuffer);
return uint8View;
}
you may convert blob to Uint8Array to write to ffmpeg fs.
async function blobToUint8Array(blob) { const arrayBuffer = await new Response(blob).arrayBuffer(); var uint8View = new Uint8Array(arrayBuffer); return uint8View; }you may convert blob to Uint8Array to write to ffmpeg fs.
@AnilSonix How do I write Uint8Array to ffmpeg fs?
Check API docs in this repo. API
ffmpeg.FS('writeFile', 'image001.png', new Uint8Array(...));
The third param represent binary data. Before you can run any ffmpeg cmd , it must written to its fs so that it's available.