@pixwel/pixwel-sdk 2.1.18 → 2.1.20

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.
@@ -327,19 +327,19 @@ var Ingest = function (_Model) {
327
327
 
328
328
  var tags = {};
329
329
 
330
- if (!info.File) {
331
- throw "missing info.File";
330
+ if (!info.media) {
331
+ throw "missing info.media";
332
332
  }
333
333
 
334
- if (!info.File.track) {
335
- throw "missing info.File.track";
334
+ if (!info.media.track) {
335
+ throw "missing info.media.track";
336
336
  }
337
337
 
338
338
  var general = void 0;
339
- if (!Array.isArray(info["File"]["track"])) {
340
- general = info["File"]["track"];
339
+ if (!Array.isArray(info["media"]["track"])) {
340
+ general = info["media"]["track"];
341
341
  } else {
342
- general = _lodash2.default.find(info["File"]["track"], { _type: "General" });
342
+ general = _lodash2.default.find(info["media"]["track"], { '@type': "General" });
343
343
  }
344
344
 
345
345
  switch (mediaType) {
@@ -366,8 +366,8 @@ var Ingest = function (_Model) {
366
366
  ScanType: ""
367
367
  };
368
368
 
369
- var media = _lodash2.default.find(info["File"]["track"], {
370
- _type: mediaType
369
+ var media = _lodash2.default.find(info["media"]["track"], {
370
+ '@type': mediaType
371
371
  });
372
372
  media = _lodash2.default.merge({}, mediainfoDefaults, media);
373
373
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pixwel/pixwel-sdk",
3
3
  "description": "",
4
- "version": "2.1.18",
4
+ "version": "2.1.20",
5
5
  "author": "Pixwel",
6
6
  "license": "UNLICENSED",
7
7
  "main": "./dist/index.js",
package/src/Ingest.js CHANGED
@@ -302,19 +302,19 @@ export default class Ingest extends Model {
302
302
 
303
303
  let tags = {};
304
304
 
305
- if (!info.File) {
306
- throw "missing info.File";
305
+ if (!info.media) {
306
+ throw "missing info.media";
307
307
  }
308
308
 
309
- if (!info.File.track) {
310
- throw "missing info.File.track";
309
+ if (!info.media.track) {
310
+ throw "missing info.media.track";
311
311
  }
312
312
 
313
313
  let general;
314
- if (!Array.isArray(info["File"]["track"])) {
315
- general = info["File"]["track"];
314
+ if (!Array.isArray(info["media"]["track"])) {
315
+ general = info["media"]["track"];
316
316
  } else {
317
- general = _.find(info["File"]["track"], { _type: "General" });
317
+ general = _.find(info["media"]["track"], { '@type': "General" });
318
318
  }
319
319
 
320
320
  switch (mediaType) {
@@ -341,8 +341,8 @@ export default class Ingest extends Model {
341
341
  ScanType: ""
342
342
  };
343
343
 
344
- let media = _.find(info["File"]["track"], {
345
- _type: mediaType
344
+ let media = _.find(info["media"]["track"], {
345
+ '@type': mediaType
346
346
  });
347
347
  media = _.merge({}, mediainfoDefaults, media);
348
348
 
@@ -1,6 +1,7 @@
1
1
  import { Ingest, Order } from "../index";
2
2
 
3
3
  import mock from "./mocks/mediainfo.mock";
4
+ import mock4x3 from "./mocks/mediainfo-4x3.mock";
4
5
  import proresMock from "./mocks/prores.mock";
5
6
  import pngMock from "./mocks/mediainfo.png.mock";
6
7
  import mxfMock from "./mocks/mediainfo.mxf.mock";
@@ -698,19 +699,14 @@ describe("Ingest", () => {
698
699
  language: "ENG",
699
700
  country: "WW",
700
701
  tags: {
701
- Extra: [],
702
- SubDub: {
703
- sub: null,
704
- dub: null
705
- },
706
- Resolution: "720x486",
707
- Codec: "prores",
708
- "Frame Mode": "progressive",
709
- Framerate: "23.98",
710
702
  Standard: "ntsc",
711
- Usage: "broadcast",
712
703
  Aspect: "16:9",
713
- Text: "txtd"
704
+ Resolution: "1920x1080",
705
+ "Frame Mode": "progressive",
706
+ Framerate: "29.97",
707
+ Text: "txtd",
708
+ Extra: ["COMING-SOON", "HOJE"],
709
+ Codec: "PRORES"
714
710
  }
715
711
  }
716
712
  }
@@ -721,7 +717,7 @@ describe("Ingest", () => {
721
717
  let extension = "mp4";
722
718
  let name = ingest.renderFilename({ allTags, allTypes, extension });
723
719
  expect(name).toBe(
724
- "TESTPROJECT_ITR-TEST-ASSET-A_ENG_TXTD_PRORES_NTSC-16X9_486p2398.mp4"
720
+ "TESTPROJECT_ITR-TEST-ASSET-A_ENG_TXTD_COMING-SOON_HOJE_PRORES_NTSC-16X9_1080p2997.mp4"
725
721
  );
726
722
  });
727
723
  it("renders `set` tags when all tags in `set` are specified but retains `codec`", function() {
@@ -1037,7 +1033,7 @@ describe("Ingest", () => {
1037
1033
  }
1038
1034
  },
1039
1035
  mediainfo: {
1040
- File: { track: {} }
1036
+ media: { track: {} }
1041
1037
  },
1042
1038
  selected: {
1043
1039
  download: {
@@ -1319,7 +1315,7 @@ describe("Ingest", () => {
1319
1315
  });
1320
1316
  });
1321
1317
  describe("mapFromMediainfo", () => {
1322
- it("should throw exception if missing File object", () => {
1318
+ it("should throw exception if missing media object", () => {
1323
1319
  let meta = {};
1324
1320
  expect(() => {
1325
1321
  let ingest = new Ingest({
@@ -1327,20 +1323,20 @@ describe("Ingest", () => {
1327
1323
  mediainfo: meta
1328
1324
  });
1329
1325
  let info = ingest.mapFromMediainfo();
1330
- }).toThrow("missing info.File");
1326
+ }).toThrow("missing info.media");
1331
1327
  });
1332
- it("should throw exception if missing File.track object", () => {
1333
- let meta = { File: {} };
1328
+ it("should throw exception if missing media.track object", () => {
1329
+ let meta = { media: {} };
1334
1330
  expect(() => {
1335
1331
  let ingest = new Ingest({
1336
1332
  source: { mediaType: "video" },
1337
1333
  mediainfo: meta
1338
1334
  });
1339
1335
  let info = ingest.mapFromMediainfo();
1340
- }).toThrow("missing info.File.track");
1336
+ }).toThrow("missing info.media.track");
1341
1337
  });
1342
1338
  it("should return empty object of tags if no metadata supplied", () => {
1343
- let meta = { File: { track: {} } };
1339
+ let meta = { media: { track: {} } };
1344
1340
  let ingest = new Ingest({
1345
1341
  source: { mediaType: "video" },
1346
1342
  mediainfo: meta
@@ -0,0 +1,76 @@
1
+
2
+ module.exports = {
3
+ File: {
4
+ track: [
5
+ {
6
+ Complete_name:
7
+ "https://slurpee3-encode-bucket.s3.us-west-2.amazonaws.com/encoded/5d729ee130c5782b008b456e.mov?AWSAccessKeyId=ASIA6POTFMFMZCJQFKMU&Expires=1567796481&Signature=LgyMuh65spyyt%2F%2FSyOnr4Jxqs0g%3D&x-amz-security-token=AgoJb3JpZ2luX2VjEKr%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLXdlc3QtMiJHMEUCIQDieWUmrxT0AzYzVxzFv%2FPPorrdWtMNQwGo8L9UdlGvgQIgW7JgNXI5uU3fmv1DWCatjm8A17HvMucz6%2BvamgIlxRAqmwIIYxAAGgw5OTUyNjQ2NTE2MDkiDBnCi08PK03Wx7FM4Cr4AZKz6X7mA%2B4uRPysQxLquVuGhm%2BT3y5LN0naVSJri79wGtMskSHTGcLSO1mR5YMJgPM%2BLG%2BK1O8UdxohgNitGYgdsSvVKqUYQoVbRFvCkwMtxHVUuh37rBgjug26BkfyWm7F9dJEuLDP2YMIshhP0Iys81dX%2BU6p7tuA2KDY10Or0%2Bo6j3OgvKezwnL40aFM3bLR7Mjc7CcwKIeUj3%2FLADhlAfxxd4jVHCNyYs8d0oXE689PWhAUjqnLfm5s7sG5dR7bJhq8Bgv%2BrdbVcvKODOg2y33JsweUXJG0hnydMACnsOjJmUxgE7hlrVkBz%2BKE5aYgNOF7w8%2FSMPC9yusFOrQB90%2BMdanLrtCez%2Bl9fg5Eas3sNdg9Kflg4MxGZ70yU6ukLKGILmi1fneLBa2CxR1UrtOJJiT5ECRrUY68RdRq4OlZRrSXW5AxTjyn2KLn5OVPHY8VcxfwdkxzQbxmDyoFGWSnsch5nS5LU0snKRQe4h7dGUYLNnWsUR5PceG9dZJeORP6YXHtB%2FmVG%2Fv0AlpGo8Z7qXicVMLL6MuPPT3bPa%2BVKb%2FrZCWF5jw5l1kjHx%2FxzmzS",
8
+ Format: "MPEG-4",
9
+ Format_profile: "QuickTime",
10
+ Codec_ID: "qt 2005.03 (qt )",
11
+ File_size: "8.03 MiB",
12
+ Duration: "1 s 68 ms",
13
+ Overall_bit_rate_mode: "Variable",
14
+ Overall_bit_rate: "63.1 Mb/s",
15
+ Encoded_date: "UTC 2019-09-06 18:01:18",
16
+ Tagged_date: "UTC 2019-09-06 18:01:18",
17
+ FileExtension_Invalid:
18
+ "mov mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4v",
19
+ '@type': "General"
20
+ },
21
+ {
22
+ ID: "1",
23
+ Format: "ProRes",
24
+ Format_version: "Version 0",
25
+ Format_profile: "422 HQ",
26
+ Codec_ID: "apch",
27
+ Duration: "1 s 68 ms",
28
+ Bit_rate_mode: "Variable",
29
+ Bit_rate: "61.2 Mb/s",
30
+ Width: "720 pixels",
31
+ Clean_aperture_width: "704 pixels",
32
+ Height: "486 pixels",
33
+ Clean_aperture_height: "480 pixels",
34
+ Display_aspect_ratio: "4:3",
35
+ Clean_aperture_display_aspect_ratio: "4:3",
36
+ Frame_rate_mode: "Constant",
37
+ Frame_rate: "29.970 (30000/1001) FPS",
38
+ Standard: "NTSC",
39
+ Color_space: "YUV",
40
+ Chroma_subsampling: "4:2:2",
41
+ Scan_type: "Progressive",
42
+ Bits__Pixel_Frame_: "5.833",
43
+ Stream_size: "7.79 MiB (97%)",
44
+ Writing_library: "ael0",
45
+ Language: "English",
46
+ Encoded_date: "UTC 2019-09-06 18:01:18",
47
+ Tagged_date: "UTC 2019-09-06 18:01:18",
48
+ Color_primaries: "BT.709",
49
+ Transfer_characteristics: "BT.709",
50
+ Matrix_coefficients: "BT.709",
51
+ matrix_coefficients_Original: "BT.601",
52
+ '@type': "Video"
53
+ },
54
+ {
55
+ ID: "2",
56
+ Format: "PCM",
57
+ Format_settings__Endianness: "Little",
58
+ Format_settings__Sign: "Signed",
59
+ Codec_ID: "lpcm",
60
+ Duration: "1 s 61 ms",
61
+ Bit_rate_mode: "Constant",
62
+ Bit_rate: "1 536 kb/s",
63
+ Channel_s_: "2 channels",
64
+ Channel_positions: "Front: L R",
65
+ Sampling_rate: "48.0 kHz",
66
+ Bit_depth: "16 bits",
67
+ Stream_size: "199 KiB (2%)",
68
+ Language: "English",
69
+ Encoded_date: "UTC 2019-09-06 18:01:18",
70
+ Tagged_date: "UTC 2019-09-06 18:01:18",
71
+ '@type': "Audio"
72
+ }
73
+ ]
74
+ },
75
+ _version: "0.7.92.1"
76
+ };
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  VideoCount: "1",
@@ -19,7 +19,7 @@ module.exports = {
19
19
  FooterSize: "8875",
20
20
  IsStreamable: "No",
21
21
  Encoded_Application: "Lavf57.83.100",
22
- _type: "General"
22
+ '@type': "General"
23
23
  },
24
24
  {
25
25
  StreamOrder: "0",
@@ -55,7 +55,7 @@ module.exports = {
55
55
  Encoded_Library_Settings:
56
56
  "cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00",
57
57
  Language: "en",
58
- _type: "Video"
58
+ '@type': "Video"
59
59
  },
60
60
  {
61
61
  StreamOrder: "1",
@@ -81,7 +81,7 @@ module.exports = {
81
81
  Language: "en",
82
82
  Default: "Yes",
83
83
  AlternateGroup: "1",
84
- _type: "Audio"
84
+ '@type': "Audio"
85
85
  }
86
86
  ],
87
87
  _ref:
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  Format: "MXF",
@@ -15,7 +15,7 @@ module.exports = {
15
15
  Encoded_date: "2018-07-03 01:23:26.180",
16
16
  Writing_application: "OpenCube MXFTk Advanced 2.6.4.0.1",
17
17
  Writing_library: "Darwin 15.6.0 x86_64 2.6.4.0.1",
18
- _type: "General"
18
+ '@type': "General"
19
19
  },
20
20
  {
21
21
  ID: "2",
@@ -51,7 +51,7 @@ module.exports = {
51
51
  Color_primaries: "BT.709",
52
52
  Transfer_characteristics: "BT.709",
53
53
  Matrix_coefficients: "BT.709",
54
- _type: "Video"
54
+ '@type': "Video"
55
55
  },
56
56
  {
57
57
  ID: "3",
@@ -68,7 +68,7 @@ module.exports = {
68
68
  Bit_depth: "24 bits",
69
69
  Stream_size: "1.37 MiB (2%)",
70
70
  Title: "Sound",
71
- _type: "Audio",
71
+ '@type': "Audio",
72
72
  _typeorder: "1"
73
73
  },
74
74
  {
@@ -86,7 +86,7 @@ module.exports = {
86
86
  Bit_depth: "24 bits",
87
87
  Stream_size: "1.37 MiB (2%)",
88
88
  Title: "Sound",
89
- _type: "Audio",
89
+ '@type': "Audio",
90
90
  _typeorder: "2"
91
91
  },
92
92
  {
@@ -104,7 +104,7 @@ module.exports = {
104
104
  Bit_depth: "24 bits",
105
105
  Stream_size: "1.37 MiB (2%)",
106
106
  Title: "Sound",
107
- _type: "Audio",
107
+ '@type': "Audio",
108
108
  _typeorder: "3"
109
109
  },
110
110
  {
@@ -122,7 +122,7 @@ module.exports = {
122
122
  Bit_depth: "24 bits",
123
123
  Stream_size: "1.37 MiB (2%)",
124
124
  Title: "Sound",
125
- _type: "Audio",
125
+ '@type': "Audio",
126
126
  _typeorder: "4"
127
127
  },
128
128
  {
@@ -140,7 +140,7 @@ module.exports = {
140
140
  Bit_depth: "24 bits",
141
141
  Stream_size: "1.37 MiB (2%)",
142
142
  Title: "Sound",
143
- _type: "Audio",
143
+ '@type': "Audio",
144
144
  _typeorder: "5"
145
145
  },
146
146
  {
@@ -158,7 +158,7 @@ module.exports = {
158
158
  Bit_depth: "24 bits",
159
159
  Stream_size: "1.37 MiB (2%)",
160
160
  Title: "Sound",
161
- _type: "Audio",
161
+ '@type': "Audio",
162
162
  _typeorder: "6"
163
163
  },
164
164
  {
@@ -176,7 +176,7 @@ module.exports = {
176
176
  Bit_depth: "24 bits",
177
177
  Stream_size: "1.37 MiB (2%)",
178
178
  Title: "Sound",
179
- _type: "Audio",
179
+ '@type': "Audio",
180
180
  _typeorder: "7"
181
181
  },
182
182
  {
@@ -194,7 +194,7 @@ module.exports = {
194
194
  Bit_depth: "24 bits",
195
195
  Stream_size: "1.37 MiB (2%)",
196
196
  Title: "Sound",
197
- _type: "Audio",
197
+ '@type': "Audio",
198
198
  _typeorder: "8"
199
199
  },
200
200
  {
@@ -204,7 +204,7 @@ module.exports = {
204
204
  Time_code_of_first_frame: "00:00:00:00",
205
205
  Time_code_settings: "Material Package",
206
206
  Time_code__striped: "Yes",
207
- _type: "Other",
207
+ '@type': "Other",
208
208
  _typeorder: "1"
209
209
  },
210
210
  {
@@ -214,7 +214,7 @@ module.exports = {
214
214
  Time_code_of_first_frame: "00:00:00:00",
215
215
  Time_code_settings: "Source Package",
216
216
  Time_code__striped: "Yes",
217
- _type: "Other",
217
+ '@type': "Other",
218
218
  _typeorder: "2"
219
219
  },
220
220
  {
@@ -222,7 +222,7 @@ module.exports = {
222
222
  Format: "SMPTE TC",
223
223
  Muxing_mode: "SDTI",
224
224
  Time_code_of_first_frame: "00:00:00:00",
225
- _type: "Other",
225
+ '@type': "Other",
226
226
  _typeorder: "3"
227
227
  }
228
228
  ]
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
5
  Format: "PNG",
6
6
  Format_Info: "Portable Network Graphic",
7
7
  File_size: "518 KiB",
8
- _type: "General"
8
+ '@type': "General"
9
9
  },
10
10
  {
11
11
  Format: "PNG",
@@ -15,7 +15,7 @@ module.exports = {
15
15
  Bit_depth: "24 bits",
16
16
  Compression_mode: "Lossless",
17
17
  Stream_size: "518 KiB (100%)",
18
- _type: "Image"
18
+ '@type': "Image"
19
19
  }
20
20
  ]
21
21
  }
@@ -1,8 +1,8 @@
1
1
  module.exports = {
2
- File: {
2
+ media: {
3
3
  track: [
4
4
  {
5
- _type: "General",
5
+ '@type': "General",
6
6
  VideoCount: "1",
7
7
  AudioCount: "1",
8
8
  OtherCount: "1",
@@ -34,7 +34,7 @@ module.exports = {
34
34
  }
35
35
  },
36
36
  {
37
- _type: "Video",
37
+ '@type': "Video",
38
38
  StreamOrder: "0",
39
39
  ID: "1",
40
40
  Format: "ProRes",
@@ -72,7 +72,7 @@ module.exports = {
72
72
  }
73
73
  },
74
74
  {
75
- _type: "Audio",
75
+ '@type': "Audio",
76
76
  StreamOrder: "1",
77
77
  ID: "2",
78
78
  Format: "PCM",
@@ -101,7 +101,7 @@ module.exports = {
101
101
  }
102
102
  },
103
103
  {
104
- _type: "Other",
104
+ '@type': "Other",
105
105
  StreamOrder: "2",
106
106
  ID: "3",
107
107
  Type: "Time code",