[FFmpeg-devel,04/13] avformat/mxfenc: Add object model version

Submitted by Michael Niedermayer on May 7, 2018, 10:38 a.m.

Details

Message ID 20180507103817.8320-4-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer May 7, 2018, 10:38 a.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mxfenc.c            | 7 ++++++-
 tests/ref/fate/copy-trac4914    | 2 +-
 tests/ref/fate/mxf-reel_name    | 2 +-
 tests/ref/fate/time_base        | 2 +-
 tests/ref/lavf/mxf              | 6 +++---
 tests/ref/lavf/mxf_d10          | 2 +-
 tests/ref/lavf/mxf_dv25         | 2 +-
 tests/ref/lavf/mxf_dvcpro50     | 2 +-
 tests/ref/lavf/mxf_opatom       | 2 +-
 tests/ref/lavf/mxf_opatom_audio | 2 +-
 10 files changed, 17 insertions(+), 12 deletions(-)

Comments

Tomas Härdin May 8, 2018, 10:32 a.m.
mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

>      mxf_write_metadata_key(pb, 0x012f00);
>      PRINT_KEY(s, "preface key", pb->buf_ptr - 16);
> -    klv_encode_ber_length(pb, 130 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
> +    klv_encode_ber_length(pb, 138 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
>  
>      // write preface set uid
>      mxf_write_local_tag(pb, 16, 0x3C0A);
> @@ -696,6 +697,10 @@ static void mxf_write_preface(AVFormatContext *s)
>      mxf_write_local_tag(pb, 2, 0x3B05);
>      avio_wb16(pb, 259); // v1.2
>  
> +    // Object Model Version
> +    mxf_write_local_tag(pb, 4, 0x3B07);
> +    avio_wb32(pb, 1);
> 

Not sure what use this is, but looks OK at least. S377m doesn't seem to
think it's necessary. Is there some program that needs this?

/Tomas
Michael Niedermayer May 8, 2018, 4:05 p.m.
On Tue, May 08, 2018 at 12:32:17PM +0200, Tomas Härdin wrote:
> mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> 
> >      mxf_write_metadata_key(pb, 0x012f00);
> >      PRINT_KEY(s, "preface key", pb->buf_ptr - 16);
> > -    klv_encode_ber_length(pb, 130 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
> > +    klv_encode_ber_length(pb, 138 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
> >  
> >      // write preface set uid
> >      mxf_write_local_tag(pb, 16, 0x3C0A);
> > @@ -696,6 +697,10 @@ static void mxf_write_preface(AVFormatContext *s)
> >      mxf_write_local_tag(pb, 2, 0x3B05);
> >      avio_wb16(pb, 259); // v1.2
> >  
> > +    // Object Model Version
> > +    mxf_write_local_tag(pb, 4, 0x3B07);
> > +    avio_wb32(pb, 1);
> > 
> 
> Not sure what use this is, but looks OK at least. S377m doesn't seem to
> think it's necessary. Is there some program that needs this?

Other tools (XFConvert at least) writes it. I think we should too.

will document this in the commit message and apply

thanks

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 73015816eb..f0fd406493 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -422,6 +422,7 @@  static const MXFLocalTagPair mxf_local_tag_batch[] = {
     { 0x3C0A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x01,0x01,0x15,0x02,0x00,0x00,0x00,0x00}}, /* Instance UID */
     { 0x3B02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x07,0x02,0x01,0x10,0x02,0x04,0x00,0x00}}, /* Last Modified Date */
     { 0x3B05, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x01,0x02,0x01,0x05,0x00,0x00,0x00}}, /* Version */
+    { 0x3B07, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x03,0x01,0x02,0x01,0x04,0x00,0x00,0x00}}, /* Object Model Version */
     { 0x3B06, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x06,0x04,0x00,0x00}}, /* Identifications reference */
     { 0x3B03, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x06,0x01,0x01,0x04,0x02,0x01,0x00,0x00}}, /* Content Storage reference */
     { 0x3B09, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x02,0x02,0x03,0x00,0x00,0x00,0x00}}, /* Operational Pattern UL */
@@ -681,7 +682,7 @@  static void mxf_write_preface(AVFormatContext *s)
 
     mxf_write_metadata_key(pb, 0x012f00);
     PRINT_KEY(s, "preface key", pb->buf_ptr - 16);
