@editframe/assets 0.21.0-beta.0 → 0.23.6-beta.0

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.
package/dist/Probe.js CHANGED
@@ -373,12 +373,10 @@ var ProbeBase = class {
373
373
  };
374
374
  var Probe = class Probe extends ProbeBase {
375
375
  static async probePath(absolutePath) {
376
- const json = await FFProbeRunner.probePath(absolutePath, false);
377
- return new Probe(absolutePath, json);
376
+ return new Probe(absolutePath, await FFProbeRunner.probePath(absolutePath, false));
378
377
  }
379
378
  static async probeStream(stream) {
380
- const json = await FFProbeRunner.probeStream(stream, false);
381
- return new Probe("pipe:0", json);
379
+ return new Probe("pipe:0", await FFProbeRunner.probeStream(stream, false));
382
380
  }
383
381
  constructor(absolutePath, rawData) {
384
382
  super(absolutePath);
@@ -387,12 +385,10 @@ var Probe = class Probe extends ProbeBase {
387
385
  };
388
386
  var PacketProbe = class PacketProbe extends ProbeBase {
389
387
  static async probePath(absolutePath) {
390
- const json = await FFProbeRunner.probePath(absolutePath, true);
391
- return new PacketProbe(absolutePath, json);
388
+ return new PacketProbe(absolutePath, await FFProbeRunner.probePath(absolutePath, true));
392
389
  }
393
390
  static async probeStream(stream) {
394
- const json = await FFProbeRunner.probeStream(stream, true);
395
- return new PacketProbe("pipe:0", json);
391
+ return new PacketProbe("pipe:0", await FFProbeRunner.probeStream(stream, true));
396
392
  }
397
393
  constructor(absolutePath, rawData) {
398
394
  super(absolutePath);
@@ -14,10 +14,7 @@ function constructH264CodecString(codecTagString, profile, level) {
14
14
  "High 444": 244
15
15
  }[profile];
16
16
  if (!profileIdc) return codecTagString;
17
- const profileHex = profileIdc.toString(16).padStart(2, "0");
18
- const constraintFlags = "00";
19
- const levelHex = level.toString(16).padStart(2, "0");
20
- return `${codecTagString}.${profileHex}${constraintFlags}${levelHex}`;
17
+ return `${codecTagString}.${profileIdc.toString(16).padStart(2, "0")}00${level.toString(16).padStart(2, "0")}`;
21
18
  }
22
19
  var StreamingBoxParser = class extends Transform {
23
20
  constructor() {
@@ -108,12 +105,11 @@ const generateFragmentIndex = async (inputStream, startTimeOffsetMs, trackIdMapp
108
105
  const parser = new StreamingBoxParser();
109
106
  const chunks = [];
110
107
  let totalSize = 0;
111
- const dest = new Writable({ write(chunk, _encoding, callback) {
108
+ await pipeline(inputStream, parser, new Writable({ write(chunk, _encoding, callback) {
112
109
  chunks.push(chunk);
113
110
  totalSize += chunk.length;
114
111
  callback();
115
- } });
116
- await pipeline(inputStream, parser, dest);
112
+ } }));
117
113
  const fragments = parser.getFragments();
118
114
  if (totalSize === 0) return {};
119
115
  const completeData = Buffer.concat(chunks);
package/dist/md5.js CHANGED
@@ -23,8 +23,7 @@ async function md5Directory(directory, spinner) {
23
23
  return addDashesToUUID(hash.digest("hex"));
24
24
  }
25
25
  async function md5FilePath(filePath) {
26
- const readStream = createReadStream(filePath);
27
- return md5ReadStream(readStream);
26
+ return md5ReadStream(createReadStream(filePath));
28
27
  }
29
28
  function md5ReadStream(readStream) {
30
29
  return new Promise((resolve, reject) => {
@@ -24,8 +24,7 @@ const generateTrackFragmentIndexFromPath = async (absolutePath) => {
24
24
  if (stream.codec_type !== "audio" && stream.codec_type !== "video") continue;
25
25
  const trackId = streamIndex + 1;
26
26
  log(`Processing track ${trackId} (${stream.codec_type})`);
27
- const trackStream = probe.createTrackReadstream(streamIndex);
28
- const singleTrackIndexes = await generateFragmentIndex(trackStream, startTimeOffsetMs, { 0: trackId });
27
+ const singleTrackIndexes = await generateFragmentIndex(probe.createTrackReadstream(streamIndex), startTimeOffsetMs, { 0: trackId });
29
28
  Object.assign(trackFragmentIndexes, singleTrackIndexes);
30
29
  }
31
30
  return trackFragmentIndexes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@editframe/assets",
3
- "version": "0.21.0-beta.0",
3
+ "version": "0.23.6-beta.0",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -25,6 +25,7 @@
25
25
  "author": "",
26
26
  "license": "UNLICENSED",
27
27
  "dependencies": {
28
+ "@lit/context": "^1.1.6",
28
29
  "debug": "^4.3.5",
29
30
  "mediabunny": "^1.5.0",
30
31
  "ora": "^8.0.1",