mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Fix missing VideoSample.close() calls in CanvasSink conversion path
This commit is contained in:
+7
-4
@@ -57,7 +57,7 @@
|
||||
output,
|
||||
audio: (_, n) => ({
|
||||
discard: n > 1,
|
||||
codec: 'aac',
|
||||
//codec: 'opus',
|
||||
//codec: 'opus',
|
||||
/*
|
||||
process: (sample) => {
|
||||
@@ -73,7 +73,7 @@
|
||||
//numberOfChannels: 1,
|
||||
//sampleRate: 4000
|
||||
//discard: true
|
||||
forceTranscode: true,
|
||||
//forceTranscode: true,
|
||||
}),
|
||||
/*
|
||||
video: {
|
||||
@@ -100,6 +100,9 @@
|
||||
},
|
||||
*/
|
||||
video: () => ({
|
||||
width: 720,
|
||||
frameRate: 30,
|
||||
bitrate: Mediabunny.QUALITY_VERY_LOW,
|
||||
//discard: true,
|
||||
/*
|
||||
process: (sample) => {
|
||||
@@ -176,8 +179,8 @@
|
||||
}
|
||||
},
|
||||
trim: {
|
||||
//start: 0,
|
||||
//end: 10
|
||||
start: 0,
|
||||
end: 20
|
||||
},
|
||||
});
|
||||
console.log(conversion);
|
||||
|
||||
+2
-2
@@ -1043,6 +1043,7 @@ export class Conversion {
|
||||
duration: 1 / frameRate,
|
||||
});
|
||||
await this._registerVideoSample(track, trackOptions, source, sample);
|
||||
sample.close();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1079,12 +1080,11 @@ export class Conversion {
|
||||
duration: frameRate !== undefined ? 1 / frameRate : duration,
|
||||
});
|
||||
await this._registerVideoSample(track, trackOptions, source, sample);
|
||||
sample.close();
|
||||
|
||||
if (frameRate !== undefined) {
|
||||
lastCanvas = canvas;
|
||||
lastCanvasTimestamp = adjustedSampleTimestamp;
|
||||
} else {
|
||||
sample.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user