The VS Code of video editing, built for agents.
TypeScript
Update transcode functions to enhance type handling and adjust token constants
konstantin-paulus2f09a98b941b
diff --git a/apps/web/src/components/engine/utils/transcode.ts b/apps/web/src/components/engine/utils/transcode.tsindex 4d6deeb9..a9f6041c 100644--- a/apps/web/src/components/engine/utils/transcode.ts+++ b/apps/web/src/components/engine/utils/transcode.ts@@ -32,7 +32,7 @@ export async function transcodeForTranscription(asset: Asset): Promise<File> {}}-export async function transcodeForAnalysis(asset: Asset, window?: TimeWindow & { stripVideo?: boolean }) {+export async function transcodeForAnalysis(asset: VideoAsset | AudioAsset, window?: TimeWindow & { stripVideo?: boolean }) {const blob = await getAssetFile(asset);const hasWindow = window?.start !== undefined || window?.end !== undefined;@@ -76,9 +76,9 @@ export async function transcodeForAnalysis(asset: Asset, window?: TimeWindow & {}const PATCH_SIZE = 28;-const MAX_WIDTH_IN_TOKENS = 52; // 92+const MAX_WIDTH_IN_TOKENS = 64; // 92const MAX_HEIGHT_IN_TOKENS = 52;-const THUMBNAIL_HEIGHT_IN_TOKENS = 5;+const THUMBNAIL_HEIGHT_IN_TOKENS = 7;const RULER_HEIGHT_IN_TOKENS = 1;const AUDIO_WAVEFORM_HEIGHT_IN_TOKENS = 6;const AUDIO_COLUMN_WIDTH_IN_TOKENS = 6;@@ -405,18 +405,6 @@ function drawRuler(ctx: CanvasRenderingContext2D, layout: RulerLayout) {const paddingTop = 2;const tickHeight = Math.round(rulerHeight * 0.4);- const rows = Math.ceil(cells / columns);- const fullWidth = columns * columnWidthInPixels;- ctx.strokeStyle = 'rgba(255, 64, 64, 1)';- ctx.lineWidth = 2;- for (let row = 1; row < rows; row++) {- const y = row * rowHeightInPixels + 0.5;- ctx.beginPath();- ctx.moveTo(0, y);- ctx.lineTo(fullWidth, y);- ctx.stroke();- }-ctx.fillStyle = '#FFF';ctx.strokeStyle = '#FFF';ctx.lineWidth = 2;