-
-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why can't ffmpeg.wasm work well on Chrome? Please answer. #754
Comments
core-mt is broken in so many ways atm - I changed to the single thread version and all problems are gone. still sad though |
Can you tell me how you modified it into a single-threaded version? If possible, I hope you can give me a reference demo. |
Simply use the non-multithreaded core (core instead of core-mt) |
@CxyJerry |
Thank you very much for your answer but I tried changing ffmpeg wasm version from core-mt to core but still doesn't work in chrome |
Thank you very much for your answer but I tried changing ffmpeg wasm version from core-mt to core but still doesn't work in chrome |
it can work, but is it too slow!
function upload(fn,accept){
let input = document.createElement('input');
input.type = 'file';
input.accept = accept;
input.addEventListener('change',e=>fn(e.target.files));
input.click();
}
upload(async files=>{
const worker = new MyWorker({url:'WorkerAppFFmpeg.js',type:'module',install:true});
worker.methods.set('log',function(data,port){
console.log(data.message);
});
worker.methods.set('wasmload',function(data,port){
console.log(data);
});
worker.methods.set('progress',function(data,port){
console.log(data);
});
await worker.setMethod();
console.log(await worker.ready);
await worker.callMethod('writeFile','0.mp4',new Uint8Array(await files[0].arrayBuffer()));
await worker.callMethod('exec',['-i','0.mp4','a.mov'],-1);
const file = await worker.callMethod('readFile','a.mov');
worker.terminate();
this.downURL(URL.createObjectURL(new Blob([file])),'a.mov');
}); other file
|
@CxyJerry
|
Describe the bug
I want to use ffmpeg.wasm in my project. It may need to run in browsers such as chrome, firefox, safari, etc. However, a problem was discovered during the integration process: the demo I wrote can run well in firefox. It runs, but there is no way to run it in chrome. It will stop running after the video information appears (it may also be other unexpected situations). I don't know how to solve it. I hope the author can help me look at it and give me some suggestion
To Reproduce
Expected behavior
I hope that I can convert mp4 files to mov files normally on the chrome browser without stopping working directly.
Screenshots
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: