Re: [FFmpeg-devel] [PATCH 11/13] avformat/mxfenc: Write Audio Ref Level for D10

2018-05-08 Thread Michael Niedermayer
On Tue, May 08, 2018 at 01:02:19PM +0200, Tomas Härdin wrote:
> mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > > Signed-off-by: Michael Niedermayer 
> >  // Generic Sound Essence Descriptor
> >  { 0x3D02, 
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x01,0x04,0x00,0x00,0x00}},
> >  /* Locked/Unlocked */
> >  { 0x3D03, 
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}},
> >  /* Audio sampling rate */
> > +{ 0x3D04, 
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x02,0x01,0x01,0x03,0x00,0x00,0x00}},
> >  /* Audio Ref Level */
> >  { 0x3D07, 
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x01,0x01,0x04,0x00,0x00,0x00}},
> >  /* ChannelCount */
> >  { 0x3D01, 
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x03,0x04,0x00,0x00,0x00}},
> >  /* Quantization bits */
> >  { 0x3D06, 
> > {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x02,0x04,0x02,0x00,0x00,0x00,0x00}},
> >  /* Sound Essence Compression */
> > @@ -1333,6 +1334,8 @@ static void 
> > mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
> >  
> >  if (s->oformat == _mxf_opatom_muxer)
> >  duration_size = 12;
> > +if (s->oformat == _mxf_d10_muxer)
> > +size += 5;
> >  
> >  mxf_write_generic_desc(s, st, key, size+duration_size+5+12+8+8);
> >  
> > @@ -1350,6 +1353,11 @@ static void 
> > mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
> >  avio_wb32(pb, st->codecpar->sample_rate);
> >  avio_wb32(pb, 1);
> >  
> > +if (s->oformat == _mxf_d10_muxer) {
> > +mxf_write_local_tag(pb, 1, 0x3D04);
> > +avio_w8(pb, 0);
> > +}
> 
> Sizes and such look OK, but again I don't know what the D-10 spec says

double checked
Table A2 - Generic Sound Essence Descriptor in SMPTE 386M lists 0

will apply

thanks

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 11/13] avformat/mxfenc: Write Audio Ref Level for D10

2018-05-08 Thread Tomas Härdin
mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > Signed-off-by: Michael Niedermayer 
>  // Generic Sound Essence Descriptor
>  { 0x3D02, 
> {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x01,0x04,0x00,0x00,0x00}},
>  /* Locked/Unlocked */
>  { 0x3D03, 
> {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}},
>  /* Audio sampling rate */
> +{ 0x3D04, 
> {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x02,0x01,0x01,0x03,0x00,0x00,0x00}},
>  /* Audio Ref Level */
>  { 0x3D07, 
> {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x01,0x01,0x04,0x00,0x00,0x00}},
>  /* ChannelCount */
>  { 0x3D01, 
> {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x03,0x04,0x00,0x00,0x00}},
>  /* Quantization bits */
>  { 0x3D06, 
> {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x02,0x04,0x02,0x00,0x00,0x00,0x00}},
>  /* Sound Essence Compression */
> @@ -1333,6 +1334,8 @@ static void 
> mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
>  
>  if (s->oformat == _mxf_opatom_muxer)
>  duration_size = 12;
> +if (s->oformat == _mxf_d10_muxer)
> +size += 5;
>  
>  mxf_write_generic_desc(s, st, key, size+duration_size+5+12+8+8);
>  
> @@ -1350,6 +1353,11 @@ static void 
> mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
>  avio_wb32(pb, st->codecpar->sample_rate);
>  avio_wb32(pb, 1);
>  
> +if (s->oformat == _mxf_d10_muxer) {
> +mxf_write_local_tag(pb, 1, 0x3D04);
> +avio_w8(pb, 0);
> +}

Sizes and such look OK, but again I don't know what the D-10 spec says

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 11/13] avformat/mxfenc: Write Audio Ref Level for D10

