Skip to content

Create polished demo videos without editing skills. Mac/Windows/Linux

feat: add blur annotation and Whisper model selection for autocaption

Mahdy Arief25ca604d8822
diff --git a/.gitignore b/.gitignore
index 1034ceaf..d3a2eb14 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,8 @@ vite.config.d.ts
# Native capture build artifacts
electron/native/wgc-capture/build/
electron/native/cursor-monitor/build/
+
+# Local build tools and caches
+.cache/
+.cmake_ext/
+ebcache/
diff --git a/electron/electron-env.d.ts b/electron/electron-env.d.ts
index 1f570cd8..fba61878 100644
--- a/electron/electron-env.d.ts
+++ b/electron/electron-env.d.ts
@@ -147,23 +147,28 @@ interface Window {
canceled?: boolean;
error?: string;
}>;
- getWhisperSmallModelStatus: () => Promise<{
+ getWhisperModelStatus: (
+ modelName: string,
+ ) => Promise<{
success: boolean;
exists: boolean;
path?: string | null;
error?: string;
}>;
- downloadWhisperSmallModel: () => Promise<{
+ downloadWhisperModel: (
+ modelName: string,
+ ) => Promise<{
success: boolean;
path?: string;
alreadyDownloaded?: boolean;
error?: string;
}>;
- deleteWhisperSmallModel: () => Promise<{ success: boolean; error?: string }>;
- onWhisperSmallModelDownloadProgress: (
+ deleteWhisperModel: (modelName: string) => Promise<{ success: boolean; error?: string }>;
+ onWhisperModelDownloadProgress: (
callback: (state: {
status: "idle" | "downloading" | "downloaded" | "error";
progress: number;
+ model: string;
path?: string | null;
error?: string;
}) => void,
diff --git a/electron/ipc/handlers.ts b/electron/ipc/handlers.ts
index e422fc47..9eccdde2 100644
--- a/electron/ipc/handlers.ts
+++ b/electron/ipc/handlers.ts
@@ -30,9 +30,48 @@ const AUTO_RECORDING_RETENTION_COUNT = 20
const AUTO_RECORDING_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1000
const ALLOW_RECORDLY_WINDOW_CAPTURE = Boolean(process.env['VITE_DEV_SERVER_URL'])
const RECORDING_SESSION_MANIFEST_SUFFIX = '.recordly-session.json'
-const WHISPER_MODEL_DOWNLOAD_URL = 'https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin'
-const WHISPER_MODEL_DIR = path.join(app.getPath('userData'), 'whisper')
-const WHISPER_SMALL_MODEL_PATH = path.join(WHISPER_MODEL_DIR, 'ggml-small.bin')
+const WHISPER_MODEL_DIR = path.join(app.getPath("userData"), "whisper");
+
+const WHISPER_MODELS = {
+ tiny: {
+ label: "Tiny",
+ size: "75 MB",
+ filename: "ggml-tiny.bin",
+ url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin",
+ },
+ base: {
+ label: "Base",
+ size: "142 MB",
+ filename: "ggml-base.bin",
+ url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-base.bin",
+ },
+ small: {
+ label: "Small",
+ size: "466 MB",
+ filename: "ggml-small.bin",
+ url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin",
+ },
+ medium: {
+ label: "Medium",
+ size: "1.5 GB",
+ filename: "ggml-medium.bin",
+ url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-medium.bin",
+ },
+ large: {
+ label: "Large (v3)",
+ size: "2.9 GB",
+ filename: "ggml-large-v3.bin",
+ url: "https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-large-v3.bin",
+ },
+} as const;
+
+function getWhisperModelPath(modelName: string) {
+ const model = WHISPER_MODELS[modelName as keyof typeof WHISPER_MODELS];
+ if (!model) {
+ throw new Error(`Unsupported Whisper model: ${modelName}`);
+ }
+ return path.join(WHISPER_MODEL_DIR, model.filename);
+}
function getAssetRootPath() {
if (app.isPackaged) {
@@ -961,27 +1000,34 @@ function getFfmpegBinaryPath() {
}
function sendWhisperModelDownloadProgress(
- webContents: Electron.WebContents,
- payload: { status: 'idle' | 'downloading' | 'downloaded' | 'error'; progress: number; path?: string | null; error?: string },
+ webContents: Electron.WebContents,
+ payload: {
+ status: "idle" | "downloading" | "downloaded" | "error";
+ progress: number;
+ model: string;
+ path?: string | null;
+ error?: string;
+ },
) {
- webContents.send('whisper-small-model-download-progress', payload)
-}
-
-async function getWhisperSmallModelStatus() {
- try {
- await fs.access(WHISPER_SMALL_MODEL_PATH, fsConstants.R_OK)
- return {
- success: true,
- exists: true,
- path: WHISPER_SMALL_MODEL_PATH,
- }
- } catch {
- return {
- success: true,
- exists: false,
- path: null,
- }
- }
+ webContents.send("whisper-model-download-progress", payload);
+}
+
+async function getWhisperModelStatus(_event: any, modelName: string) {
+ try {
+ const modelPath = getWhisperModelPath(modelName);
+ await fs.access(modelPath, fsConstants.R_OK);
+ return {
+ success: true,
+ exists: true,
+ path: modelPath,
+ };
+ } catch {
+ return {
+ success: true,
+ exists: false,
+ path: null,
+ };
+ }
}
function downloadFileWithProgress(
@@ -1048,46 +1094,60 @@ function downloadFileWithProgress(
return request(url)
}
-async function downloadWhisperSmallModel(webContents: Electron.WebContents) {
- await fs.mkdir(WHISPER_MODEL_DIR, { recursive: true })
- const tempPath = `${WHISPER_SMALL_MODEL_PATH}.download`
-
- sendWhisperModelDownloadProgress(webContents, {
- status: 'downloading',
- progress: 0,
- path: null,
- })
-
- try {
- await fs.rm(tempPath, { force: true })
- await downloadFileWithProgress(WHISPER_MODEL_DOWNLOAD_URL, tempPath, (progress) => {
- sendWhisperModelDownloadProgress(webContents, {
- status: 'downloading',
- progress,
- path: null,
- })
- })
- await fs.rename(tempPath, WHISPER_SMALL_MODEL_PATH)
- sendWhisperModelDownloadProgress(webContents, {
- status: 'downloaded',
- progress: 100,
- path: WHISPER_SMALL_MODEL_PATH,
- })
- return WHISPER_SMALL_MODEL_PATH
- } catch (error) {
- await fs.rm(tempPath, { force: true }).catch(() => undefined)
- sendWhisperModelDownloadProgress(webContents, {
- status: 'error',
- progress: 0,
- path: null,
- error: String(error),
- })
- throw error
- }
-}
-
-async function deleteWhisperSmallModel() {
- await fs.rm(WHISPER_SMALL_MODEL_PATH, { force: true })
+async function downloadWhisperModel(
+ webContents: Electron.WebContents,
+ modelName: string,
+) {
+ const model = WHISPER_MODELS[modelName as keyof typeof WHISPER_MODELS];
+ if (!model) {
+ throw new Error(`Unsupported Whisper model: ${modelName}`);
+ }
+
+ await fs.mkdir(WHISPER_MODEL_DIR, { recursive: true });
+ const modelPath = getWhisperModelPath(modelName);
+ const tempPath = `${modelPath}.download`;
+
+ sendWhisperModelDownloadProgress(webContents, {
+ status: "downloading",
+ progress: 0,
+ model: modelName,
+ path: null,
+ });
+
+ try {
+ await fs.rm(tempPath, { force: true });
+ await downloadFileWithProgress(model.url, tempPath, (progress) => {
+ sendWhisperModelDownloadProgress(webContents, {
+ status: "downloading",
+ progress,
+ model: modelName,
+ path: null,
+ });
+ });
+ await fs.rename(tempPath, modelPath);
+ sendWhisperModelDownloadProgress(webContents, {
+ status: "downloaded",
+ progress: 100,
+ model: modelName,
+ path: modelPath,
+ });
+ return modelPath;
+ } catch (error) {
+ await fs.rm(tempPath, { force: true }).catch(() => undefined);
+ sendWhisperModelDownloadProgress(webContents, {
+ status: "error",
+ progress: 0,
+ model: modelName,
+ path: null,
+ error: String(error),
+ });
+ throw error;
+ }
+}
+
+async function deleteWhisperModel(_event: any, modelName: string) {
+ const modelPath = getWhisperModelPath(modelName);
+ await fs.rm(modelPath, { force: true });
}
function parseSrtTimestamp(value: string) {
@@ -3975,45 +4035,47 @@ body{background:transparent;overflow:hidden;width:100vw;height:100vh}
}
})
- ipcMain.handle('get-whisper-small-model-status', async () => {
+ ipcMain.handle('get-whisper-model-status', async (event, modelName: string) => {
try {
- return await getWhisperSmallModelStatus()
+ return await getWhisperModelStatus(event, modelName)
} catch (error) {
return { success: false, exists: false, path: null, error: String(error) }
}
})
- ipcMain.handle('download-whisper-small-model', async (event) => {
+ ipcMain.handle('download-whisper-model', async (event, modelName: string) => {
try {
- const existing = await getWhisperSmallModelStatus()
+ const existing = await getWhisperModelStatus(event, modelName)
if (existing.exists) {
sendWhisperModelDownloadProgress(event.sender, {
status: 'downloaded',
progress: 100,
+ model: modelName,
path: existing.path,
})
return { success: true, path: existing.path, alreadyDownloaded: true }
}
- const modelPath = await downloadWhisperSmallModel(event.sender)
+ const modelPath = await downloadWhisperModel(event.sender, modelName)
return { success: true, path: modelPath }
} catch (error) {
- console.error('Failed to download Whisper small model:', error)
+ console.error(`Failed to download Whisper model ${modelName}:`, error)
return { success: false, error: String(error) }
}
})
- ipcMain.handle('delete-whisper-small-model', async (event) => {
+ ipcMain.handle('delete-whisper-model', async (event, modelName: string) => {
try {
- await deleteWhisperSmallModel()
+ await deleteWhisperModel(event, modelName)
sendWhisperModelDownloadProgress(event.sender, {
status: 'idle',
progress: 0,
+ model: modelName,
path: null,
})
return { success: true }
} catch (error) {
- console.error('Failed to delete Whisper small model:', error)
+ console.error(`Failed to delete Whisper model ${modelName}:`, error)
return { success: false, error: String(error) }
}
})
diff --git a/electron/native/bin/win32-x64/whisper-bench.exe b/electron/native/bin/win32-x64/whisper-bench.exe
new file mode 100644
index 00000000..0fd3aee9
Binary files /dev/null and b/electron/native/bin/win32-x64/whisper-bench.exe differ
diff --git a/electron/native/bin/win32-x64/whisper-cli.exe b/electron/native/bin/win32-x64/whisper-cli.exe
new file mode 100644
index 00000000..b8d9a673
Binary files /dev/null and b/electron/native/bin/win32-x64/whisper-cli.exe differ
diff --git a/electron/native/bin/win32-x64/whisper-quantize.exe b/electron/native/bin/win32-x64/whisper-quantize.exe
new file mode 100644
index 00000000..2db4102d
Binary files /dev/null and b/electron/native/bin/win32-x64/whisper-quantize.exe differ
diff --git a/electron/native/bin/win32-x64/whisper-runtime.json b/electron/native/bin/win32-x64/whisper-runtime.json
new file mode 100644
index 00000000..40343aa8
--- /dev/null
+++ b/electron/native/bin/win32-x64/whisper-runtime.json
@@ -0,0 +1,6 @@
+{
+ "version": "v1.8.4",
+ "platform": "win32",
+ "arch": "x64",
+ "binary": "whisper-cli.exe"
+}
\ No newline at end of file
diff --git a/electron/native/bin/win32-x64/whisper-server.exe b/electron/native/bin/win32-x64/whisper-server.exe
new file mode 100644
index 00000000..4615dfbf
Binary files /dev/null and b/electron/native/bin/win32-x64/whisper-server.exe differ
diff --git a/electron/native/bin/win32-x64/whisper-vad-speech-segments.exe b/electron/native/bin/win32-x64/whisper-vad-speech-segments.exe
new file mode 100644
index 00000000..ea02c8aa
Binary files /dev/null and b/electron/native/bin/win32-x64/whisper-vad-speech-segments.exe differ
diff --git a/electron/preload.ts b/electron/preload.ts
index 638511d0..5fed6b06 100644
--- a/electron/preload.ts
+++ b/electron/preload.ts
@@ -164,24 +164,36 @@ contextBridge.exposeInMainWorld("electronAPI", {
openWhisperModelPicker: () => {
return ipcRenderer.invoke("open-whisper-model-picker");
},
- getWhisperSmallModelStatus: () => {
- return ipcRenderer.invoke("get-whisper-small-model-status");
- },
- downloadWhisperSmallModel: () => {
- return ipcRenderer.invoke("download-whisper-small-model");
- },
- deleteWhisperSmallModel: () => {
- return ipcRenderer.invoke("delete-whisper-small-model");
- },
- onWhisperSmallModelDownloadProgress: (
- callback: (state: { status: "idle" | "downloading" | "downloaded" | "error"; progress: number; path?: string | null; error?: string }) => void,
+ getWhisperModelStatus: (modelName: string) => {
+ return ipcRenderer.invoke("get-whisper-model-status", modelName);
+ },
+ downloadWhisperModel: (modelName: string) => {
+ return ipcRenderer.invoke("download-whisper-model", modelName);
+ },
+ deleteWhisperModel: (modelName: string) => {
+ return ipcRenderer.invoke("delete-whisper-model", modelName);
+ },
+ onWhisperModelDownloadProgress: (
+ callback: (state: {
+ status: "idle" | "downloading" | "downloaded" | "error";
+ progress: number;
+ model: string;
+ path?: string | null;
+ error?: string;
+ }) => void,
) => {
const listener = (
_event: Electron.IpcRendererEvent,
- payload: { status: "idle" | "downloading" | "downloaded" | "error"; progress: number; path?: string | null; error?: string },
+ payload: {
+ status: "idle" | "downloading" | "downloaded" | "error";
+ progress: number;
+ model: string;
+ path?: string | null;
+ error?: string;
+ },
) => callback(payload);
- ipcRenderer.on("whisper-small-model-download-progress", listener);
- return () => ipcRenderer.removeListener("whisper-small-model-download-progress", listener);
+ ipcRenderer.on("whisper-model-download-progress", listener);
+ return () => ipcRenderer.removeListener("whisper-model-download-progress", listener);
},
generateAutoCaptions: (options: {
videoPath: string;
diff --git a/scripts/build-cursor-monitor.mjs b/scripts/build-cursor-monitor.mjs
index 387d528f..03b0c9d6 100644
--- a/scripts/build-cursor-monitor.mjs
+++ b/scripts/build-cursor-monitor.mjs
@@ -25,6 +25,12 @@ function findCmake() {
// not on PATH
}
+ // Local .cmake_ext path
+ const localCmake = path.join(projectRoot, ".cmake_ext", "cmake-4.3.0-windows-x86_64", "bin", "cmake.exe");
+ if (existsSync(localCmake)) {
+ return `"${localCmake}"`;
+ }
+
// VS 2022 bundled CMake
const vsEditions = ["Community", "Professional", "Enterprise", "BuildTools"];
for (const edition of vsEditions) {
diff --git a/scripts/build-whisper-runtime.mjs b/scripts/build-whisper-runtime.mjs
index 63830769..bd720d28 100644
--- a/scripts/build-whisper-runtime.mjs
+++ b/scripts/build-whisper-runtime.mjs
@@ -95,6 +95,12 @@ function findCmake() {
}
if (process.platform === "win32") {
+ // Local .cmake_ext path
+ const localCmake = path.join(projectRoot, ".cmake_ext", "cmake-4.3.0-windows-x86_64", "bin", "cmake.exe");
+ if (existsSync(localCmake)) {
+ return localCmake;
+ }
+
const vsEditions = ["Community", "Professional", "Enterprise", "BuildTools"];
for (const edition of vsEditions) {
const cmakePath = path.join(
@@ -194,7 +200,7 @@ async function ensureSourceTree() {
}
ensureTarAvailable();
- execFileSync("tar", ["-xzf", archivePath, "-C", extractRoot], { stdio: "inherit" });
+ execFileSync("tar", ["-xzf", path.relative(projectRoot, archivePath), "-C", path.relative(projectRoot, extractRoot)], { stdio: "inherit" });
if (!existsSync(path.join(extractedSourceDir, "CMakeLists.txt"))) {
throw new Error(
diff --git a/scripts/build-windows-capture.mjs b/scripts/build-windows-capture.mjs
index 8af1ac9a..32ee91b2 100644
--- a/scripts/build-windows-capture.mjs
+++ b/scripts/build-windows-capture.mjs
@@ -25,6 +25,12 @@ function findCmake() {
// not on PATH
}
+ // Local .cmake_ext path
+ const localCmake = path.join(projectRoot, '.cmake_ext', 'cmake-4.3.0-windows-x86_64', 'bin', 'cmake.exe');
+ if (existsSync(localCmake)) {
+ return `"${localCmake}"`;
+ }
+
// VS 2022 bundled CMake
const vsEditions = ['Community', 'Professional', 'Enterprise', 'BuildTools'];
for (const edition of vsEditions) {
diff --git a/src/components/video-editor/AnnotationOverlay.tsx b/src/components/video-editor/AnnotationOverlay.tsx
index 3260a542..921908a8 100644
--- a/src/components/video-editor/AnnotationOverlay.tsx
+++ b/src/components/video-editor/AnnotationOverlay.tsx
@@ -111,6 +111,17 @@ export function AnnotationOverlay({
</div>
);
+ case 'blur':
+ return (
+ <div
+ className="w-full h-full rounded-lg backdrop-blur-md"
+ style={{
+ backdropFilter: `blur(${annotation.blurIntensity ?? 12}px)`,
+ WebkitBackdropFilter: `blur(${annotation.blurIntensity ?? 12}px)`
+ }}
+ />
+ );
+
default:
return null;
}
@@ -208,6 +219,7 @@ export function AnnotationOverlay({
annotation.type === 'text' && "bg-transparent",
annotation.type === 'image' && "bg-transparent",
annotation.type === 'figure' && "bg-transparent",
+ annotation.type === 'blur' && "bg-transparent",
isSelected && "shadow-lg"
)}
>
diff --git a/src/components/video-editor/AnnotationSettingsPanel.tsx b/src/components/video-editor/AnnotationSettingsPanel.tsx
index 2cddf970..b24cd228 100644
--- a/src/components/video-editor/AnnotationSettingsPanel.tsx
+++ b/src/components/video-editor/AnnotationSettingsPanel.tsx
@@ -1,10 +1,10 @@
import { useRef, useState, useEffect, useMemo } from "react";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Button } from "@/components/ui/button";
-import { Trash2, Type, Image as ImageIcon, Upload, Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight, ChevronDown, Info } from "lucide-react";
+import { Trash2, Type, Image as ImageIcon, Upload, Bold, Italic, Underline, AlignLeft, AlignCenter, AlignRight, ChevronDown, Info, Droplets } from "lucide-react";
import { toast } from "sonner";
import Block from '@uiw/react-color-block';
-import type { AnnotationRegion, AnnotationType, ArrowDirection, FigureData } from "./types";
+import { DEFAULT_BLUR_INTENSITY, type AnnotationRegion, type AnnotationType, type ArrowDirection, type FigureData } from "./types";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
@@ -21,6 +21,7 @@ interface AnnotationSettingsPanelProps {
onTypeChange: (type: AnnotationType) => void;
onStyleChange: (style: Partial<AnnotationRegion['style']>) => void;
onFigureDataChange?: (figureData: FigureData) => void;
+ onBlurIntensityChange?: (intensity: number) => void;
onDelete: () => void;
}
@@ -43,6 +44,7 @@ export function AnnotationSettingsPanel({
onTypeChange,
onStyleChange,
onFigureDataChange,
+ onBlurIntensityChange,
onDelete,
}: AnnotationSettingsPanelProps) {
const t = useScopedT('editor');
@@ -128,7 +130,7 @@ export function AnnotationSettingsPanel({
{/* Type Selector */}
<Tabs value={annotation.type} onValueChange={(value) => onTypeChange(value as AnnotationType)} className="mb-6">
- <TabsList className="mb-4 bg-white/5 border border-white/5 p-1 w-full grid grid-cols-3 h-auto rounded-xl">
+ <TabsList className="mb-4 bg-white/5 border border-white/5 p-1 w-full grid grid-cols-4 h-auto rounded-xl">
<TabsTrigger value="text" className="data-[state=active]:bg-[#2563EB] data-[state=active]:text-white text-slate-400 py-2 rounded-lg transition-all gap-2">
<Type className="w-4 h-4" />
{t('annotations.text')}
@@ -143,8 +145,32 @@ export function AnnotationSettingsPanel({
</svg>
{t('annotations.arrow')}
</TabsTrigger>
+ <TabsTrigger value="blur" className="data-[state=active]:bg-[#2563EB] data-[state=active]:text-white text-slate-400 py-2 rounded-lg transition-all gap-2">
+ <Droplets className="w-4 h-4" />
+ Blur
+ </TabsTrigger>
</TabsList>
+ <TabsContent value="blur" className="mt-0 space-y-4">
+ <div>
+ <label className="text-xs font-medium text-slate-200 mb-2 block">
+ Blur Intensity: {annotation.blurIntensity ?? DEFAULT_BLUR_INTENSITY}px
+ </label>
+ <Slider
+ value={[annotation.blurIntensity ?? DEFAULT_BLUR_INTENSITY]}
+ onValueChange={([value]) => {
+ if (onBlurIntensityChange) {
+ onBlurIntensityChange(value);
+ }
+ }}
+ min={2}
+ max={50}
+ step={1}
+ className="w-full"
+ />
+ </div>
+ </TabsContent>
+
{/* Text Content */}
<TabsContent value="text" className="mt-0 space-y-4">
<div>
diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx
index 061420d0..e5d1882c 100644
--- a/src/components/video-editor/SettingsPanel.tsx
+++ b/src/components/video-editor/SettingsPanel.tsx
@@ -203,8 +203,12 @@ interface SettingsPanelProps {
onAnnotationTypeChange?: (id: string, type: AnnotationType) => void;
onAnnotationStyleChange?: (id: string, style: Partial<AnnotationRegion["style"]>) => void;
onAnnotationFigureDataChange?: (id: string, figureData: FigureData) => void;
+ onAnnotationBlurIntensityChange?: (id: string, blurIntensity: number) => void;
onAnnotationDelete?: (id: string) => void;
+ currentTime?: number;
+ onSeek?: (time: number) => void;
autoCaptions?: CaptionCue[];
+ onAutoCaptionsChange?: (captions: CaptionCue[]) => void;
autoCaptionSettings?: AutoCaptionSettings;
whisperExecutablePath?: string | null;
whisperModelPath?: string | null;
@@ -216,8 +220,8 @@ interface SettingsPanelProps {
onPickWhisperModel?: () => void;
onGenerateAutoCaptions?: () => void;
onClearAutoCaptions?: () => void;
- onDownloadWhisperSmallModel?: () => void;
- onDeleteWhisperSmallModel?: () => void;
+ onDownloadWhisperModel?: () => void;
+ onDeleteWhisperModel?: () => void;
selectedSpeedId?: string | null;
selectedSpeedValue?: PlaybackSpeed | null;
onSpeedChange?: (speed: PlaybackSpeed) => void;
@@ -268,8 +272,23 @@ const CAPTION_LANGUAGE_OPTIONS = [
{ value: "zh", label: "Chinese" },
{ value: "ja", label: "Japanese" },
{ value: "ko", label: "Korean" },
+ { value: "id", label: "Indonesian" },
] as const;
+export type WhisperModelInfo = {
+ value: "tiny" | "base" | "small" | "medium" | "large";
+ label: string;
+ size: string;
+};
+
+const WHISPER_MODEL_OPTIONS: WhisperModelInfo[] = [
+ { value: "tiny", label: "Tiny", size: "75 MB" },
+ { value: "base", label: "Base", size: "142 MB" },
+ { value: "small", label: "Small", size: "466 MB" },
+ { value: "medium", label: "Medium", size: "1.5 GB" },
+ { value: "large", label: "Large (v3)", size: "2.9 GB" },
+];
+
function loadPreviewImage(url: string) {
return new Promise<HTMLImageElement>((resolve, reject) => {
const image = new Image();
@@ -505,8 +524,12 @@ export function SettingsPanel({
onAnnotationTypeChange,
onAnnotationStyleChange,
onAnnotationFigureDataChange,
+ onAnnotationBlurIntensityChange,
onAnnotationDelete,
+ currentTime = 0,
+ onSeek,
autoCaptions = [],
+ onAutoCaptionsChange,
autoCaptionSettings = DEFAULT_AUTO_CAPTION_SETTINGS,
whisperModelPath,
whisperModelDownloadStatus = "idle",
@@ -516,8 +539,8 @@ export function SettingsPanel({
onPickWhisperModel,
onGenerateAutoCaptions,
onClearAutoCaptions,
- onDownloadWhisperSmallModel,
- onDeleteWhisperSmallModel,
+ onDownloadWhisperModel,
+ onDeleteWhisperModel,
selectedSpeedId,
selectedSpeedValue,
onSpeedChange,
@@ -1139,6 +1162,11 @@ export function SettingsPanel({
? (figureData) => onAnnotationFigureDataChange(selectedAnnotation.id, figureData)
: undefined
}
+ onBlurIntensityChange={
+ onAnnotationBlurIntensityChange
+ ? (intensity) => onAnnotationBlurIntensityChange(selectedAnnotation.id, intensity)
+ : undefined
+ }
onDelete={() => onAnnotationDelete(selectedAnnotation.id)}
/>
);
@@ -1365,6 +1393,29 @@ export function SettingsPanel({
</SelectContent>
</Select>
</div>
+ <div className="flex items-center justify-between gap-3">
+ <div className="text-sm font-medium text-slate-200">
+ Model
+ </div>
+ <Select
+ value={autoCaptionSettings.selectedModel || "small"}
+ onValueChange={(value) => updateAutoCaptionSettings({ selectedModel: value as any })}
+ >
+ <SelectTrigger className="h-10 w-[180px] rounded-xl border-white/10 bg-white/5 text-sm text-slate-200 hover:bg-white/10">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent className="border-white/10 bg-[#1a1a1f] text-slate-200">
+ {WHISPER_MODEL_OPTIONS.map((option) => (
+ <SelectItem key={option.value} value={option.value}>
+ <div className="flex items-center justify-between w-full gap-4">
+ <span>{option.label}</span>
+ <span className="text-[10px] text-slate-500">{option.size}</span>
+ </div>
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ </div>
<div className="flex flex-wrap items-center gap-2">
<div className="grid w-full grid-cols-2 gap-2">
{whisperModelDownloadStatus === "downloading" ? (
@@ -1380,7 +1431,7 @@ export function SettingsPanel({
<Button
type="button"
variant="outline"
- onClick={onDeleteWhisperSmallModel}
+ onClick={onDeleteWhisperModel}
className="h-10 w-full rounded-xl border-white/10 bg-white/5 px-4 text-sm text-slate-200 hover:bg-white/10 hover:text-white"
>
{tSettings("captions.deleteModel", "Delete Model")}
@@ -1388,7 +1439,7 @@ export function SettingsPanel({
) : (
<Button
type="button"
- onClick={onDownloadWhisperSmallModel}
+ onClick={onDownloadWhisperModel}
className="h-10 w-full rounded-xl bg-[#2563EB] px-4 text-sm font-medium text-white hover:bg-[#2563EB]/90"
>
{tSettings("captions.downloadModel", "Download Model")}
@@ -1418,6 +1469,75 @@ export function SettingsPanel({
? tSettings("captions.regenerateFull", "Regenerate Captions")
: tSettings("captions.generateFull", "Generate Captions")}
</Button>
+
+ {autoCaptions.length > 0 && (
+ <div className="mt-4 flex flex-col gap-2">
+ <div className="flex items-center justify-between px-1">
+ <span className="text-[10px] font-semibold uppercase tracking-wider text-slate-500">
+ Edit Cues ({autoCaptions.length})
+ </span>
+ </div>
+ <div className="max-h-[300px] overflow-y-auto rounded-xl border border-white/5 bg-black/20 p-1 subtle-scrollbar">
+ <div className="flex flex-col gap-1">
+ {autoCaptions.map((cue, index) => {
+ const isActive = currentTime >= cue.startMs / 1000 && currentTime <= cue.endMs / 1000;
+ return (
+ <div
+ key={cue.id || index}
+ className={cn(
+ "group flex flex-col gap-1 rounded-lg p-2 transition-colors",
+ isActive ? "bg-white/10" : "hover:bg-white/5"
+ )}
+ >
+ <div className="flex items-center justify-between">
+ <button
+ type="button"
+ onClick={() => onSeek?.(cue.startMs / 1000)}
+ className="text-[10px] font-medium text-slate-500 hover:text-[#2563EB]"
+ >
+ {(cue.startMs / 1000).toFixed(2)}s – {(cue.endMs / 1000).toFixed(2)}s
+ </button>
+ <button
+ type="button"
+ onClick={() => {
+ const newCaptions = [...autoCaptions];
+ newCaptions.splice(index, 1);
+ onAutoCaptionsChange?.(newCaptions);
+ }}
+ className="opacity-0 group-hover:opacity-100 transition-opacity p-1 text-slate-500 hover:text-red-400"
+ >
+ <Trash2 className="h-3 w-3" />
+ </button>
+ </div>
+ <textarea
+ value={cue.text}
+ onChange={(e) => {
+ const newCaptions = [...autoCaptions];
+ newCaptions[index] = { ...cue, text: e.target.value };
+ onAutoCaptionsChange?.(newCaptions);
+ }}
+ rows={1}
+ className="w-full resize-none border-none bg-transparent p-0 text-sm text-slate-300 placeholder:text-slate-600 focus:outline-none focus:ring-0"
+ onInput={(e) => {
+ const target = e.target as HTMLTextAreaElement;
+ target.style.height = "auto";
+ target.style.height = `${target.scrollHeight}px`;
+ }}
+ ref={(el) => {
+ if (el) {
+ el.style.height = "auto";
+ el.style.height = `${el.scrollHeight}px`;
+ }
+ }}
+ />
+ </div>
+ );
+ })}
+ </div>
+ </div>
+ </div>
+ )}
+
{isGeneratingCaptions ? (
<div className="space-y-1">
<div className="text-xs text-slate-400">
diff --git a/src/components/video-editor/VideoEditor.tsx b/src/components/video-editor/VideoEditor.tsx
index 77da916d..10aa2047 100644
--- a/src/components/video-editor/VideoEditor.tsx
+++ b/src/components/video-editor/VideoEditor.tsx
@@ -84,6 +84,7 @@ import {
DEFAULT_ANNOTATION_SIZE,
DEFAULT_ANNOTATION_STYLE,
DEFAULT_AUTO_CAPTION_SETTINGS,
+ DEFAULT_BLUR_INTENSITY,
DEFAULT_CONNECTED_ZOOM_DURATION_MS,
DEFAULT_CONNECTED_ZOOM_EASING,
DEFAULT_CONNECTED_ZOOM_GAP_MS,
@@ -376,16 +377,16 @@ export default function VideoEditor() {
const [audioRegions, setAudioRegions] = useState<AudioRegion[]>([]);
const [selectedAudioId, setSelectedAudioId] = useState<string | null>(null);
const [autoCaptions, setAutoCaptions] = useState<CaptionCue[]>([]);
- const [autoCaptionSettings, setAutoCaptionSettings] = useState<AutoCaptionSettings>(
- DEFAULT_AUTO_CAPTION_SETTINGS,
- );
+ const [autoCaptionSettings, setAutoCaptionSettings] = useState<AutoCaptionSettings>(() => ({
+ ...DEFAULT_AUTO_CAPTION_SETTINGS,
+ selectedModel: (initialEditorPreferences.whisperSelectedModel as any) || "small",
+ }));
const [whisperExecutablePath, setWhisperExecutablePath] = useState<string | null>(
initialEditorPreferences.whisperExecutablePath,
);
const [whisperModelPath, setWhisperModelPath] = useState<string | null>(
initialEditorPreferences.whisperModelPath,
);
- const [downloadedWhisperModelPath, setDownloadedWhisperModelPath] = useState<string | null>(null);
const [whisperModelDownloadStatus, setWhisperModelDownloadStatus] = useState<
"idle" | "downloading" | "downloaded" | "error"
>(initialEditorPreferences.whisperModelPath ? "downloaded" : "idle");
@@ -1364,6 +1365,7 @@ export default function VideoEditor() {
gifSizePreset,
whisperExecutablePath,
whisperModelPath,
+ whisperSelectedModel: autoCaptionSettings.selectedModel,
});
}, [
wallpaper,
@@ -1399,45 +1401,55 @@ export default function VideoEditor() {
gifSizePreset,
whisperExecutablePath,
whisperModelPath,
+ autoCaptionSettings.selectedModel,
]);
useEffect(() => {
- const unsubscribe = window.electronAPI.onWhisperSmallModelDownloadProgress((state) => {
- setWhisperModelDownloadStatus(state.status);
- setWhisperModelDownloadProgress(state.progress);
+ const unsubscribe = window.electronAPI.onWhisperModelDownloadProgress((state) => {
+ if (state.model === autoCaptionSettings.selectedModel) {
+ setWhisperModelDownloadStatus(state.status);
+ setWhisperModelDownloadProgress(state.progress);
+ }
+
if (state.status === "downloaded") {
- setDownloadedWhisperModelPath(state.path ?? null);
- setWhisperModelPath((currentPath) => currentPath ?? state.path ?? null);
+ if (state.model === autoCaptionSettings.selectedModel) {
+ setWhisperModelPath(state.path ?? null);
+ }
}
+
if (state.status === "idle") {
- setDownloadedWhisperModelPath(null);
+ if (state.model === autoCaptionSettings.selectedModel) {
+ setWhisperModelPath(null);
+ }
}
+
if (state.status === "error" && state.error) {
toast.error(state.error);
}
});
+ return () => unsubscribe?.();
+ }, [autoCaptionSettings.selectedModel]);
+
+ useEffect(() => {
void (async () => {
- const result = await window.electronAPI.getWhisperSmallModelStatus();
+ const result = await window.electronAPI.getWhisperModelStatus(
+ autoCaptionSettings.selectedModel,
+ );
if (!result.success) {
return;
}
if (result.exists && result.path) {
- setDownloadedWhisperModelPath(result.path);
setWhisperModelPath((currentPath) => currentPath ?? result.path ?? null);
setWhisperModelDownloadStatus("downloaded");
setWhisperModelDownloadProgress(100);
- return;
+ } else {
+ setWhisperModelDownloadStatus("idle");
+ setWhisperModelDownloadProgress(0);
}
-
- setDownloadedWhisperModelPath(null);
- setWhisperModelDownloadStatus("idle");
- setWhisperModelDownloadProgress(0);
})();
-
- return () => unsubscribe?.();
- }, []);
+ }, [autoCaptionSettings.selectedModel]);
const handlePickWhisperExecutable = useCallback(async () => {
const result = await window.electronAPI.openWhisperExecutablePicker();
@@ -1449,25 +1461,29 @@ export default function VideoEditor() {
toast.success("Whisper executable selected");
}, []);
- const handleDownloadWhisperSmallModel = useCallback(async () => {
+ const handleDownloadWhisperModel = useCallback(async () => {
if (whisperModelDownloadStatus === "downloading") {
return;
}
setWhisperModelDownloadStatus("downloading");
setWhisperModelDownloadProgress(0);
- const result = await window.electronAPI.downloadWhisperSmallModel();
+ const result = await window.electronAPI.downloadWhisperModel(
+ autoCaptionSettings.selectedModel,
+ );
if (!result.success) {
setWhisperModelDownloadStatus("error");
- toast.error(result.error || "Failed to download Whisper small model");
+ toast.error(
+ result.error ||
+ `Failed to download Whisper ${autoCaptionSettings.selectedModel} model`,
+ );
return;
}
if (result.path) {
- setDownloadedWhisperModelPath(result.path);
setWhisperModelPath(result.path);
}
- }, [whisperModelDownloadStatus]);
+ }, [whisperModelDownloadStatus, autoCaptionSettings.selectedModel]);
const handlePickWhisperModel = useCallback(async () => {
const result = await window.electronAPI.openWhisperModelPicker();
@@ -1479,21 +1495,23 @@ export default function VideoEditor() {
toast.success("Whisper model selected");
}, []);
- const handleDeleteWhisperSmallModel = useCallback(async () => {
- const result = await window.electronAPI.deleteWhisperSmallModel();
+ const handleDeleteWhisperModel = useCallback(async () => {
+ const result = await window.electronAPI.deleteWhisperModel(
+ autoCaptionSettings.selectedModel,
+ );
if (!result.success) {
- toast.error(result.error || "Failed to delete Whisper small model");
+ toast.error(
+ result.error ||
+ `Failed to delete Whisper ${autoCaptionSettings.selectedModel} model`,
+ );
return;
}
- setWhisperModelPath((currentPath) =>
- currentPath === downloadedWhisperModelPath ? null : currentPath,
- );
- setDownloadedWhisperModelPath(null);
+ setWhisperModelPath(null);
setWhisperModelDownloadStatus("idle");
setWhisperModelDownloadProgress(0);
- toast.success("Whisper small model deleted");
- }, [downloadedWhisperModelPath]);
+ toast.success(`Whisper ${autoCaptionSettings.selectedModel} model deleted`);
+ }, [autoCaptionSettings.selectedModel]);
const handleGenerateAutoCaptions = useCallback(async () => {
if (isGeneratingCaptions) {
@@ -2216,6 +2234,11 @@ export default function VideoEditor() {
if (!region.figureData) {
updatedRegion.figureData = { ...DEFAULT_FIGURE_DATA };
}
+ } else if (type === "blur") {
+ updatedRegion.content = "";
+ if (updatedRegion.blurIntensity === undefined) {
+ updatedRegion.blurIntensity = DEFAULT_BLUR_INTENSITY;
+ }
}
return updatedRegion;
@@ -2241,6 +2264,12 @@ export default function VideoEditor() {
);
}, []);
+ const handleAnnotationBlurIntensityChange = useCallback((id: string, blurIntensity: number) => {
+ setAnnotationRegions((prev) =>
+ prev.map((region) => (region.id === id ? { ...region, blurIntensity } : region)),
+ );
+ }, []);
+
const handleAnnotationPositionChange = useCallback(
(id: string, position: { x: number; y: number }) => {
setAnnotationRegions((prev) =>
@@ -3440,7 +3469,10 @@ export default function VideoEditor() {
onAspectRatioChange={setAspectRatio}
selectedAnnotationId={selectedAnnotationId}
annotationRegions={annotationRegions}
+ currentTime={currentTime}
+ onSeek={(time) => videoPlaybackRef.current?.seek(time)}
autoCaptions={autoCaptions}
+ onAutoCaptionsChange={setAutoCaptions}
autoCaptionSettings={autoCaptionSettings}
whisperExecutablePath={whisperExecutablePath}
whisperModelPath={whisperModelPath}
@@ -3452,12 +3484,13 @@ export default function VideoEditor() {
onPickWhisperModel={handlePickWhisperModel}
onGenerateAutoCaptions={handleGenerateAutoCaptions}
onClearAutoCaptions={handleClearAutoCaptions}
- onDownloadWhisperSmallModel={handleDownloadWhisperSmallModel}
- onDeleteWhisperSmallModel={handleDeleteWhisperSmallModel}
+ onDownloadWhisperModel={handleDownloadWhisperModel}
+ onDeleteWhisperModel={handleDeleteWhisperModel}
onAnnotationContentChange={handleAnnotationContentChange}
onAnnotationTypeChange={handleAnnotationTypeChange}
onAnnotationStyleChange={handleAnnotationStyleChange}
onAnnotationFigureDataChange={handleAnnotationFigureDataChange}
+ onAnnotationBlurIntensityChange={handleAnnotationBlurIntensityChange}
onAnnotationDelete={handleAnnotationDelete}
selectedSpeedId={selectedSpeedId}
selectedSpeedValue={
diff --git a/src/components/video-editor/VideoPlayback.tsx b/src/components/video-editor/VideoPlayback.tsx
index 6ba75ac0..79949f0b 100644
--- a/src/components/video-editor/VideoPlayback.tsx
+++ b/src/components/video-editor/VideoPlayback.tsx
@@ -213,6 +213,7 @@ export interface VideoPlaybackRef {
play: () => Promise<void>;
pause: () => void;
refreshFrame: () => Promise<void>;
+ seek: (time: number) => void;
}
const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
@@ -660,6 +661,11 @@ const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
video.currentTime = nudgeTarget;
});
},
+ seek: (time: number) => {
+ const video = videoRef.current;
+ if (!video) return;
+ video.currentTime = time;
+ },
}));
const updateFocusFromClientPoint = (clientX: number, clientY: number) => {
diff --git a/src/components/video-editor/editorPreferences.ts b/src/components/video-editor/editorPreferences.ts
index 6523de7b..7c318945 100644
--- a/src/components/video-editor/editorPreferences.ts
+++ b/src/components/video-editor/editorPreferences.ts
@@ -43,6 +43,7 @@ export interface EditorPreferences extends PersistedEditorControls {
customWallpapers: string[];
whisperExecutablePath: string | null;
whisperModelPath: string | null;
+ whisperSelectedModel: string;
}
export const EDITOR_PREFERENCES_STORAGE_KEY = "recordly.editor.preferences";
@@ -86,6 +87,7 @@ export const DEFAULT_EDITOR_PREFERENCES: EditorPreferences = {
customWallpapers: [],
whisperExecutablePath: null,
whisperModelPath: null,
+ whisperSelectedModel: "small",
};
function normalizePositiveIntegerString(value: unknown, fallback: string): string {
@@ -220,6 +222,10 @@ export function normalizeEditorPreferences(
normalizeNullablePath(raw.whisperExecutablePath) ?? fallback.whisperExecutablePath,
whisperModelPath:
normalizeNullablePath(raw.whisperModelPath) ?? fallback.whisperModelPath,
+ whisperSelectedModel:
+ typeof raw.whisperSelectedModel === "string"
+ ? raw.whisperSelectedModel
+ : fallback.whisperSelectedModel,
};
}
diff --git a/src/components/video-editor/projectPersistence.ts b/src/components/video-editor/projectPersistence.ts
index b8a1c500..3a50e4ec 100644
--- a/src/components/video-editor/projectPersistence.ts
+++ b/src/components/video-editor/projectPersistence.ts
@@ -495,6 +495,9 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Pro
backgroundOpacity: isFiniteNumber(rawAutoCaptionSettings.backgroundOpacity)
? clamp(rawAutoCaptionSettings.backgroundOpacity, 0, 1)
: DEFAULT_AUTO_CAPTION_SETTINGS.backgroundOpacity,
+ selectedModel: typeof rawAutoCaptionSettings.selectedModel === "string"
+ ? rawAutoCaptionSettings.selectedModel
+ : DEFAULT_AUTO_CAPTION_SETTINGS.selectedModel,
};
const rawCropX = isFiniteNumber(editor.cropRegion?.x)
diff --git a/src/components/video-editor/types.ts b/src/components/video-editor/types.ts
index 2c5eaf76..ac0f245d 100644
--- a/src/components/video-editor/types.ts
+++ b/src/components/video-editor/types.ts
@@ -129,7 +129,7 @@ export interface TrimRegion {
endMs: number;
}
-export type AnnotationType = "text" | "image" | "figure";
+export type AnnotationType = "text" | "image" | "figure" | "blur";
export type ArrowDirection =
| "up"
@@ -197,8 +197,11 @@ export interface AnnotationRegion {
style: AnnotationTextStyle;
zIndex: number;
figureData?: FigureData;
+ blurIntensity?: number;
}
+export const DEFAULT_BLUR_INTENSITY = 12;
+
export const DEFAULT_ANNOTATION_POSITION: AnnotationPosition = {
x: 50,
y: 50,
@@ -264,10 +267,12 @@ export interface CaptionCueWord {
}
export type AutoCaptionAnimation = "none" | "fade" | "rise" | "pop";
+export type WhisperModel = "tiny" | "base" | "small" | "medium" | "large";
export interface AutoCaptionSettings {
enabled: boolean;
language: string;
+ selectedModel: WhisperModel;
fontFamily: string;
fontSize: number;
bottomOffset: number;
@@ -283,6 +288,7 @@ export interface AutoCaptionSettings {
export const DEFAULT_AUTO_CAPTION_SETTINGS: AutoCaptionSettings = {
enabled: false,
language: "auto",
+ selectedModel: "small",
fontFamily: getDefaultCaptionFontFamily(),
fontSize: 30,
bottomOffset: 3,
diff --git a/src/index.css b/src/index.css
index 80d8fc45..35f25625 100644
--- a/src/index.css
+++ b/src/index.css
@@ -121,6 +121,23 @@
.custom-scrollbar::-webkit-scrollbar {
display: none; /* Chrome, Safari, Opera */
}
+
+ .subtle-scrollbar::-webkit-scrollbar {
+ width: 4px;
+ }
+
+ .subtle-scrollbar::-webkit-scrollbar-track {
+ background: transparent;
+ }
+
+ .subtle-scrollbar::-webkit-scrollbar-thumb {
+ background: rgba(255, 255, 255, 0.1);
+ border-radius: 10px;
+ }
+
+ .subtle-scrollbar::-webkit-scrollbar-thumb:hover {
+ background: rgba(255, 255, 255, 0.2);
+ }
/* Smooth playback scrubber */
input[type="range"] {
diff --git a/src/lib/exporter/annotationRenderer.ts b/src/lib/exporter/annotationRenderer.ts
index 0df4541c..0dfad151 100644
--- a/src/lib/exporter/annotationRenderer.ts
+++ b/src/lib/exporter/annotationRenderer.ts
@@ -289,6 +289,67 @@ async function renderImage(
});
}
+function renderBlur(
+ ctx: CanvasRenderingContext2D,
+ annotation: AnnotationRegion,
+ x: number,
+ y: number,
+ width: number,
+ height: number,
+ scaleFactor: number
+) {
+ // Get intensity scaled to canvas resolution
+ const intensity = (annotation.blurIntensity ?? 12) * scaleFactor;
+ if (intensity <= 0 || width <= 0 || height <= 0) return;
+
+ ctx.save();
+ try {
+ // Determine bounds and ensure they are within canvas to avoid ImageData errors
+ const srcX = Math.max(0, x);
+ const srcY = Math.max(0, y);
+ const srcW = Math.min(width, ctx.canvas.width - srcX);
+ const srcH = Math.min(height, ctx.canvas.height - srcY);
+
+ if (srcW <= 0 || srcH <= 0) {
+ ctx.restore();
+ return;
+ }
+
+ // Capture the current canvas region
+ const imageData = ctx.getImageData(srcX, srcY, srcW, srcH);
+
+ let offscreen: HTMLCanvasElement | OffscreenCanvas;
+ if (typeof document !== 'undefined') {
+ offscreen = document.createElement('canvas');
+ } else {
+ offscreen = new OffscreenCanvas(srcW, srcH);
+ }
+ offscreen.width = srcW;
+ offscreen.height = srcH;
+
+ const offCtx = offscreen.getContext('2d') as CanvasRenderingContext2D;
+ offCtx.putImageData(imageData, 0, 0);
+
+ // Create rounded rect clipping path (matches UI's rounded-lg approx 8px)
+ const radius = 8 * scaleFactor;
+ ctx.beginPath();
+ if (ctx.roundRect) {
+ ctx.roundRect(x, y, width, height, radius);
+ } else {
+ ctx.rect(x, y, width, height);
+ }
+ ctx.clip();
+
+ // Apply the blur filter and draw the captured region back
+ ctx.filter = `blur(${intensity}px)`;
+ ctx.drawImage(offscreen as any, srcX, srcY);
+
+ } catch (err) {
+ console.warn('[AnnotationRenderer] Blur annotation render failed:', err);
+ }
+ ctx.restore();
+}
+
export async function renderAnnotations(
ctx: CanvasRenderingContext2D,
annotations: AnnotationRegion[],
@@ -335,6 +396,10 @@ export async function renderAnnotations(
);
}
break;
+
+ case 'blur':
+ renderBlur(ctx, annotation, x, y, width, height, scaleFactor);
+ break;
}
}
}