|
1 | | -# REGMXFLIB |
| 1 | +# regmxflib |
| 2 | + |
| 3 | + |
| 4 | + _ _ _ |
| 5 | + | | | | o | | |
| 6 | + ,_ _ __, _ _ _ | | | | | | |
| 7 | + / | |/ / | / |/ |/ | /\/ |/ |/ | |/ \_ |
| 8 | + |_/ |__/ \_/|/ | | |_/ /\_/ |__/ |__/ |_/ \_/ |
| 9 | + /| |\ |
| 10 | + \| |/ |
| 11 | + |
| 12 | + |
| 13 | +## Introduction |
| 14 | + |
| 15 | +regmxflib is a pure Java library that: |
| 16 | + |
| 17 | +- creates bindings between MXF header metadata classes and POJOs |
| 18 | + using the [SMPTE metadata registers](https://registry.smpte-ra.org/apps/pages/), |
| 19 | + allowing applications to remain up-to-date with recent additions to the MXF standard |
| 20 | + with minimal effort |
| 21 | + |
| 22 | +- implements MXF reading and writing classes |
| 23 | + |
| 24 | +- implements a simple tool that creates a JSON summary of an input MXF file |
| 25 | + |
| 26 | +The following snippet illustrates the creation of an `RGBADescriptor` using the library: |
| 27 | + |
| 28 | + RGBADescriptor d = new RGBADescriptor(); |
| 29 | + d.InstanceID = UUID.fromRandom(); |
| 30 | + d.SampleRate = sampleRate; |
| 31 | + d.FrameLayout = LayoutType.FullFrame; |
| 32 | + d.StoredWidth = 640L; |
| 33 | + d.StoredHeight = 360L; |
| 34 | + d.DisplayF2Offset = 0; |
| 35 | + d.ImageAspectRatio = Fraction.of(640, 360); |
| 36 | + d.TransferCharacteristic = Labels.TransferCharacteristic_ITU709.asUL(); |
| 37 | + d.PictureCompression = Labels.JPEG2000BroadcastContributionSingleTileProfileLevel5; |
| 38 | + d.ColorPrimaries = Labels.ColorPrimaries_ITU709.asUL(); |
| 39 | + d.VideoLineMap = new Int32Array(); |
| 40 | + d.VideoLineMap.add(0); |
| 41 | + d.VideoLineMap.add(0); |
| 42 | + d.ComponentMaxRef = 65535L; |
| 43 | + d.ComponentMinRef = 0L; |
| 44 | + d.ScanningDirection = ScanningDirectionType.ScanningDirection_LeftToRightTopToBottom; |
| 45 | + d.PixelLayout = new RGBALayout(); |
| 46 | + d.PixelLayout.add(new RGBAComponent(RGBAComponentKind.CompRed, (short) 16)); |
| 47 | + ... |
2 | 48 |
|
3 | 49 | ## Quick start |
4 | 50 |
|
@@ -31,11 +77,28 @@ An MXF file is divided into partitions: |
31 | 77 |
|
32 | 78 | - At the very end of the file, a random index pack (RIP) contains a table of contents of all the partitions contained in the file |
33 | 79 |
|
34 | | -### Essence wrapping and indexing |
| 80 | +### Essence wrapping |
35 | 81 |
|
36 | | -- Frame-wrapping (VBE) |
37 | | -- Clip-wrapping (CBE) |
38 | | -- Clip-wrapping (VBE) |
| 82 | +#### Frame-wrapping |
| 83 | + |
| 84 | +In the case of frame-wrapping, each access unit of the essence or data stream is |
| 85 | +wrapped into its own KLV triplet (called an _element_) and all elements that belong to |
| 86 | +the same edit unit are grouped into a logical _content package_. |
| 87 | + |
| 88 | +Index entries point to the first byte of the K of each element. |
| 89 | + |
| 90 | +#### Clip-wrapping |
| 91 | + |
| 92 | +In the case of clip-wrapping, the entire essence stream is wrapped into a single KLV triplet (also called an _element_). |
| 93 | + |
| 94 | +Index entries point to the first byte of the V of each element. |
| 95 | + |
| 96 | +### Indexing |
| 97 | + |
| 98 | +Indexes come in one of two forms: |
| 99 | + |
| 100 | +- CBE, where all index entries point to elements of the same size in bytes |
| 101 | +- VBE, in all other cases |
39 | 102 |
|
40 | 103 | ## Reading |
41 | 104 |
|
@@ -108,4 +171,10 @@ Each body partition contained within the file is written in turn by calling the |
108 | 171 | The writing of the file ends with the `finish()` method. |
109 | 172 |
|
110 | 173 | The operation of the `StreamingWriter` is demonstrated at |
111 | | -<library/src/test/java/com/sandflow/smpte/mxf/StreamingWriterTest.java> and at <library/src/test/java/com/sandflow/smpte/mxf/ReadWriteTest.java>. |
| 174 | +<library/src/test/java/com/sandflow/smpte/mxf/StreamingWriterTest.java> and at <library/src/test/java/com/sandflow/smpte/mxf/ReadWriteTest.java>. |
| 175 | + |
| 176 | +## Prerequisites |
| 177 | + |
| 178 | +- Java 17 |
| 179 | +- Maven |
| 180 | +- (recommended) Git |
0 commit comments