Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
293a6e83
Commit
293a6e83
authored
Mar 21, 2018
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/mxfenc: Write transfer characteristic
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
c35ca7e0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
11 deletions
+50
-11
mxfenc.c
libavformat/mxfenc.c
+39
-0
copy-trac4914
tests/ref/fate/copy-trac4914
+1
-1
mxf-reel_name
tests/ref/fate/mxf-reel_name
+1
-1
time_base
tests/ref/fate/time_base
+1
-1
mxf
tests/ref/lavf/mxf
+3
-3
mxf_d10
tests/ref/lavf/mxf_d10
+1
-1
mxf_dv25
tests/ref/lavf/mxf_dv25
+1
-1
mxf_dvcpro50
tests/ref/lavf/mxf_dvcpro50
+1
-1
mxf_opatom
tests/ref/lavf/mxf_opatom
+1
-1
mxf_opatom_audio
tests/ref/lavf/mxf_opatom_audio
+1
-1
No files found.
libavformat/mxfenc.c
View file @
293a6e83
...
...
@@ -485,6 +485,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{
0x3208
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x01
,
0x04
,
0x01
,
0x05
,
0x01
,
0x0B
,
0x00
,
0x00
,
0x00
}},
/* Display Height */
{
0x320B
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x01
,
0x04
,
0x01
,
0x05
,
0x01
,
0x0E
,
0x00
,
0x00
,
0x00
}},
/* Presentation Y offset */
{
0x320E
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x01
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x00
,
0x00
,
0x00
}},
/* Aspect Ratio */
{
0x3210
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x02
,
0x04
,
0x01
,
0x02
,
0x01
,
0x01
,
0x01
,
0x02
,
0x00
}},
/* Transfer characteristic */
{
0x3213
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x02
,
0x04
,
0x18
,
0x01
,
0x02
,
0x00
,
0x00
,
0x00
,
0x00
}},
/* Image Start Offset */
{
0x3214
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x02
,
0x04
,
0x18
,
0x01
,
0x03
,
0x00
,
0x00
,
0x00
,
0x00
}},
/* Image End Offset */
{
0x3201
,
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x01
,
0x01
,
0x01
,
0x02
,
0x04
,
0x01
,
0x06
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
}},
/* Picture Essence Coding */
...
...
@@ -1136,6 +1137,34 @@ static const UID mxf_aes3_descriptor_key = { 0x06,0x0E,0x2B,0x34,0x02,0x53,
static
const
UID
mxf_cdci_descriptor_key
=
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x02
,
0x53
,
0x01
,
0x01
,
0x0D
,
0x01
,
0x01
,
0x01
,
0x01
,
0x01
,
0x28
,
0x00
};
static
const
UID
mxf_generic_sound_descriptor_key
=
{
0x06
,
0x0E
,
0x2B
,
0x34
,
0x02
,
0x53
,
0x01
,
0x01
,
0x0D
,
0x01
,
0x01
,
0x01
,
0x01
,
0x01
,
0x42
,
0x00
};
static
int
get_trc
(
UID
ul
,
enum
AVColorTransferCharacteristic
trc
)
{
switch
(
trc
){
case
AVCOL_TRC_GAMMA28
:
case
AVCOL_TRC_GAMMA22
:
memcpy
(
ul
,
(
UID
){
0x06
,
0x0E
,
0x2B
,
0x34
,
0x04
,
0x01
,
0x01
,
0x01
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x01
,
0x00
,
0x00
},
16
);
return
0
;
case
AVCOL_TRC_BT709
:
case
AVCOL_TRC_SMPTE170M
:
memcpy
(
ul
,
(
UID
){
0x06
,
0x0E
,
0x2B
,
0x34
,
0x04
,
0x01
,
0x01
,
0x01
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x02
,
0x00
,
0x00
},
16
);
return
0
;
case
AVCOL_TRC_SMPTE240M
:
memcpy
(
ul
,
(
UID
){
0x06
,
0x0E
,
0x2B
,
0x34
,
0x04
,
0x01
,
0x01
,
0x01
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x03
,
0x00
,
0x00
},
16
);
return
0
;
case
AVCOL_TRC_BT1361_ECG
:
memcpy
(
ul
,
(
UID
){
0x06
,
0x0E
,
0x2B
,
0x34
,
0x04
,
0x01
,
0x01
,
0x06
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x05
,
0x00
,
0x00
},
16
);
return
0
;
case
AVCOL_TRC_LINEAR
:
memcpy
(
ul
,
(
UID
){
0x06
,
0x0E
,
0x2B
,
0x34
,
0x04
,
0x01
,
0x01
,
0x06
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x06
,
0x00
,
0x00
},
16
);
return
0
;
case
AVCOL_TRC_SMPTE428
:
memcpy
(
ul
,
(
UID
){
0x06
,
0x0E
,
0x2B
,
0x34
,
0x04
,
0x01
,
0x01
,
0x08
,
0x04
,
0x01
,
0x01
,
0x01
,
0x01
,
0x07
,
0x00
,
0x00
},
16
);
return
0
;
default:
return
-
1
;
}
}
static
void
mxf_write_cdci_common
(
AVFormatContext
*
s
,
AVStream
*
st
,
const
UID
key
,
unsigned
size
)
{
MXFStreamContext
*
sc
=
st
->
priv_data
;
...
...
@@ -1145,6 +1174,8 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
int
display_height
;
int
f1
,
f2
;
unsigned
desc_size
=
size
+
8
+
8
+
8
+
8
+
8
+
8
+
8
+
5
+
16
+
4
+
12
+
20
+
5
+
6
;
UID
transfer_ul
=
{
0
};
if
(
sc
->
interlaced
&&
sc
->
field_dominance
)
desc_size
+=
5
;
if
(
sc
->
signal_standard
)
...
...
@@ -1155,6 +1186,8 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
desc_size
+=
8
*
3
;
if
(
s
->
oformat
==
&
ff_mxf_d10_muxer
)
desc_size
+=
8
+
8
+
8
;
if
(
get_trc
(
transfer_ul
,
st
->
codecpar
->
color_trc
)
>=
0
)
desc_size
+=
20
;
mxf_write_generic_desc
(
s
,
st
,
key
,
desc_size
);
...
...
@@ -1270,6 +1303,12 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
avio_wb32
(
pb
,
sc
->
aspect_ratio
.
num
);
avio_wb32
(
pb
,
sc
->
aspect_ratio
.
den
);
//Transfer characteristic
if
(
transfer_ul
[
0
])
{
mxf_write_local_tag
(
pb
,
16
,
0x3210
);
avio_write
(
pb
,
transfer_ul
,
16
);
};
mxf_write_local_tag
(
pb
,
16
,
0x3201
);
avio_write
(
pb
,
*
sc
->
codec_ul
,
16
);
...
...
tests/ref/fate/copy-trac4914
View file @
293a6e83
a3631810ebed2db905db7554e137b48e
*tests/data/fate/copy-trac4914.mxf
efa819aae97478b7e8e486a52e7ca7ab
*tests/data/fate/copy-trac4914.mxf
561721 tests/data/fate/copy-trac4914.mxf
#tb 0: 1001/30000
#media_type 0: video
...
...
tests/ref/fate/mxf-reel_name
View file @
293a6e83
61f2fe7aa57ae3d64db1e2bb6c2acb16
159c175b80f35b924ef55293ef433d0a
tests/ref/fate/time_base
View file @
293a6e83
f8bb8b13d6c051aa29cc79486f8f555f
aa60f92877322f9e22c90d4fc508d73a
tests/ref/lavf/mxf
View file @
293a6e83
b522a40e24cca5b7f86c99bb5bd78060
*./tests/data/lavf/lavf.mxf
24b059ddbf6022df8059b7e13a11d2a9
*./tests/data/lavf/lavf.mxf
526393 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
3b09745afe0bcd331666ac92e84cf6b8
*./tests/data/lavf/lavf.mxf
937b67f0d27d44da8f10f862445a376b
*./tests/data/lavf/lavf.mxf
561721 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0xf21b1b48
f
e00f21d74ec5a33de0d8fb23f397e42
*./tests/data/lavf/lavf.mxf
f
fb3f5fb2473ce2895ffc0b6ca38ba1f
*./tests/data/lavf/lavf.mxf
526393 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
tests/ref/lavf/mxf_d10
View file @
293a6e83
85ce91f9d1c08072d902dae63a3d31d9
*./tests/data/lavf/lavf.mxf_d10
f429e5c52dadb28236bd72c75544f757
*./tests/data/lavf/lavf.mxf_d10
5332013 ./tests/data/lavf/lavf.mxf_d10
./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488
tests/ref/lavf/mxf_dv25
View file @
293a6e83
788d6d38bd9086a7100ad5bccb93ab59
*./tests/data/lavf/lavf.mxf_dv25
f570a233ee440058987a5b9f3642fea5
*./tests/data/lavf/lavf.mxf_dv25
3834413 ./tests/data/lavf/lavf.mxf_dv25
./tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52
tests/ref/lavf/mxf_dvcpro50
View file @
293a6e83
58e2477bf49c5fa50b6f2266aafae43f
*./tests/data/lavf/lavf.mxf_dvcpro50
914aed46af112523de45ae3487aa6d79
*./tests/data/lavf/lavf.mxf_dvcpro50
7431213 ./tests/data/lavf/lavf.mxf_dvcpro50
./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
tests/ref/lavf/mxf_opatom
View file @
293a6e83
e95dc4f86864b4c3d63f81b8966077a3
*./tests/data/lavf/lavf.mxf_opatom
75ccb51d422e319f4b284a94815bb0c7
*./tests/data/lavf/lavf.mxf_opatom
4717625 ./tests/data/lavf/lavf.mxf_opatom
./tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a
tests/ref/lavf/mxf_opatom_audio
View file @
293a6e83
c0e14eec21b75875a6c898f71cbeded0
*./tests/data/lavf/lavf.mxf_opatom_audio
55868441de7088b20438417ecdf77d93
*./tests/data/lavf/lavf.mxf_opatom_audio
102969 ./tests/data/lavf/lavf.mxf_opatom_audio
./tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment