ffmpeg.js
ffmpeg.js copied to clipboard
MP4 Encoding returns OOM
Hey, re-encoding a very simple video of few seconds with no audio from vp8 webm to h264 mp4 keeps running out of memory.
OOM
exception thrown: abort(OOM). Build with -s ASSERTIONS=1 for more info.
This is on Firefox, so maybe something related to asm.js?
Try using the ultrafast preset, and small files if possible.
Preset and small files indeed help, although it would be nice to support potentially larger source videos, if needed
would compiling with a higher TOTAL_MEMORY
https://github.com/Kagami/ffmpeg.js/blob/master/Makefile#L227 help here?
@videoinu Did you ever get any further with this? The ultrafast preset makes the conversion possible but it's quite slow. Running in WebWorker took me 374s to encode a 60s video...
Any tips on how to improve this is much welcome 👍
worker.postMessage({
type: 'run',
MEMFS: [
{
name: 'test.webm',
data: evt.target.result,
},
],
arguments: [
'-r',
'60',
'-i',
'test.webm',
'-c:v',
'libx264',
'-aspect',
'16/9',
'-crf',
'1',
'-preset',
'ultrafast',
'-pix_fmt',
'yuv420p',
'-vb',
'20M',
'test.mp4',
],
})
}