Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Return a JSON array of these objects, one per frame. Return ONLY the JSON array,

function buildChunks(keyframes: MediaKeyframe[], chunkSize: number, overlap: number): MediaKeyframe[][] {
const chunks: MediaKeyframe[][] = [];
const step = chunkSize - overlap;
const step = Math.max(1, chunkSize - overlap);
for (let i = 0; i < keyframes.length; i += step) {
chunks.push(keyframes.slice(i, i + chunkSize));
}
Expand Down Expand Up @@ -275,9 +275,9 @@ export async function run(
}

const analysisType = (input.analysis_type as string) || 'scene_description';
const batchSize = (input.batch_size as number) || 10;
const chunkSizeInput = (input.chunk_size as number) || 10;
const overlapInput = (input.overlap as number) || 2;
const batchSize = (input.batch_size as number) ?? 10;
const chunkSizeInput = (input.chunk_size as number) ?? 10;
Comment thread
alex-nork marked this conversation as resolved.
Comment thread
alex-nork marked this conversation as resolved.
const overlapInput = (input.overlap as number) ?? 2;

try {
// Check if all keyframes are already analyzed before calling the core function
Expand Down
Loading