Add support for live HLS streams, add playlist refresh logic, add live input tracks

This commit is contained in:
Vanilagy
2026-03-12 15:54:19 +01:00
parent ff523c01c8
commit e8df451bf5
23 changed files with 22399 additions and 417 deletions
+15 -1
View File
@@ -821,7 +821,13 @@ export class Conversion {
if (this.onProgress) {
// Compute duration using only the utilized tracks
const durationPromises = this.utilizedTracks.map(x => x.computeDuration());
const durationPromises = this.utilizedTracks.map(async (track) => {
if (await track.isLive()) {
return Infinity; // Upper bound (assuming no universe heat death)
}
return track.computeDuration();
});
const duration = Math.max(0, ...await Promise.all(durationPromises));
this._computeProgress = true;
@@ -882,6 +888,10 @@ export class Conversion {
/** @internal */
async _processVideoTrack(track: InputVideoTrack, trackOptions: ConversionVideoOptions) {
if (!track.isHydrated) {
await track.hydrate();
}
const sourceCodec = track.codec;
if (!sourceCodec) {
this.discardedTracks.push({
@@ -1334,6 +1344,10 @@ export class Conversion {
/** @internal */
async _processAudioTrack(track: InputAudioTrack, trackOptions: ConversionAudioOptions) {
if (!track.isHydrated) {
await track.hydrate();
}
const sourceCodec = track.codec;
if (!sourceCodec) {
this.discardedTracks.push({