Skip to content

Commit 04f4f3c

Browse files
committed
Improve README
Add CI
1 parent 8786435 commit 04f4f3c

File tree

2 files changed

+98
-6
lines changed

2 files changed

+98
-6
lines changed

.github/workflow/main.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request'
11+
12+
steps:
13+
- name: install dependencies
14+
- name: Checkout repo
15+
uses: actions/checkout@v3
16+
- name: Set up JDK 17
17+
uses: actions/setup-java@v3
18+
with:
19+
java-version: '17'
20+
distribution: 'corretto'
21+
cache: maven
22+
- name: Test Java
23+
run: mvn test

README.md

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,50 @@
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+
...
248

349
## Quick start
450

@@ -31,11 +77,28 @@ An MXF file is divided into partitions:
3177

3278
- 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
3379

34-
### Essence wrapping and indexing
80+
### Essence wrapping
3581

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
39102

40103
## Reading
41104

@@ -108,4 +171,10 @@ Each body partition contained within the file is written in turn by calling the
108171
The writing of the file ends with the `finish()` method.
109172

110173
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

Comments
 (0)