2018-05-07 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/mxfenc.c| 8 
 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, 19 insertions(+), 11 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index adf5527534..d57f5372c6 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -507,6 +507,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
 // Generic Sound Essence Descriptor
 { 0x3D02, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x01,0x04,0x00,0x00,0x00}},
 /* Locked/Unlocked */
 { 0x3D03, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x03,0x01,0x01,0x01,0x00,0x00}},
 /* Audio sampling rate */
+{ 0x3D04, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x02,0x01,0x01,0x03,0x00,0x00,0x00}},
 /* Audio Ref Level */
 { 0x3D07, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x02,0x01,0x01,0x04,0x00,0x00,0x00}},
 /* ChannelCount */
 { 0x3D01, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x03,0x04,0x00,0x00,0x00}},
 /* Quantization bits */
 { 0x3D06, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x02,0x04,0x02,0x00,0x00,0x00,0x00}},
 /* Sound Essence Compression */
@@ -1333,6 +1334,8 @@ static void 
mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
 
 if (s->oformat == _mxf_opatom_muxer)
 duration_size = 12;
+if (s->oformat == _mxf_d10_muxer)
+size += 5;
 
 mxf_write_generic_desc(s, st, key, size+duration_size+5+12+8+8);
 
@@ -1350,6 +1353,11 @@ static void 
mxf_write_generic_sound_common(AVFormatContext *s, AVStream *st, con
 avio_wb32(pb, st->codecpar->sample_rate);
 avio_wb32(pb, 1);
 
+if (s->oformat == _mxf_d10_muxer) {
+mxf_write_local_tag(pb, 1, 0x3D04);
+avio_w8(pb, 0);
+}
+
 mxf_write_local_tag(pb, 4, 0x3D07);
 if (mxf->channel_count == -1) {
 if (show_warnings && (s->oformat == _mxf_d10_muxer) && 
(st->codecpar->channels != 4) && (st->codecpar->channels != 8))
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index e3266abeb9..8bd8a23eef 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@
-298afac2f4ddfed331294981160023f0 *tests/data/fate/copy-trac4914.mxf
+0576133def482f672d56369bc945f9d2 *tests/data/fate/copy-trac4914.mxf
 561721 tests/data/fate/copy-trac4914.mxf
 #tb 0: 1001/3
 #media_type 0: video
diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name
index b9beffef66..8c3469de61 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@
-471e8a7d012fb2b00835aadd5fe648c7
+a1a1e8df772ef28380ce95f12e7e8cb8
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index acda7c5fcf..aed683221d 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-68608a7f54b8fe3a85cd387e64bab764
+8149dfa839d55d7f0c127d66ebe86433
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index 9f5818e0af..c2bc32bcf6 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@
-408b3758c11af3210c722a52d2754d8c *./tests/data/lavf/lavf.mxf
+0e342e262c9ad13b3d4758e3666f453e *./tests/data/lavf/lavf.mxf
 526393 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-76d3bec8f170e389da50a82075c8bf83 *./tests/data/lavf/lavf.mxf
+9d30acfb4cd73cfa6e46a01eea625521 *./tests/data/lavf/lavf.mxf
 561721 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0xf21b1b48
-caa15603349cb79d11b75a7c6ad633ab *./tests/data/lavf/lavf.mxf
+76dfdb299f0ae2ed5094405dcd130d25 *./tests/data/lavf/lavf.mxf
 526393 ./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 e73cd5d24f..fae3f40168 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-eb9412edd406c02e4d2ac2380748186b *./tests/data/lavf/lavf.mxf_d10
+7bad01ac8e0f223477f89a7443708ca8 *./tests/data/lavf/lavf.mxf_d10
 5332013 ./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 8635484f17..c54b556a4d 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@
-eddb23aba03c1c0499928bca27d43795 *./tests/data/lavf/lavf.mxf_dv25
+10abfd24b120f93b79d3da0f0677c449 *./tests/data/lavf/lavf.mxf_dv25
 3834413 ./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 5df967054c..cd581528a1 100644
--- a/tests/ref/lavf/mxf_dvcpro50
+++ b/tests/ref/lavf/mxf_dvcpro50