-    klv_encode_ber_length(pb, 130 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
+    klv_encode_ber_length(pb, 138 + 16LL * DESCRIPTOR_COUNT(mxf->essence_container_count));
 
     // write preface set uid
     mxf_write_local_tag(pb, 16, 0x3C0A);
@@ -696,6 +697,10 @@  static void mxf_write_preface(AVFormatContext *s)
     mxf_write_local_tag(pb, 2, 0x3B05);
     avio_wb16(pb, 259); // v1.2
 
+    // Object Model Version
+    mxf_write_local_tag(pb, 4, 0x3B07);
+    avio_wb32(pb, 1);
+
     // write identification_refs
     mxf_write_local_tag(pb, 16 + 8, 0x3B06);
     mxf_write_refs_count(pb, 1);
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index e5b9ee293e..0d8f09176f 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@ 
-da66943da7ede9d7409c78befa3c1b95 *tests/data/fate/copy-trac4914.mxf
+2bbcbc55eebf305aec776bce60d09f91 *tests/data/fate/copy-trac4914.mxf
 561209 tests/data/fate/copy-trac4914.mxf
 #tb 0: 1001/30000
 #media_type 0: video
diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name
index a22d058868..b1a8840d7a 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@ 
-d35f74e97bb8a3d5cadc1df69d82dcf9
+581d38fa877b2db15615989f335e9eaf
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index 13c7eca627..75ec4368a4 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@ 
-6222dfa98933f06afb9992ab6c21486c
+0979b614a34f668eb47278448b254000
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index c9a1ce8544..a09c8e1bab 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@ 
-707059147bb7569509cf3b697b54d701 *./tests/data/lavf/lavf.mxf
+e3f486ec383f9df4e4e7063959c88dd5 *./tests/data/lavf/lavf.mxf
 525881 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-5af94bc17e47190a1e2943a461c836ff *./tests/data/lavf/lavf.mxf
+4de1237dea5f8377eed4c8effe037ffb *./tests/data/lavf/lavf.mxf
 561209 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0xf21b1b48
-523ed9d06ab7a4090f9a29fa7abf7a03 *./tests/data/lavf/lavf.mxf
+73dec65269c3f5ebe67e4e7fa6f2f6b7 *./tests/data/lavf/lavf.mxf
 525881 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10
index 2e6e13f1ce..62b96b4ba6 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@ 
-07a242f1881f0349e4ed10a4f1584ddb *./tests/data/lavf/lavf.mxf_d10
+ea6d7025d72df9aaf63bdbc2be8c82dc *./tests/data/lavf/lavf.mxf_d10
 5331501 ./tests/data/lavf/lavf.mxf_d10
 ./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488
diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25
index e192f91fe2..323abc330b 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@ 
-8117b64eaee48b9b6f8be964afbed8e0 *./tests/data/lavf/lavf.mxf_dv25
+2f8cb1656178419950a9a3505cae3f5b *./tests/data/lavf/lavf.mxf_dv25
 3833901 ./tests/data/lavf/lavf.mxf_dv25
 ./tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52
diff --git a/tests/ref/lavf/mxf_dvcpro50 b/tests/ref/lavf/mxf_dvcpro50
index 4d6b45de90..5e93737904 100644
--- a/tests/ref/lavf/mxf_dvcpro50
+++ b/tests/ref/lavf/mxf_dvcpro50
@@ -1,3 +1,3 @@ 
-d6e87fb17a89a8a8fff96e0fd9d6fd4a *./tests/data/lavf/lavf.mxf_dvcpro50
+9377a3afbf431442e17c5d891b4e6252 *./tests/data/lavf/lavf.mxf_dvcpro50
 7430701 ./tests/data/lavf/lavf.mxf_dvcpro50
 ./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom
index 969e2bc4c5..c5aac167b5 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@ 
-fea3ed4c2e5088701154530cb2a57f98 *./tests/data/lavf/lavf.mxf_opatom
+ebf818890f92bb9710798a3e2ab571fd *./tests/data/lavf/lavf.mxf_opatom
 4717113 ./tests/data/lavf/lavf.mxf_opatom
 ./tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a
diff --git a/tests/ref/lavf/mxf_opatom_audio b/tests/ref/lavf/mxf_opatom_audio
index 84ac7b23ad..08cb7168dd 100644
--- a/tests/ref/lavf/mxf_opatom_audio
+++ b/tests/ref/lavf/mxf_opatom_audio
@@ -1,3 +1,3 @@ 
-71735ea72b3bdcfa3455d51bc439aa57 *./tests/data/lavf/lavf.mxf_opatom_audio
+b79b636502d47239def6e85ab8cc06b3 *./tests/data/lavf/lavf.mxf_opatom_audio
 102457 ./tests/data/lavf/lavf.mxf_opatom_audio
 ./tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff