calibrate gif size, probe codecs, align audio with video

- sample-encode gif calibration before the retry loop
- probe ffmpeg encoders and grey out missing codecs in settings
- pad audio head with silence so it lines up with video start
- cache gif preview palette keyed on colors and sample window
- read encode progress from -progress pipe:1 instead of stderr scraping
- thread bt709 color metadata through capture, fix, and gif scale
- sweep temp on startup
- gif estimate table for the ui, interpolated locally on slider drag
This commit is contained in:
2026-06-17 23:09:53 +03:00
parent 4ca802ef71
commit f732cdda4d
7 changed files with 647 additions and 155 deletions
+31
View File
@@ -87,6 +87,7 @@ export type ClickEvent = {
time_secs: number
x: number
y: number
button: "Left" | "Right" | "Middle"
}
export type RecordedClip = {
@@ -148,6 +149,24 @@ export type GifEstimate = {
dims_label: string
}
export type GifEstimatePoint = {
target_bytes: number
width: number
fps: number
height: number
}
export type GifEstimateTable = {
points: GifEstimatePoint[]
}
export type CodecAvailability = {
h264: boolean
h265: boolean
vp9: boolean
av1: boolean
}
export type AudioFailed = string
export const api = {
@@ -191,6 +210,17 @@ export const api = {
duration_secs: number
}) =>
invoke<GifEstimate>("estimate_gif_params", { request: input }),
estimateGifParamsTable: (input: {
format: Format
fps: number
gif_budget_mode?: GifBudgetMode
gif_dither?: GifDither
gif_colors?: number
clip_width: number
clip_height: number
duration_secs: number
}) =>
invoke<GifEstimateTable>("estimate_gif_params_table", { request: input }),
renderRawPreview: (timestamp: number) =>
invoke<string>("render_raw_preview", { timestamp }),
defaultOutputPath: (format: Format) =>
@@ -214,6 +244,7 @@ export const api = {
onAudioFailed: (handler: (msg: string) => void): Promise<UnlistenFn> =>
listen<string>("audio-failed", (e) => handler(e.payload)),
cancelExport: () => invoke<void>("cancel_export"),
codecAvailability: () => invoke<CodecAvailability>("codec_availability"),
}
export function formatBytes(n: number): string {