@eluvio/elv-client-js 4.2.33 → 4.2.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eluvio/elv-client-js",
3
- "version": "4.2.33",
3
+ "version": "4.2.34",
4
4
  "description": "Javascript client for the Eluvio Content Fabric",
5
5
  "main": "src/index.js",
6
6
  "author": "Kevin Talmadge",
@@ -585,17 +585,22 @@ class LiveConf {
585
585
  customXcParams?.video_seg_duration_ts ?? segDurations.video;
586
586
  conf.live_recording.recording_config.recording_params.xc_params.force_keyint = segDurations.keyint;
587
587
 
588
- // Optional override output timebase and frame duration (ts)
589
- if(segDurations.videoTimeBase && R.isNil(customXcParams?.video_time_base)) {
590
- conf.live_recording.recording_config.recording_params.xc_params.video_time_base = segDurations.videoTimeBase;
591
-
592
- // Note 'source_timescale' needs to be set to the output timebase and is used by playout
593
- if(R.isNil(customRecordingParams?.source_timescale)) {
594
- conf.live_recording.recording_config.recording_params.source_timescale = this.calcOutputTimebase(segDurations.videoTimeBase);
588
+ // These must be recomputed from scratch on every (re)configuration to avoid stale values
589
+ if(R.isNil(customXcParams?.video_time_base)) {
590
+ if(segDurations.videoTimeBase) {
591
+ conf.live_recording.recording_config.recording_params.xc_params.video_time_base = segDurations.videoTimeBase;
592
+
593
+ // Note 'source_timescale' needs to be set to the output timebase and is used by playout
594
+ if(R.isNil(customRecordingParams?.source_timescale)) {
595
+ conf.live_recording.recording_config.recording_params.source_timescale = this.calcOutputTimebase(segDurations.videoTimeBase);
596
+ }
597
+ } else {
598
+ conf.live_recording.recording_config.recording_params.xc_params.video_time_base = null;
595
599
  }
596
600
  }
597
- if(segDurations.videoFrameDurationTs && R.isNil(customXcParams?.video_frame_duration_ts)) {
598
- conf.live_recording.recording_config.recording_params.xc_params.video_frame_duration_ts = segDurations.videoFrameDurationTs;
601
+ if(R.isNil(customXcParams?.video_frame_duration_ts)) {
602
+ conf.live_recording.recording_config.recording_params.xc_params.video_frame_duration_ts =
603
+ segDurations.videoFrameDurationTs || null;
599
604
  }
600
605
 
601
606
  const ladder_specs = customSettings.liveRecordingConfigProfile?.playout_config?.ladder_specs;
@@ -1518,6 +1518,34 @@ exports.StreamStartOrStopOrReset = async function({name, op}) {
1518
1518
  });
1519
1519
  } catch(error) {
1520
1520
  console.log("LRO Start (failed): ", error);
1521
+
1522
+ // Check for unsupported input conditions before returning
1523
+ // generic "LRO start failed - must create a stream first" error
1524
+ try {
1525
+ const configMeta = await this.ContentObjectMetadata({
1526
+ libraryId: status.libraryId,
1527
+ objectId: status.objectId,
1528
+ metadataSubtree: "live_recording_config",
1529
+ select: [
1530
+ "probe_info",
1531
+ "input_stream_info"
1532
+ ]
1533
+ });
1534
+
1535
+ const probeInfo = configMeta?.probe_info || configMeta?.input_stream_info;
1536
+ const unsupportedAudio = (probeInfo?.streams || [])
1537
+ .find(stream => stream.codec_type === "audio" && stream.sample_rate === 44100);
1538
+
1539
+ if(unsupportedAudio) {
1540
+ return {
1541
+ state: status.state,
1542
+ error: "Unsupported audio sample rate: 44.1 kHz. Only 48 kHz audio is supported."
1543
+ };
1544
+ }
1545
+ } catch(probeError) {
1546
+ console.error("Unable to check audio sample rate", probeError);
1547
+ }
1548
+
1521
1549
  return {
1522
1550
  state: status.state,
1523
1551
  error: "LRO start failed - must create a stream first"