Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(export): prefetch the cursor track, and settle the Source and upscale badges
Etienne Lescote74a60802580
diff --git a/poc-d3d/src/live.rs b/poc-d3d/src/live.rsindex 15725dbd8..018d23347 100644--- a/poc-d3d/src/live.rs+++ b/poc-d3d/src/live.rs@@ -59,6 +59,13 @@ struct PrefetchedClip {wdec: Decoder,webcam_offset_sec: f64,idx: u32,+ /// Piste curseur du clip à venir, préchargée ici pour la même raison que les décodeurs :+ /// sans ça, la bascule à la frontière restait synchrone sur CE point précis (lecture ++ /// parsing JSON du `.cursor.json`, potentiellement des milliers d'échantillons pour un+ /// enregistrement long) même après que le préchargement des décodeurs a supprimé le gros+ /// de la pause perceptible — un second petit accroc au même endroit, pour la même raison+ /// (une E/S synchrone pile à la frontière) qu'on venait de corriger pour les décodeurs.+ cursor_track: Option<CursorTrack>,}/// Ouvre + positionne la paire de décodeurs d'un clip (même travail que@@ -80,7 +87,8 @@ unsafe fn open_and_seek_clip(anyhow::bail!("clip préchargé vide au temps source {source_time_sec:.3}s (screen=\"{screen_path}\", webcam=\"{webcam_path}\")");}let idx = (source_time_sec * sdec.fps()).round().max(0.0) as u32;- Ok(PrefetchedClip { sdec, wdec, webcam_offset_sec, idx })+ let cursor_track = CursorTrack::load(&format!("{screen_path}.cursor.json"), 0.0, 24.0 * 3600.0).ok();+ Ok(PrefetchedClip { sdec, wdec, webcam_offset_sec, idx, cursor_track })}/// Lit deux sources en lockstep et compose la frame courante dans le RT du compositeur.@@ -731,6 +739,14 @@ unsafe fn advance_to_next_scene_clip(if idx == next_index { rx.try_recv().ok() } else { None }});+ // Le curseur préchargé (voir `PrefetchedClip::cursor_track`) doit être extrait AVANT de+ // passer `prefetched` (par valeur) à `apply_prefetched`, qui ne s'occupe que des+ // décodeurs — sinon ce champ serait silencieusement perdu avec le reste de la struct.+ let prefetched_cursor: Option<Option<CursorTrack>> = match &ready {+ Some(Ok(p)) => Some(p.cursor_track.clone()),+ _ => None,+ };+let applied = match ready {Some(Ok(prefetched)) => {player.apply_prefetched(prefetched);@@ -760,8 +776,16 @@ unsafe fn advance_to_next_scene_clip(*active_webcam_offset_sec = next_clip.webcam_offset_sec;*active_clip_index = next_index;comp.set_scene(Some(scene_for_clip(scene, *active_clip_index)));- let cursor_path = format!("{}.cursor.json", active_screen_path);- *raw_cursor = CursorTrack::load(&cursor_path, 0.0, 24.0 * 3600.0).ok();+ // Réutilise le curseur préchargé s'il est disponible (voir plus haut) — sinon+ // (préchargement pas encore prêt / raté) on retombe sur la lecture synchrone+ // habituelle, comme avant cette optimisation.+ *raw_cursor = match prefetched_cursor {+ Some(track) => track,+ None => {+ let cursor_path = format!("{}.cursor.json", active_screen_path);+ CursorTrack::load(&cursor_path, 0.0, 24.0 * 3600.0).ok()+ }+ };match raw_cursor {Some(track) => comp.set_cursor(track.smoothed(0.0)),None => comp.clear_cursor(),diff --git a/src/components/ai-edition/ExportDialog.tsx b/src/components/ai-edition/ExportDialog.tsxindex 6546bd7b7..133e4852d 100644--- a/src/components/ai-edition/ExportDialog.tsx+++ b/src/components/ai-edition/ExportDialog.tsx@@ -248,25 +248,21 @@ export function ExportDialog({ open, onClose, document }: ExportDialogProps) {() => (document ? collectEffectiveClipDims(document, probedAssetDims) : []),[document, probedAssetDims],);- // The output is a single video at one resolution, so it's sized to the LARGEST clip's- // true (cropped) footprint — never gratuitously downscaling the best footage, and never- // treating a narrow crop as if it were the full uncropped frame. Drives both the "Source"- // export size and the per-tier upscale/output-size labels below.+ // Largest clip's true (cropped) footprint — used only by the GIF export path below (its+ // own, separate sizing option), which sizes to the best available footage the same way+ // this dialog always has.const referenceSource = useMemo(() => pickExtremeDims(effectiveClipDims, "largest"),[effectiveClipDims],);- // Short side of the reference — the axis the 720p/1080p tiers target — or null- // while dims are still unknown (0x0 default), so tiers show no label rather- // than a wrong one.- const sourceShortSide = referenceSource- ? Math.min(referenceSource.width, referenceSource.height)- : null;- // Smallest clip's true (cropped) footprint — a multiclip timeline can mix crops/- // resolutions, so the SAME chosen output size can be a downscale relative to the- // largest clip and an upscale relative to the smallest one at the same time. Both- // badges below need this in addition to `referenceSource` (the largest).+ // Smallest clip's true (cropped) footprint on the timeline — a multiclip timeline can mix+ // crops/resolutions, so this is what "Source" quality actually targets: sizing to the+ // SMALLEST clip's own resolution means no clip on the timeline is ever upscaled past its+ // true footprint by picking Source, which is why Source shows no upscale/downscale badge+ // at all any more (see the tier badges below) — it's upscale-proof by construction. The+ // fixed 720p/1080p tiers don't have that property (they can still upscale a small clip),+ // so `smallestShortSide` below still feeds their upscale badge.const smallestSource = useMemo(() => pickExtremeDims(effectiveClipDims, "smallest"),[effectiveClipDims],@@ -294,14 +290,16 @@ export function ExportDialog({ open, onClose, document }: ExportDialogProps) {? getNativeAspectRatioValue(rawReferenceSource.width, rawReferenceSource.height): getAspectRatioValue(timelineAspect);// Output dimensions the export will produce for a given tier, from the (crop-aware)- // reference source — so each tier's subtitle is the real pixel size, and "Source"- // quality never upscales a crop past its own true resolution.+ // SMALLEST clip on the timeline — see `smallestSource` above for why. Only "Source"+ // quality actually uses these as its target size; 720p/1080p target a fixed short side+ // regardless (`calculateDimensionsForShortSide`), so this only changes what "Source"+ // resolves to.const tierOutputDims = (value: ExportQuality) =>- referenceSource+ smallestSource? calculateMp4ExportSettings({quality: value,- sourceWidth: referenceSource.width,- sourceHeight: referenceSource.height,+ sourceWidth: smallestSource.width,+ sourceHeight: smallestSource.height,aspectRatioValue: EXPORT_ASPECT,}): null;@@ -543,22 +541,25 @@ export function ExportDialog({ open, onClose, document }: ExportDialogProps) {{(() => {const dims = tierOutputDims(q.value);if (!dims) return null;+ // Downscale badge removed everywhere — restated what picking a lower+ // tier already means, not actionable. Upscale badge removed only for+ // "Source": it's upscale-proof by construction now (targets the+ // smallest clip), so the warning never meant anything there. The fixed+ // 720p/1080p tiers can still genuinely upscale a small clip, so that+ // badge stays relevant for them.const outShortSide = Math.min(dims.width, dims.height);- // A multiclip timeline can mix resolutions — the chosen output size can- // be a downscale relative to the LARGEST clip and an upscale relative to- // the SMALLEST one at the same time, so both badges can show together.- const isDownscale = sourceShortSide !== null && outShortSide < sourceShortSide;const isUpscale =- smallestShortSide !== null && outShortSide > smallestShortSide;+ q.value !== "source" &&+ smallestShortSide !== null &&+ outShortSide > smallestShortSide;return (<spanstyle={{font: "500 11px var(--font-body)",- color: isDownscale || isUpscale ? "var(--warn)" : "var(--muted)",+ color: isUpscale ? "var(--warn)" : "var(--muted)",}}>{dims.width} × {dims.height}- {isDownscale ? ` · ${t("exportDialog.qualityDownscaleWarning")}` : ""}{isUpscale ? ` · ${t("exportDialog.qualityUpscaleWarning")}` : ""}</span>);diff --git a/src/i18n/locales/ar/editor.json b/src/i18n/locales/ar/editor.jsonindex d7cccf227..32270996c 100644--- a/src/i18n/locales/ar/editor.json+++ b/src/i18n/locales/ar/editor.json@@ -176,7 +176,6 @@"subtitle": "عرض المخطط الزمني إلى ملف","addVideoBeforeExporting": "أضف فيديو قبل التصدير.","quality": "الجودة",- "qualityUpscaleWarning": "تكبير الدقة","qualityMatchRecording": "مطابقة التسجيل","frameRate": "معدل الإطارات","codec": "الترميز",@@ -204,7 +203,8 @@"exportedVideo": "تم تصدير الفيديو","showInFolder": "إظهار في المجلد","exportFailed": "فشل التصدير",- "failedToWriteFile": "فشلت كتابة الملف"+ "failedToWriteFile": "فشلت كتابة الملف",+ "qualityUpscaleWarning": "تكبير الدقة"},"inspector": {"resetFocusPoint": "إعادة تعيين نقطة التركيز",diff --git a/src/i18n/locales/en/editor.json b/src/i18n/locales/en/editor.jsonindex a7fee4911..d7f85dd2b 100644--- a/src/i18n/locales/en/editor.json+++ b/src/i18n/locales/en/editor.json@@ -176,8 +176,6 @@"subtitle": "Render the timeline to a file","addVideoBeforeExporting": "Add a video before exporting.","quality": "Quality",- "qualityUpscaleWarning": "Upscale",- "qualityDownscaleWarning": "Downscale","qualityMatchRecording": "Match recording","frameRate": "Frame rate","codec": "Codec",@@ -206,7 +204,8 @@"exportedVideoOf": "of video exported in","showInFolder": "Show in folder","exportFailed": "Export failed",- "failedToWriteFile": "Failed to write file"+ "failedToWriteFile": "Failed to write file",+ "qualityUpscaleWarning": "Upscale"},"inspector": {"resetFocusPoint": "Reset focus point",diff --git a/src/i18n/locales/es/editor.json b/src/i18n/locales/es/editor.jsonindex 33eadbba8..7879cf28e 100644--- a/src/i18n/locales/es/editor.json+++ b/src/i18n/locales/es/editor.json@@ -176,7 +176,6 @@"subtitle": "Renderizar la línea de tiempo a un archivo","addVideoBeforeExporting": "Añade un vídeo antes de exportar.","quality": "Calidad",- "qualityUpscaleWarning": "Upscaling","qualityMatchRecording": "Igual que la grabación","frameRate": "Fotogramas por segundo","codec": "Códec",@@ -204,7 +203,8 @@"exportedVideo": "Vídeo exportado","showInFolder": "Mostrar en la carpeta","exportFailed": "Error al exportar",- "failedToWriteFile": "No se pudo escribir el archivo"+ "failedToWriteFile": "No se pudo escribir el archivo",+ "qualityUpscaleWarning": "Upscaling"},"inspector": {"resetFocusPoint": "Restablecer punto de enfoque",diff --git a/src/i18n/locales/fr/editor.json b/src/i18n/locales/fr/editor.jsonindex c3e893d79..fe7cbb4d8 100644--- a/src/i18n/locales/fr/editor.json+++ b/src/i18n/locales/fr/editor.json@@ -176,8 +176,6 @@"subtitle": "Rendre la timeline dans un fichier","addVideoBeforeExporting": "Ajoutez une vidéo avant d'exporter.","quality": "Qualité",- "qualityUpscaleWarning": "Upscaling",- "qualityDownscaleWarning": "Downscaling","qualityMatchRecording": "Comme l'enregistrement","frameRate": "Fréquence d'images","codec": "Codec",@@ -206,7 +204,8 @@"exportedVideoOf": "de vidéo exportée en","showInFolder": "Afficher dans le dossier","exportFailed": "Échec de l'export",- "failedToWriteFile": "Échec de l'écriture du fichier"+ "failedToWriteFile": "Échec de l'écriture du fichier",+ "qualityUpscaleWarning": "Upscaling"},"inspector": {"resetFocusPoint": "Réinitialiser le point de focus",diff --git a/src/i18n/locales/it/editor.json b/src/i18n/locales/it/editor.jsonindex 7a0e16cac..50c4bca44 100644--- a/src/i18n/locales/it/editor.json+++ b/src/i18n/locales/it/editor.json@@ -176,7 +176,6 @@"subtitle": "Esegui il rendering della timeline in un file","addVideoBeforeExporting": "Aggiungi un video prima di esportare.","quality": "Qualità",- "qualityUpscaleWarning": "Upscaling","qualityMatchRecording": "Come la registrazione","frameRate": "Frame rate","codec": "Codec",@@ -204,7 +203,8 @@"exportedVideo": "Video esportato","showInFolder": "Mostra nella cartella","exportFailed": "Esportazione non riuscita",- "failedToWriteFile": "Impossibile scrivere il file"+ "failedToWriteFile": "Impossibile scrivere il file",+ "qualityUpscaleWarning": "Upscaling"},"inspector": {"resetFocusPoint": "Reimposta punto di messa a fuoco",diff --git a/src/i18n/locales/ja-JP/editor.json b/src/i18n/locales/ja-JP/editor.jsonindex 6f7ef0fb8..dec7b4ea5 100644--- a/src/i18n/locales/ja-JP/editor.json+++ b/src/i18n/locales/ja-JP/editor.json@@ -176,7 +176,6 @@"subtitle": "タイムラインをファイルに書き出します","addVideoBeforeExporting": "エクスポートする前に動画を追加してください。","quality": "画質",- "qualityUpscaleWarning": "アップスケール","qualityMatchRecording": "録画と同じ","frameRate": "フレームレート","codec": "コーデック",@@ -204,7 +203,8 @@"exportedVideo": "動画をエクスポートしました","showInFolder": "フォルダーで表示","exportFailed": "エクスポートに失敗しました",- "failedToWriteFile": "ファイルの書き込みに失敗しました"+ "failedToWriteFile": "ファイルの書き込みに失敗しました",+ "qualityUpscaleWarning": "アップスケール"},"inspector": {"resetFocusPoint": "フォーカスポイントをリセット",diff --git a/src/i18n/locales/ko-KR/editor.json b/src/i18n/locales/ko-KR/editor.jsonindex 080c12312..c0a58f2de 100644--- a/src/i18n/locales/ko-KR/editor.json+++ b/src/i18n/locales/ko-KR/editor.json@@ -176,7 +176,6 @@"subtitle": "타임라인을 파일로 렌더링합니다","addVideoBeforeExporting": "내보내기 전에 동영상을 추가하세요.","quality": "화질",- "qualityUpscaleWarning": "업스케일","qualityMatchRecording": "녹화와 동일","frameRate": "프레임 속도","codec": "코덱",@@ -204,7 +203,8 @@"exportedVideo": "동영상 내보내기 완료","showInFolder": "폴더에서 보기","exportFailed": "내보내기 실패",- "failedToWriteFile": "파일 쓰기에 실패했습니다"+ "failedToWriteFile": "파일 쓰기에 실패했습니다",+ "qualityUpscaleWarning": "업스케일"},"inspector": {"resetFocusPoint": "포커스 지점 재설정",diff --git a/src/i18n/locales/pt-BR/editor.json b/src/i18n/locales/pt-BR/editor.jsonindex 2e1d15fc4..a67e0894d 100644--- a/src/i18n/locales/pt-BR/editor.json+++ b/src/i18n/locales/pt-BR/editor.json@@ -176,7 +176,6 @@"subtitle": "Renderizar a linha do tempo para um arquivo","addVideoBeforeExporting": "Adicione um vídeo antes de exportar.","quality": "Qualidade",- "qualityUpscaleWarning": "Upscaling","qualityMatchRecording": "Igual à gravação","frameRate": "Taxa de quadros","codec": "Codec",@@ -204,7 +203,8 @@"exportedVideo": "Vídeo exportado","showInFolder": "Mostrar na pasta","exportFailed": "Falha na exportação",- "failedToWriteFile": "Falha ao gravar o arquivo"+ "failedToWriteFile": "Falha ao gravar o arquivo",+ "qualityUpscaleWarning": "Upscaling"},"inspector": {"resetFocusPoint": "Redefinir ponto de foco",diff --git a/src/i18n/locales/ru/editor.json b/src/i18n/locales/ru/editor.jsonindex 32bccb64f..f5d0ea073 100644--- a/src/i18n/locales/ru/editor.json+++ b/src/i18n/locales/ru/editor.json@@ -176,7 +176,6 @@"subtitle": "Рендеринг таймлайна в файл","addVideoBeforeExporting": "Добавьте видео перед экспортом.","quality": "Качество",- "qualityUpscaleWarning": "Апскейл","qualityMatchRecording": "Как в записи","frameRate": "Частота кадров","codec": "Кодек",@@ -204,7 +203,8 @@"exportedVideo": "Видео экспортировано","showInFolder": "Показать в папке","exportFailed": "Ошибка экспорта",- "failedToWriteFile": "Не удалось записать файл"+ "failedToWriteFile": "Не удалось записать файл",+ "qualityUpscaleWarning": "Апскейл"},"inspector": {"resetFocusPoint": "Сбросить точку фокуса",diff --git a/src/i18n/locales/tr/editor.json b/src/i18n/locales/tr/editor.jsonindex a5aed00ec..ffaaa14bd 100644--- a/src/i18n/locales/tr/editor.json+++ b/src/i18n/locales/tr/editor.json@@ -176,7 +176,6 @@"subtitle": "Zaman çizelgesini bir dosyaya işleyin","addVideoBeforeExporting": "Dışa aktarmadan önce bir video ekleyin.","quality": "Kalite",- "qualityUpscaleWarning": "Upscale","qualityMatchRecording": "Kayıtla eşleştir","frameRate": "Kare hızı","codec": "Codec",@@ -204,7 +203,8 @@"exportedVideo": "Video dışa aktarıldı","showInFolder": "Klasörde göster","exportFailed": "Dışa aktarma başarısız oldu",- "failedToWriteFile": "Dosya yazılamadı"+ "failedToWriteFile": "Dosya yazılamadı",+ "qualityUpscaleWarning": "Upscale"},"inspector": {"resetFocusPoint": "Odak noktasını sıfırla",diff --git a/src/i18n/locales/vi/editor.json b/src/i18n/locales/vi/editor.jsonindex 658d72f24..e5befc735 100644--- a/src/i18n/locales/vi/editor.json+++ b/src/i18n/locales/vi/editor.json@@ -176,7 +176,6 @@"subtitle": "Kết xuất dòng thời gian thành tệp","addVideoBeforeExporting": "Thêm video trước khi xuất.","quality": "Chất lượng",- "qualityUpscaleWarning": "Upscale","qualityMatchRecording": "Khớp với bản ghi","frameRate": "Tốc độ khung hình","codec": "Codec",@@ -204,7 +203,8 @@"exportedVideo": "Đã xuất video","showInFolder": "Hiện trong thư mục","exportFailed": "Xuất thất bại",- "failedToWriteFile": "Không thể ghi tệp"+ "failedToWriteFile": "Không thể ghi tệp",+ "qualityUpscaleWarning": "Upscale"},"inspector": {"resetFocusPoint": "Đặt lại điểm lấy nét",diff --git a/src/i18n/locales/zh-CN/editor.json b/src/i18n/locales/zh-CN/editor.jsonindex f4e64efae..99e3ffb55 100644--- a/src/i18n/locales/zh-CN/editor.json+++ b/src/i18n/locales/zh-CN/editor.json@@ -176,7 +176,6 @@"subtitle": "将时间轴渲染为文件","addVideoBeforeExporting": "导出前请先添加视频。","quality": "画质",- "qualityUpscaleWarning": "放大","qualityMatchRecording": "与录制一致","frameRate": "帧率","codec": "编码格式",@@ -204,7 +203,8 @@"exportedVideo": "视频已导出","showInFolder": "在文件夹中显示","exportFailed": "导出失败",- "failedToWriteFile": "写入文件失败"+ "failedToWriteFile": "写入文件失败",+ "qualityUpscaleWarning": "放大"},"inspector": {"resetFocusPoint": "重置焦点",diff --git a/src/i18n/locales/zh-TW/editor.json b/src/i18n/locales/zh-TW/editor.jsonindex c957f6871..2699b70a6 100644--- a/src/i18n/locales/zh-TW/editor.json+++ b/src/i18n/locales/zh-TW/editor.json@@ -176,7 +176,6 @@"subtitle": "將時間軸轉譯為檔案","addVideoBeforeExporting": "匯出前請先新增影片。","quality": "畫質",- "qualityUpscaleWarning": "放大","qualityMatchRecording": "與錄製內容相符","frameRate": "幀率","codec": "編碼格式",@@ -204,7 +203,8 @@"exportedVideo": "影片已匯出","showInFolder": "在資料夾中顯示","exportFailed": "匯出失敗",- "failedToWriteFile": "寫入檔案失敗"+ "failedToWriteFile": "寫入檔案失敗",+ "qualityUpscaleWarning": "放大"},"inspector": {"resetFocusPoint": "重設焦點",