@pixwel/pixwel-sdk 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -46,6 +46,18 @@ var Ingest = function () {
46
46
  Duration: ""
47
47
  };
48
48
 
49
+ if (!info.File) {
50
+ throw "missing info.File";
51
+ }
52
+
53
+ if (!info.File.track) {
54
+ throw "missing info.File.track";
55
+ }
56
+
57
+ var general = _lodash2.default.find(info["File"]["track"], {
58
+ _type: 'General'
59
+ });
60
+
49
61
  switch (mediaType) {
50
62
  case 'video':
51
63
  mediaType = 'Video';
@@ -54,17 +66,12 @@ var Ingest = function () {
54
66
  mediaType = 'Image';
55
67
  break;
56
68
  default:
69
+ if (general.Format == 'MXF') {
70
+ tags.Usage = 'broadcast';
71
+ }
57
72
  return tags;
58
73
  }
59
74
 
60
- if (!info.File) {
61
- throw "missing info.File";
62
- }
63
-
64
- if (!info.File.track) {
65
- throw "missing info.File.track";
66
- }
67
-
68
75
  var mediainfoDefaults = {
69
76
  Display_aspect_ratio: "",
70
77
  Format: "",
@@ -133,6 +140,10 @@ var Ingest = function () {
133
140
  tags.Usage = "broadcast";
134
141
  }
135
142
 
143
+ if (general && general['Format'] == 'MXF') {
144
+ tags.Usage = 'broadcast';
145
+ }
146
+
136
147
  tags.Aspect = media["Display_aspect_ratio"] || "";
137
148
  tags["Frame Mode"] = media["Scan_type"].toLowerCase();
138
149
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixwel/pixwel-sdk",
3
3
  "description": "",
4
- "version": "1.1.4",
4
+ "version": "1.1.6",
5
5
  "author": "Pixwel",
6
6
  "license": "UNLICENSED",
7
7
  "main": "./dist/index.js",
@@ -16,10 +16,10 @@
16
16
  "collectCoverageFrom": [
17
17
  "src/*.js"
18
18
  ]
19
- },
20
- "dependencies": {
19
+ },
20
+ "dependencies": {
21
21
  "lodash": "^4.17.10"
22
- },
22
+ },
23
23
  "devDependencies": {
24
24
  "babel-cli": "^6.26.0",
25
25
  "babel-preset-env": "^1.7.0",
package/src/Ingest.js CHANGED
@@ -25,6 +25,18 @@ export default class Ingest {
25
25
  Duration: ""
26
26
  };
27
27
 
28
+ if (!info.File) {
29
+ throw "missing info.File";
30
+ }
31
+
32
+ if (!info.File.track) {
33
+ throw "missing info.File.track";
34
+ }
35
+
36
+ let general = _.find(info["File"]["track"], {
37
+ _type: 'General'
38
+ });
39
+
28
40
  switch (mediaType) {
29
41
  case 'video':
30
42
  mediaType = 'Video';
@@ -33,17 +45,12 @@ export default class Ingest {
33
45
  mediaType = 'Image';
34
46
  break;
35
47
  default:
48
+ if (general.Format == 'MXF') {
49
+ tags.Usage = 'broadcast';
50
+ }
36
51
  return tags;
37
52
  }
38
53
 
39
- if (!info.File) {
40
- throw "missing info.File";
41
- }
42
-
43
- if (!info.File.track) {
44
- throw "missing info.File.track";
45
- }
46
-
47
54
  let mediainfoDefaults = {
48
55
  Display_aspect_ratio: "",
49
56
  Format: "",
@@ -112,6 +119,10 @@ export default class Ingest {
112
119
  tags.Usage = "broadcast";
113
120
  }
114
121
 
122
+ if (general && general['Format'] == 'MXF') {
123
+ tags.Usage = 'broadcast';
124
+ }
125
+
115
126
  tags.Aspect = media["Display_aspect_ratio"] || "";
116
127
  tags["Frame Mode"] = media["Scan_type"].toLowerCase();
117
128
 
@@ -3,6 +3,7 @@ import Ingest from "../src/Ingest";
3
3
  import mock from "./mocks/mediainfo.mock";
4
4
  import proresMock from "./mocks/prores.mock";
5
5
  import pngMock from "./mocks/mediainfo.png.mock";
6
+ import mxfMock from "./mocks/mediainfo.mxf.mock";
6
7
 
7
8
  describe("Ingest", () => {
8
9
  describe("mapMetaToTags", () => {
@@ -40,6 +41,22 @@ describe("Ingest", () => {
40
41
  Duration: ""
41
42
  });
42
43
  });
44
+ it("should set usage to broadcast for mxf files", () => {
45
+ let meta = mxfMock;
46
+ let ingest = Ingest.mapMetaToTags(meta, "");
47
+ expect(ingest).toEqual({
48
+ Aspect: "",
49
+ Standard: "",
50
+ Resolution: "",
51
+ Codec: "",
52
+ "Frame Mode": "",
53
+ Text: "",
54
+ Usage: "broadcast",
55
+ Extra: [],
56
+ Framerate: "",
57
+ Duration: ""
58
+ });
59
+ });
43
60
  it("should correctly map h264 metadata to tags", () => {
44
61
  let meta = mock;
45
62
  let ingest = Ingest.mapMetaToTags(meta, "video");
@@ -0,0 +1,230 @@
1
+ module.exports = {
2
+ File: {
3
+ track: [
4
+ {
5
+ Format: "MXF",
6
+ Commercial_name: "XDCAM HD422",
7
+ Format_version: "1.3",
8
+ Format_profile: "OP-1a",
9
+ Format_settings: "Closed / Complete",
10
+ File_size: "70.3 MiB",
11
+ Duration: "10s 0ms",
12
+ Overall_bit_rate: "59.0 Mbps",
13
+ Package_name:
14
+ "MI6_TV-SPOT-INTL_DANGEROUS-INTL-10_ENG-EA_TXTD_TAG1-DATE-8-TRACK",
15
+ Encoded_date: "2018-07-03 01:23:26.180",
16
+ Writing_application: "OpenCube MXFTk Advanced 2.6.4.0.1",
17
+ Writing_library: "Darwin 15.6.0 x86_64 2.6.4.0.1",
18
+ _type: "General"
19
+ },
20
+ {
21
+ ID: "2",
22
+ Format: "MPEG Video",
23
+ Commercial_name: "XDCAM HD422",
24
+ Format_version: "Version 2",
25
+ Format_profile: "4:2:2@High",
26
+ Format_settings__BVOP: "Yes",
27
+ Format_settings__Matrix: "Custom",
28
+ Format_settings__GOP: "M=3, N=12",
29
+ Format_settings__picture_structure: "Frame",
30
+ Format_settings__wrapping_mode: "Frame",
31
+ Codec_ID: "0D01030102046001-0401020201040300",
32
+ Duration: "10s 0ms",
33
+ Bit_rate: "50.0 Mbps",
34
+ Width: "1 920 pixels",
35
+ Height: "1 080 pixels",
36
+ Display_aspect_ratio: "16:9",
37
+ Frame_rate: "25.000 fps",
38
+ Standard: "Component",
39
+ Color_space: "YUV",
40
+ Chroma_subsampling: "4:2:2",
41
+ Bit_depth: "8 bits",
42
+ Scan_type: "Interlaced",
43
+ Scan_order: "Top Field First",
44
+ Compression_mode: "Lossy",
45
+ Bits__Pixel_Frame_: "0.965",
46
+ Time_code_of_first_frame: "01:00:00:00",
47
+ Time_code_source: "Group of pictures header",
48
+ GOP__Open_Closed: "Closed",
49
+ Stream_size: "59.6 MiB (85%)",
50
+ Title: "Picture",
51
+ Color_primaries: "BT.709",
52
+ Transfer_characteristics: "BT.709",
53
+ Matrix_coefficients: "BT.709",
54
+ _type: "Video"
55
+ },
56
+ {
57
+ ID: "3",
58
+ Format: "PCM",
59
+ Format_settings__Endianness: "Little",
60
+ Format_settings__wrapping_mode: "Frame (AES)",
61
+ Codec_ID: "0D01030102060300-040202017F000000",
62
+ Duration: "10s 0ms",
63
+ Bit_rate_mode: "Constant",
64
+ Bit_rate: "1 152 Kbps",
65
+ Channel_s_: "1 channel",
66
+ Sampling_rate: "48.0 KHz",
67
+ Frame_rate: "25.000 fps (1920 spf)",
68
+ Bit_depth: "24 bits",
69
+ Stream_size: "1.37 MiB (2%)",
70
+ Title: "Sound",
71
+ _type: "Audio",
72
+ _typeorder: "1"
73
+ },
74
+ {
75
+ ID: "4",
76
+ Format: "PCM",
77
+ Format_settings__Endianness: "Little",
78
+ Format_settings__wrapping_mode: "Frame (AES)",
79
+ Codec_ID: "0D01030102060300-040202017F000000",
80
+ Duration: "10s 0ms",
81
+ Bit_rate_mode: "Constant",
82
+ Bit_rate: "1 152 Kbps",
83
+ Channel_s_: "1 channel",
84
+ Sampling_rate: "48.0 KHz",
85
+ Frame_rate: "25.000 fps (1920 spf)",
86
+ Bit_depth: "24 bits",
87
+ Stream_size: "1.37 MiB (2%)",
88
+ Title: "Sound",
89
+ _type: "Audio",
90
+ _typeorder: "2"
91
+ },
92
+ {
93
+ ID: "5",
94
+ Format: "PCM",
95
+ Format_settings__Endianness: "Little",
96
+ Format_settings__wrapping_mode: "Frame (AES)",
97
+ Codec_ID: "0D01030102060300-040202017F000000",
98
+ Duration: "10s 0ms",
99
+ Bit_rate_mode: "Constant",
100
+ Bit_rate: "1 152 Kbps",
101
+ Channel_s_: "1 channel",
102
+ Sampling_rate: "48.0 KHz",
103
+ Frame_rate: "25.000 fps (1920 spf)",
104
+ Bit_depth: "24 bits",
105
+ Stream_size: "1.37 MiB (2%)",
106
+ Title: "Sound",
107
+ _type: "Audio",
108
+ _typeorder: "3"
109
+ },
110
+ {
111
+ ID: "6",
112
+ Format: "PCM",
113
+ Format_settings__Endianness: "Little",
114
+ Format_settings__wrapping_mode: "Frame (AES)",
115
+ Codec_ID: "0D01030102060300-040202017F000000",
116
+ Duration: "10s 0ms",
117
+ Bit_rate_mode: "Constant",
118
+ Bit_rate: "1 152 Kbps",
119
+ Channel_s_: "1 channel",
120
+ Sampling_rate: "48.0 KHz",
121
+ Frame_rate: "25.000 fps (1920 spf)",
122
+ Bit_depth: "24 bits",
123
+ Stream_size: "1.37 MiB (2%)",
124
+ Title: "Sound",
125
+ _type: "Audio",
126
+ _typeorder: "4"
127
+ },
128
+ {
129
+ ID: "7",
130
+ Format: "PCM",
131
+ Format_settings__Endianness: "Little",
132
+ Format_settings__wrapping_mode: "Frame (AES)",
133
+ Codec_ID: "0D01030102060300-040202017F000000",
134
+ Duration: "10s 0ms",
135
+ Bit_rate_mode: "Constant",
136
+ Bit_rate: "1 152 Kbps",
137
+ Channel_s_: "1 channel",
138
+ Sampling_rate: "48.0 KHz",
139
+ Frame_rate: "25.000 fps (1920 spf)",
140
+ Bit_depth: "24 bits",
141
+ Stream_size: "1.37 MiB (2%)",
142
+ Title: "Sound",
143
+ _type: "Audio",
144
+ _typeorder: "5"
145
+ },
146
+ {
147
+ ID: "8",
148
+ Format: "PCM",
149
+ Format_settings__Endianness: "Little",
150
+ Format_settings__wrapping_mode: "Frame (AES)",
151
+ Codec_ID: "0D01030102060300-040202017F000000",
152
+ Duration: "10s 0ms",
153
+ Bit_rate_mode: "Constant",
154
+ Bit_rate: "1 152 Kbps",
155
+ Channel_s_: "1 channel",
156
+ Sampling_rate: "48.0 KHz",
157
+ Frame_rate: "25.000 fps (1920 spf)",
158
+ Bit_depth: "24 bits",
159
+ Stream_size: "1.37 MiB (2%)",
160
+ Title: "Sound",
161
+ _type: "Audio",
162
+ _typeorder: "6"
163
+ },
164
+ {
165
+ ID: "9",
166
+ Format: "PCM",
167
+ Format_settings__Endianness: "Little",
168
+ Format_settings__wrapping_mode: "Frame (AES)",
169
+ Codec_ID: "0D01030102060300-040202017F000000",
170
+ Duration: "10s 0ms",
171
+ Bit_rate_mode: "Constant",
172
+ Bit_rate: "1 152 Kbps",
173
+ Channel_s_: "1 channel",
174
+ Sampling_rate: "48.0 KHz",
175
+ Frame_rate: "25.000 fps (1920 spf)",
176
+ Bit_depth: "24 bits",
177
+ Stream_size: "1.37 MiB (2%)",
178
+ Title: "Sound",
179
+ _type: "Audio",
180
+ _typeorder: "7"
181
+ },
182
+ {
183
+ ID: "10",
184
+ Format: "PCM",
185
+ Format_settings__Endianness: "Little",
186
+ Format_settings__wrapping_mode: "Frame (AES)",
187
+ Codec_ID: "0D01030102060300-040202017F000000",
188
+ Duration: "10s 0ms",
189
+ Bit_rate_mode: "Constant",
190
+ Bit_rate: "1 152 Kbps",
191
+ Channel_s_: "1 channel",
192
+ Sampling_rate: "48.0 KHz",
193
+ Frame_rate: "25.000 fps (1920 spf)",
194
+ Bit_depth: "24 bits",
195
+ Stream_size: "1.37 MiB (2%)",
196
+ Title: "Sound",
197
+ _type: "Audio",
198
+ _typeorder: "8"
199
+ },
200
+ {
201
+ ID: "1-Material",
202
+ Type: "Time code",
203
+ Format: "MXF TC",
204
+ Time_code_of_first_frame: "00:00:00:00",
205
+ Time_code_settings: "Material Package",
206
+ Time_code__striped: "Yes",
207
+ _type: "Other",
208
+ _typeorder: "1"
209
+ },
210
+ {
211
+ ID: "1-Source",
212
+ Type: "Time code",
213
+ Format: "MXF TC",
214
+ Time_code_of_first_frame: "00:00:00:00",
215
+ Time_code_settings: "Source Package",
216
+ Time_code__striped: "Yes",
217
+ _type: "Other",
218
+ _typeorder: "2"
219
+ },
220
+ {
221
+ Type: "Time code",
222
+ Format: "SMPTE TC",
223
+ Muxing_mode: "SDTI",
224
+ Time_code_of_first_frame: "00:00:00:00",
225
+ _type: "Other",
226
+ _typeorder: "3"
227
+ }
228
+ ]
229
+ }
230
+ };