gpac icon indicating copy to clipboard operation
gpac copied to clipboard

[MP4Box] Feature request: support for Motion JPEG 2000 specific boxes

Open boxerab opened this issue 1 year ago • 3 comments

Thank you for this excellent MP4 toolkit. I am interested in dumping boxes for motion jpeg 2000 files. MP4Box can parse almost all boxes, except for a handful :

[iso file] Unknown top-level box type jP  
[iso file] Unknown box type jp2p in parent mjp2
[iso file] Unknown box type jsub in parent mjp2
[iso file] Unknown box type orfo in parent mjp2

The boxes do appear in the xml, but the contents are not interpreted correctly.

<UnknownBox Size="20" Type="jp2p" Specification="unknown" Container="unknown" data="0x000000006A7032204A325030" >
</UnknownBox>
<UnknownBox Size="12" Type="jsub" Specification="unknown" Container="unknown" data="0x02020000" >
</UnknownBox>
<UnknownBox Size="10" Type="orfo" Specification="unknown" Container="unknown" data="0x0100" >

jP is the signature box jp2p is the profile box jsub is the subsampling box orfo is the original format box

Adding link to final draft of MJ2 spec

boxerab avatar Jul 20 '24 18:07 boxerab

Thank you! By any chance would you have some sample files to share with us?

rbouqueau avatar Jul 21 '24 01:07 rbouqueau

My pleasure! Here is a sample file

Speedway.zip

boxerab avatar Jul 21 '24 02:07 boxerab

I notice that orfo box is not mentioned in the final draft. This box contains two bytes -

  • first byte stores field count i.e. progressive (1) or interlaced (2)
  • second byte stores field order: TFF (1) or BFF (6), and only relevant for interlaced

boxerab avatar Jul 21 '24 02:07 boxerab

I see conflicting information on orfo. It's not clear if the files are signed or not. Do we have access to the latest specification? It shouldn't matter if values are that small but just for completeness sake.

DenizUgur avatar Sep 03 '24 23:09 DenizUgur

Thanks, @DenizUgur . Unfortunately I don't have enough Swiss francs to purchase the latest spec. Let me do some more digging on that issue.

boxerab avatar Sep 03 '24 23:09 boxerab

While you are at it, I see that signature box should be jP2 and don't see anything about jP . Is that an alternative?

DenizUgur avatar Sep 03 '24 23:09 DenizUgur

@DenizUgur, I have looked at MJ2 implementations, and this is what I found for orfo box.

  uint8_t or_fieldcount_;
  uint8_t or_fieldorder_;

Also, jp is the signature box, while jp2 is the "brand" of the file

boxerab avatar Sep 04 '24 11:09 boxerab

Thanks @rbouqueau @DenizUgur @jeanlf !! Looking forward to trying this with nightly build.

boxerab avatar Sep 04 '24 17:09 boxerab