tmeiczin / opendcp

Created digital cinemas packages (DCP)
http://www.opendcp.org
GNU General Public License v3.0
121 stars 52 forks source link

opendcp_j2k.exe crashes under Windows with: Unable to allocate memory for image #310

Open berndporr opened 1 year ago

berndporr commented 1 year ago

See below. The openJPEG encoder crashes under Windows:

OpenDCP J2K 0.30.0 (c) 2010-2014 Terrence Meiczinger. All rights reserved.
  Encoder: OpenJPEG
Unable to allocate memory for image.=                   ] 100% [115/2300]                ] 100% [102/2300] 100% [90/2300]300]
20230423104145 | ERROR | opendcp_encoder_openjpeg.c:121             | opendcp_to_opj                 | Failed to create image
20230423104146 | ERROR | opendcp_encoder_openjpeg.c:225             | opendcp_encode_openjpeg        | unable to encode jpeg2000 file E:\attyshrvj2k/attyshrv1160.j2c
20230423104146 | ERROR | opendcp_j2k.c:86                           | convert_to_j2k                 | JPEG2000 conversion failed attyshrv1160.tif
20230423104146 | ERROR | opendcp_j2k_cmd.c:593                      | main                           | JPEG2000 conversion E:\attyshrvtiff/attyshrv1160.tif failed
Exiting...

and here is another attempt with a different sequence:

PS C:\Program Files (x86)\OpenDCP\bin> .\opendcp_j2k.exe -i I:\DCPfiles -o G:\dcp\j2000film -b 125 -c srgb_complex

OpenDCP J2K 0.30.0 (c) 2010-2014 Terrence Meiczinger. All rights reserved.
  Encoder: OpenJPEG
20230423100826 | ERROR | opendcp_encoder_openjpeg.c:225             | opendcp_encode_openjpeg        | unable to encode jpeg2000 file G:\dcp\j2000film/Sequence 01000003.j2c
20230423100826 | ERROR | opendcp_encoder_openjpeg.c:225             | opendcp_encode_openjpeg        | unable to encode jpeg2000 file G:\dcp\j2000film/Sequence 01049620.j2c
20230423100826 | ERROR | opendcp_j2k.c:86                           | convert_to_j2k                 | JPEG2000 conversion failed Sequence 01049620.tif
20230423100826 | ERROR | opendcp_j2k.c:86                           | convert_to_j2k                 | JPEG2000 conversion failed Sequence 01000003.tif
20230423100826 | ERROR | opendcp_j2k_cmd.c:593                      | main                           | JPEG2000 conversion I:\DCPfiles/Sequence 01000003.tif failed
Exiting...
20230423100826 | ERROR | opendcp_j2k_cmd.c:593                      | main                           | JPEG2000 conversion I:\DCPfiles/Sequence 01049620.tif failed
Exiting...

I have been using openDCP many times without any issues. So I guess a recent windows update might have caused the trouble? Might re-compiling it with a more recent openJPEG lib fix it? I'd be happy to re-compile it if you have instructions how to compile it under Windows (especially how to get the other libs). I'm also trying to get it back to work under Ubuntu Jammy (I'm usually doing it all under linux).

tmeiczin commented 1 year ago

The code needs some work to compile as many of the libraries have changed. You could try using the Kakadu executables instead of OpenJPEG. You can download them from Kakadu Software. Once installed, select Kakadu and so long as kdu_compress is in your path, it should work.