Log in

View Full Version : megui/x264 eats up all RAM when encoding Mjpeg.


junglemike
6th September 2006, 18:36
I'm taking small 3-min videos of newborn with canon a70 camera each week, compressing them to x264/mp3/mkv to send over email.
It was working fine on my destkop pc at least 100 previous times .
But when i tried to encode same thing on friends' laptop - it ate up all the memory (he has 1250mb ram) and crashed windows). I wondered, but since it worked on my pc i was satisfied.
Now I have exactly the same problem. My computer is P4-1700mhz/512mb ram. x264.exe eats all the real memory, and all paging file memory, and then crashes, no matter how large I set paging file. It used to work fine (with average consuption ~200meg (ram+paging file). And it still works fine for any input files except mjpeg.
Would be glad to resolve this. Thanks.

detailed info:
I'm using latest Megui, source file is ~5000kbps mJpeg codec 640x480@15fps.
My script is simple:

AVISource("O:\baby\MVI_5535.AVI",false)
lanczosresize(464,352)
I'm using HQ-Slow profile.
Once I launch the encoding, x264.exe starts to consume all the ram, and then crashes. megui.exe behaves ok btw.
I have PicVideo mjpeg coder/decder installed.
And .avs script play fine in any player. (mplayer2.exe)

PS: I tried encoding to Xvid with MEgui this very script, and it works perfectly.
As I said before it wokrs perfectly with any other input and with same x264/hq-slow profile

unmei
6th September 2006, 21:37
my conclusion would be
-it can't be the MJPEG decoder, else it would leak when encoding to xvid as well
-it can't be the x264 core, else it would leak for other samples as well
*the MJPEG decodes to a different colorspace than the other test files (initial thesis)
*the colorspace propagates through the "entire" script, not hard since it's that short - lanzcos supports probably all of them
*x264 has its own colorspace conversion, so it accepts several input colorspaces, including the one the MJPEG uses and the one your other test samples use (very probable, the only colorspace rejection i ever had from avs->x264 were when a error triggered the "DIB" colorspace)
*x264's colorspace conversion routine for the MJPEG's colorspace to YV12 leaks.

Manao
6th September 2006, 21:50
*x264 has its own colorspace conversion, so it accepts several input colorspaces, including the one the MJPEG uses and the one your other test samples use (very probable, the only colorspace rejection i ever had from avs->x264 were when a error triggered the "DIB" colorspace)
*x264's colorspace conversion routine for the MJPEG's colorspace to YV12 leaks.Nice try, but x264 doesn't have any colorspace conversion.

Try without MeGUI.

unmei
6th September 2006, 21:54
i just found out when i tried to check if i could reporduce it with ColorBars and x264.exe only :)

akupenguin
6th September 2006, 23:50
x264 does have colorspace conversion, but uses it only in direct library access or vfw fronted, not cli with avs input.

junglemike
7th September 2006, 01:56
Well, guys, a semi-solution I found to this problem is this.
I just re-encode mjpeg 5000kbps in VirtualDubMod to Huffyuv (around 30000kbps), made same script for huffyuv input, and Megui/x264 sucessfully encoded it.
Good thing this A70 camera can only shoot 3min video clips, b/c otherwise I would run out of space converting 2hour movie into huffyuv. :-)

Revgen
7th September 2006, 18:29
Well, guys, a semi-solution I found to this problem is this.
I just re-encode mjpeg 5000kbps in VirtualDubMod to Huffyuv (around 30000kbps), made same script for huffyuv input, and Megui/x264 sucessfully encoded it.
Good thing this A70 camera can only shoot 3min video clips, b/c otherwise I would run out of space converting 2hour movie into huffyuv. :-)

Use Lagarith instead next time.