@eluvio/elv-client-js 4.0.79 → 4.0.81

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.
@@ -216,6 +216,18 @@ var LiveConf = /*#__PURE__*/function () {
216
216
 
217
217
  return seg;
218
218
  }
219
+
220
+ /*
221
+ * Calculate output timebase from the encoder (codec) timebase. The videoTimeBase parameter
222
+ * represents the encoder timebase. The format muxer will change it so it is greater than 10000.
223
+ */
224
+ }, {
225
+ key: "calcOutputTimebase",
226
+ value: function calcOutputTimebase(codecTimebase) {
227
+ var outputTimebase = codecTimebase;
228
+ while (outputTimebase < 10000) outputTimebase = outputTimebase * 2;
229
+ return outputTimebase;
230
+ }
219
231
  }, {
220
232
  key: "calcSegDurationMpegts",
221
233
  value: function calcSegDurationMpegts(_ref2) {
@@ -280,7 +292,9 @@ var LiveConf = /*#__PURE__*/function () {
280
292
  var seg = {};
281
293
  switch (frameRate) {
282
294
  case "24":
283
- seg.video = sourceTimescale * 30;
295
+ seg.videoTimeBase = 1536; // Output timebase: 12288
296
+ seg.videoFrameDurationTs = 512;
297
+ seg.video = this.calcOutputTimebase(seg.videoTimeBase) * 30;
284
298
  seg.keyint = 48;
285
299
  seg.duration = "30";
286
300
  break;
@@ -290,7 +304,9 @@ var LiveConf = /*#__PURE__*/function () {
290
304
  seg.duration = "30";
291
305
  break;
292
306
  case "30":
293
- seg.video = sourceTimescale * 30;
307
+ seg.videoTimeBase = 960; // Output timebase: 15360
308
+ seg.videoFrameDurationTs = 512;
309
+ seg.video = this.calcOutputTimebase(seg.videoTimeBase) * 30;
294
310
  seg.keyint = 60;
295
311
  seg.duration = "30";
296
312
  break;
@@ -300,7 +316,9 @@ var LiveConf = /*#__PURE__*/function () {
300
316
  seg.duration = "30.03";
301
317
  break;
302
318
  case "48":
303
- seg.video = sourceTimescale * 30;
319
+ seg.videoTimeBase = 1536; // Output timebase: 12288
320
+ seg.videoFrameDurationTs = 256;
321
+ seg.video = this.calcOutputTimebase(seg.videoTimeBase) * 30;
304
322
  seg.keyint = 96;
305
323
  seg.duration = "30";
306
324
  break;
@@ -310,7 +328,9 @@ var LiveConf = /*#__PURE__*/function () {
310
328
  seg.duration = "30";
311
329
  break;
312
330
  case "60":
313
- seg.video = sourceTimescale * 30;
331
+ seg.videoTimeBase = 960; // Output timebase: 15360
332
+ seg.videoFrameDurationTs = 256;
333
+ seg.video = this.calcOutputTimebase(seg.videoTimeBase) * 30;
314
334
  seg.keyint = 120;
315
335
  seg.duration = "30";
316
336
  break;
@@ -413,7 +433,9 @@ var LiveConf = /*#__PURE__*/function () {
413
433
  // Optional override output timebase and frame duration (ts)
414
434
  if (segDurations.videoTimeBase) {
415
435
  conf.live_recording.recording_config.recording_params.xc_params.video_time_base = segDurations.videoTimeBase;
416
- conf.live_recording.recording_config.recording_params.source_timescale = segDurations.videoTimeBase;
436
+
437
+ // Note 'source_timescale' needs to be set to the output timebase and is used by playout
438
+ conf.live_recording.recording_config.recording_params.source_timescale = this.calcOutputTimebase(segDurations.videoTimeBase);
417
439
  }
418
440
  if (segDurations.videoFrameDurationTs) {
419
441
  conf.live_recording.recording_config.recording_params.xc_params.video_frame_duration_ts = segDurations.videoFrameDurationTs;
@@ -1652,7 +1652,7 @@ exports.StreamConfig = /*#__PURE__*/function () {
1652
1652
  // Get node URI from user config
1653
1653
  hostName = userConfig.url.replace("udp://", "").replace("rtmp://", "").replace("srt://", "").split(":")[0];
1654
1654
  streamUrl = new URL(userConfig.url);
1655
- console.log("Retrieving nodes...");
1655
+ console.log("Retrieving nodes - matching", hostName);
1656
1656
  _context11.next = 21;
1657
1657
  return this.SpaceNodes({
1658
1658
  matchEndpoint: hostName