Fix incorrect VideoSample dimensions

This commit is contained in:
Vanilagy
2025-09-01 11:39:53 +02:00
parent 3dec3ab12b
commit 718216bcc9
2 changed files with 6 additions and 3 deletions
+5 -2
View File
@@ -143,8 +143,11 @@ export class VideoSample {
this._data = data;
this.format = data.format;
this.codedWidth = data.codedWidth;
this.codedHeight = data.codedHeight;
// Copying the display dimensions here, assuming no innate VideoFrame rotation
this.codedWidth = data.displayWidth;
this.codedHeight = data.displayHeight;
// The VideoFrame's rotation is ignored here. It's still a new field, and I'm not sure of any application
// where the browser makes use of it. If a case gets found, I'll add it.
this.rotation = init?.rotation ?? 0;
this.timestamp = init?.timestamp ?? data.timestamp / 1e6;
this.duration = init?.duration ?? (data.duration ?? 0) / 1e6;
+1 -1
View File
@@ -491,7 +491,7 @@ export class FilePathSource extends Source {
this._streamSource = new StreamSource({
getSize: async () => {
const FS_MODULE_NAME = 'node:fs/promises';
const fs = await import(FS_MODULE_NAME) as typeof import('node:fs/promises');
const fs = await import(/* @vite-ignore */ FS_MODULE_NAME) as typeof import('node:fs/promises');
fileHandle = await fs.open(filePath, 'r');
const stats = await fileHandle.stat();