Cliparr Media Export Workflow
Overview
Use this skill for changes that affect Cliparr's editor preview, HLS handling, export source choice, Mediabunny conversion, subtitle burn-in, metadata tagging, timeline offsets, or media proxy behavior.
Treat DIAGRAMS.md as the canonical reference for detailed decision trees. Do not copy those trees into this skill; read and update DIAGRAMS.md when behavior changes.
Start Here
Before changing behavior, read the relevant DIAGRAMS.md sections:
- Playback source construction:
Playback Candidate Tree, HLS Track Selection Tree, Source Vs Preview Track Tree
- HLS fallback and readiness:
Playback Fallback Tree, Preview Ready Warmup Tree
- Export source choice:
Export Source Selection Tree, Export Output Flow
- Timeline offset work:
Timeline Normalization Tree
- Proxy or playlist work:
Playlist Rewrite Tree, Proxy Media Request Tree
- Broad behavior checks:
Frontend Responsibility Map, End-To-End Summary
Use rg -n "^##" DIAGRAMS.md to find section line numbers, then read only the relevant section(s).
Main Entry Points
Frontend editor and playback:
apps/frontend/src/components/editor/useEditorPlayback.ts
apps/frontend/src/components/editor/editorPlaybackSources.ts
apps/frontend/src/components/editor/editorPlaybackPlan.ts
apps/frontend/src/components/editor/editorPlaybackSinks.ts
apps/frontend/src/components/editor/useEditorPlaybackWarmup.ts
apps/frontend/src/components/editor/useEditorPlaybackSelectionWarmup.ts
apps/frontend/src/components/editor/useEditorTimeline.ts
apps/frontend/src/components/editor/EditorTimeline.tsx
Export and media helpers:
apps/frontend/src/components/editor/useEditorExport.ts
apps/frontend/src/components/editor/EditorExportDialog*.tsx
apps/frontend/src/lib/exportClip.ts
apps/frontend/src/lib/exportMetadata.ts
apps/frontend/src/lib/exportFileName.ts
apps/frontend/src/lib/mediabunnyInput.ts
apps/frontend/src/lib/mediabunnyTrackAccess.ts
apps/frontend/src/lib/editorMedia.ts
apps/frontend/src/lib/localMediaRegistry.ts
Subtitles and track selection:
apps/frontend/src/lib/selectPreferredAudioTrack.ts
apps/frontend/src/lib/selectPreferredSubtitleTrack.ts
apps/frontend/src/lib/subtitles/*
apps/frontend/src/components/editor/useEditorSubtitles.ts
apps/frontend/src/components/editor/useSubtitleCues.ts
Server/provider paths:
apps/server/src/providers/shared/mediaProxy.ts
apps/server/src/routes/media.ts
apps/server/src/providers/plex/playback.ts
apps/server/src/providers/jellyfin/playback.ts
packages/shared/src/providers.ts
Invariants
- Keep source semantics separate from preview mechanics: source tracks determine duration, timeline offsets, export blocking, and export alignment; preview tracks determine browser playback.
- Preserve auto export source order from
DIAGRAMS.md: explicit user choice wins, otherwise fallback source, then HLS, then direct.
- Change HLS fallback only with the fallback categories in
DIAGRAMS.md; preview-only failures should not silently change export source.
- Apply
timelineOffsetSeconds consistently to preview seeking and export trim boundaries.
- Keep HLS playlist rewrite behavior origin-safe and base-path aware for nested relative playlists.
- Attach provider auth only when the media request origin matches the provider base URL origin.
- Avoid reopening a finished export blob for validation;
Conversion.init should validate the output plan before execution to reduce memory pressure.
- Burn subtitles only when text cues, selected track support, style settings, and a video track are available.
Testing
Run the package-level tests that match the change:
- Frontend editor/export changes:
pnpm --filter @cliparr/frontend test
- Server media proxy or provider playback changes:
pnpm --filter @cliparr/server test
- Shared provider contract changes: run both frontend and server tests.
For changes that update diagrams, also inspect DIAGRAMS.md rendered Mermaid mentally for broken labels or flow syntax. Before committing, use $cliparr-git-workflow; it requires pnpm preflight.
Source: TechSquidTV/Cliparr — distributed by TomeVault.
1---2name: cliparr-media-export-workflow3description: Cliparr media editor/export workflow guidance for HLS playback, source selection, Mediabunny export, timeline normalization, subtitle burn-in, metadata tagging, media proxy behavior, and memory-sensitive export changes. Use when an agent changes or reviews files under apps/frontend/src/components/editor, apps/frontend/src/lib media/export helpers, apps/server media proxy/provider playback paths, or shared provider playback contracts. Use when this capability is needed.4---56# Cliparr Media Export Workflow78## Overview910Use this skill for changes that affect Cliparr's editor preview, HLS handling, export source choice, Mediabunny conversion, subtitle burn-in, metadata tagging, timeline offsets, or media proxy behavior.1112Treat `DIAGRAMS.md` as the canonical reference for detailed decision trees. Do not copy those trees into this skill; read and update `DIAGRAMS.md` when behavior changes.1314## Start Here1516Before changing behavior, read the relevant `DIAGRAMS.md` sections:1718- Playback source construction: `Playback Candidate Tree`, `HLS Track Selection Tree`, `Source Vs Preview Track Tree`19- HLS fallback and readiness: `Playback Fallback Tree`, `Preview Ready Warmup Tree`20- Export source choice: `Export Source Selection Tree`, `Export Output Flow`21- Timeline offset work: `Timeline Normalization Tree`22- Proxy or playlist work: `Playlist Rewrite Tree`, `Proxy Media Request Tree`23- Broad behavior checks: `Frontend Responsibility Map`, `End-To-End Summary`2425Use `rg -n "^##" DIAGRAMS.md` to find section line numbers, then read only the relevant section(s).2627## Main Entry Points2829Frontend editor and playback:3031- `apps/frontend/src/components/editor/useEditorPlayback.ts`32- `apps/frontend/src/components/editor/editorPlaybackSources.ts`33- `apps/frontend/src/components/editor/editorPlaybackPlan.ts`34- `apps/frontend/src/components/editor/editorPlaybackSinks.ts`35- `apps/frontend/src/components/editor/useEditorPlaybackWarmup.ts`36- `apps/frontend/src/components/editor/useEditorPlaybackSelectionWarmup.ts`37- `apps/frontend/src/components/editor/useEditorTimeline.ts`38- `apps/frontend/src/components/editor/EditorTimeline.tsx`3940Export and media helpers:4142- `apps/frontend/src/components/editor/useEditorExport.ts`43- `apps/frontend/src/components/editor/EditorExportDialog*.tsx`44- `apps/frontend/src/lib/exportClip.ts`45- `apps/frontend/src/lib/exportMetadata.ts`46- `apps/frontend/src/lib/exportFileName.ts`47- `apps/frontend/src/lib/mediabunnyInput.ts`48- `apps/frontend/src/lib/mediabunnyTrackAccess.ts`49- `apps/frontend/src/lib/editorMedia.ts`50- `apps/frontend/src/lib/localMediaRegistry.ts`5152Subtitles and track selection:5354- `apps/frontend/src/lib/selectPreferredAudioTrack.ts`55- `apps/frontend/src/lib/selectPreferredSubtitleTrack.ts`56- `apps/frontend/src/lib/subtitles/*`57- `apps/frontend/src/components/editor/useEditorSubtitles.ts`58- `apps/frontend/src/components/editor/useSubtitleCues.ts`5960Server/provider paths:6162- `apps/server/src/providers/shared/mediaProxy.ts`63- `apps/server/src/routes/media.ts`64- `apps/server/src/providers/plex/playback.ts`65- `apps/server/src/providers/jellyfin/playback.ts`66- `packages/shared/src/providers.ts`6768## Invariants6970- Keep source semantics separate from preview mechanics: source tracks determine duration, timeline offsets, export blocking, and export alignment; preview tracks determine browser playback.71- Preserve auto export source order from `DIAGRAMS.md`: explicit user choice wins, otherwise fallback source, then HLS, then direct.72- Change HLS fallback only with the fallback categories in `DIAGRAMS.md`; preview-only failures should not silently change export source.73- Apply `timelineOffsetSeconds` consistently to preview seeking and export trim boundaries.74- Keep HLS playlist rewrite behavior origin-safe and base-path aware for nested relative playlists.75- Attach provider auth only when the media request origin matches the provider base URL origin.76- Avoid reopening a finished export blob for validation; `Conversion.init` should validate the output plan before execution to reduce memory pressure.77- Burn subtitles only when text cues, selected track support, style settings, and a video track are available.7879## Testing8081Run the package-level tests that match the change:8283- Frontend editor/export changes: `pnpm --filter @cliparr/frontend test`84- Server media proxy or provider playback changes: `pnpm --filter @cliparr/server test`85- Shared provider contract changes: run both frontend and server tests.8687For changes that update diagrams, also inspect `DIAGRAMS.md` rendered Mermaid mentally for broken labels or flow syntax. Before committing, use `$cliparr-git-workflow`; it requires `pnpm preflight`.8889---90> Source: [TechSquidTV/Cliparr](https://github.com/TechSquidTV/Cliparr) — distributed by [TomeVault](https://tomevault.io).91<!-- tomevault:4.0:skill_md:2026-06-17 -->