diffusionstudio / core

The Video Creation Engine: Edit videos with code, featuring the fastest WebCodecs renderer for in-browser video processing.
https://examples.diffusion.studio/
Mozilla Public License 2.0
314 stars 22 forks source link

export error #29

Open abdallahrabiaa opened 2 weeks ago

abdallahrabiaa commented 2 weeks ago

i got an export error and i got it many times, i hope it's not a bug , i walk around in docs and i tried many times but sometimes it's rendered and sometimes give me this error: export error Promise timed out after 20000 ms

Screenshot-20241024234524-603x49 this my render code :

async render(name?: string, props?: { resolution?: number; sampleRate?: number; numberOfChannels?: number; videoBitrate?: number; gpuBatchSize?: number; fps?: number; debug?: boolean; audio?: boolean; }) { if (props && !props.gpuBatchSize) { props.gpuBatchSize = 100; } const encoder = new Encoder(this.composition, props); await encoder.render(name); }

thanks :)
k9p5 commented 2 weeks ago

Does it work with a different file?

abdallahrabiaa commented 2 weeks ago

maybe also work with same file , it's happened often when network is slow .

k9p5 commented 2 weeks ago

I see, I might be able to improve that. It's timing out because the file takes too long to load

abdallahrabiaa commented 2 weeks ago

okay thanks for your effort :)

k9p5 commented 2 weeks ago

No problem :) A workaround would be to use the File API instead of the Source object:

const response = await fetch('.../some_video.mp4');

const blob = await response.blob();

// Convert Blob to File
const file = new File([blob], fileName, { type: "video/mp4" });

const clip = new VideoClip(file);
abdallahrabiaa commented 2 weeks ago

Thanks for this solution, i appreciate that