@pictor-sdk/video-android 0.1.0 → 0.1.3

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/index.mjs CHANGED
@@ -1797,9 +1797,10 @@ function createMedia3VideoExporter(options) {
1797
1797
  );
1798
1798
  }
1799
1799
  const resources = overlayPlan.resources;
1800
+ const viaMedia3 = options.videoSpeedVia === "media3";
1800
1801
  const shards = plan.map((shard, index) => {
1801
1802
  const clip = playable[index];
1802
- const cadence = cadenceFor(shard.plan.frames);
1803
+ const cadence = viaMedia3 && clip.speed !== 1 ? null : cadenceFor(shard.plan.frames);
1803
1804
  return {
1804
1805
  uri: uris[index],
1805
1806
  startMs: Math.round(clip.sourceIn / 1e3),
@@ -1818,11 +1819,19 @@ function createMedia3VideoExporter(options) {
1818
1819
  What matters is that the *source's* audio never enters this pipeline:
1819
1820
  a per-shard audio track has to be re-encoded to concatenate, which is
1820
1821
  what put a second generation on everything the user hears.
1822
+
1823
+ `ExportGate` notes that `setRemoveAudio` beside a speed change is a
1824
+ combination Media3 warns about, and that was tried as a candidate
1825
+ fix for the high-rate export stall: giving the re-timing the real
1826
+ stream instead of silence. It made no difference to the fault — the
1827
+ encoder stopped at exactly the same place — so the change was
1828
+ reverted rather than kept for a benefit that could not be shown.
1829
+ See `docs/research/export-speed-stall.md`.
1821
1830
  */
1822
1831
  forceAudioTrack: true,
1823
1832
  removeAudio: true,
1824
- emitsPerInput: cadence.emitsPerInput,
1825
- outputPtsUs: cadence.outputPtsUs,
1833
+ emitsPerInput: cadence?.emitsPerInput,
1834
+ outputPtsUs: cadence?.outputPtsUs,
1826
1835
  spanUs: Math.round(shard.plan.frameCount * 1e6 / fps)
1827
1836
  };
1828
1837
  });