Skip to content
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

Out of memory on -preset medium #83

Closed
vasanthudhaya opened this issue Oct 12, 2019 · 5 comments
Closed

Out of memory on -preset medium #83

vasanthudhaya opened this issue Oct 12, 2019 · 5 comments
Labels

Comments

@vasanthudhaya
Copy link

Hi @Kagami , Thanks for the ffmpeg.js, it is very useful.

Actually my issue is while am encoding the webm video to convert mp4, the memory allocate issue occurs. (Cannot enlarge memory arrays).

Ref issue : #9, In this issue you mentioned the values to enlarge the TOTAL_MEMORY , I tried on that way too.... But i fails for the below configuration. Now am using 1gb on my TOTAL_MEMORY value. And from myside i tried all the values which you are mentioned to the TOTAL_MEMORY.

My system configuration:

RAM: 4gb, BIT: 32 bit.

I am using threads value 4, and my command is -i input.webm -r 24 -c:v libx264 -crf 22 -pix_fmt yuv420p -threads 4 -rtbufsize 100M -b:a 128k -preset ultrafast output.mp4.

Kindly know me what i missed in my command else what i need to do to resolve the memory allocation issue. Thanks in advance

cc: @thijstriemstra @PaulKinlan

@LucCADORET
Copy link

Same issue here, with a .mkv file. My arguments are:
["-i", "ram.mkv", "-f", "mp4", "-codec", "copy", "out.mp4"]
I have tried increasing the --max-old-space-size of node, and also the TOTAL_MEMORY (respectively to 8192, and 1024 * 1024 * 1024). I am getting
FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory

I'm running node v12.13.0 (LTS), if that matters.

@Kagami
Copy link
Owner

Kagami commented Apr 19, 2020

@LucCADORET could you reproduce with the latest build? Please provide your source file if it still fails.

@Kagami Kagami changed the title Webm to Mp4 Encoding failed with memory allocate issue Out of memory on Node Apr 19, 2020
@Kagami
Copy link
Owner

Kagami commented Apr 25, 2020

I've reproduced the problem with -preset medium (default preset), but for -preset ultrafast (and probably other fast prests) it should work.

Need to find why changing TOTAL_MEMORY doesn't help. Maybe it should be fixed as part of #10 (enable memory grow).

@Kagami Kagami changed the title Out of memory on Node Out of memory on -preset medium Apr 25, 2020
@Kagami
Copy link
Owner

Kagami commented May 1, 2020

Closing in favor of #10.

@Kagami Kagami closed this as completed May 1, 2020
@BrunoQuaresma
Copy link

I tried WASM, but it has some limitations like the ArraySharedBuffer where is not available on Safari, and the page needs to use some strict CORS headers. Is it possible to fix this memory issue without using the WASM version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants