I'm not sure the parse of CDEF is in the right place. as it is defined in the JPEG2000 file format syntax. It will probably best fit with a JP2 container in avformat? As there are a lot of other parameters for JPEG2000 file format. who is not directly part of codec cf . ISO/IEC 15444-1:2002 Annex I