How mifi/lossless-cut works
LosslessCut is a desktop FFmpeg-based editor for fast, primarily lossless audio/video operations. The main workflow is to open a media file, inspect its streams, mark and manage segments, then export edits through FFmpeg; the renderer coordinates editing while Electron main provides native and process services. The README also documents track and format operations, detection, metadata/chapters, snapshots, project/EDL interchange, CLI, and HTTP API. Some capabilities are documented but their implementations were not sampled; corresponding paths are limited to supported directories, and edges are omitted where call ownership is unverified.
Main entry points: App.tsx Editor workspace · useFfmpegOperations.ts Media operations · index.ts Electron main · ffmpeg.ts FFmpeg commands
Components 22
Editing interface
- Editor workspace
src/renderer/src/App.tsx - Segment controls
src/renderer/src/hooks/useSegments.tsx - Stream selection
src/renderer/src/StreamsSelector.tsx - User settings
src/renderer/src/hooks/useUserSettingsRoot.ts
Media analysis
- Media playback
src/renderer/src/MediaSourcePlayer.tsx - Media probing
src/common/ffprobe.ts - Stream utilities
src/renderer/src/util/streams.ts
Editing and export
- Media operations
src/renderer/src/hooks/useFfmpegOperations.ts - FFmpeg commands
src/renderer/src/ffmpeg.ts - Segment model
src/renderer/src/segments.ts - Smart cut
src/renderer/src/smartcut.ts
Desktop services
- FFmpeg execution
src/main/ffmpeg.ts - Electron main
src/main/index.ts - IPC bridge
src/preload/index.ts - Configuration store
src/main/configStore.ts - HTTP API
src/main/httpServer.ts
Interchange and access
- EDL and project formats
src/renderer/src/edlFormats.ts - Media dialogs
src/renderer/src/dialogs/index.tsx - Website and docs
website/src/lib/docs.ts
Other components
- Editor user
- Media files
- FFmpeg tools
Connections 21
- Editor user → Editor workspace: edits media
- Editor workspace → Segment controls: manages segments
src/renderer/src/App.tsx - Editor workspace → Stream selection: selects tracks
src/renderer/src/App.tsx - Editor workspace → Media playback: plays source
src/renderer/src/App.tsx - Editor workspace → User settings: loads settings
src/renderer/src/App.tsx - Editor workspace → Media operations: requests export
src/renderer/src/App.tsx - Editor workspace → Media dialogs: opens dialogs
src/renderer/src/App.tsx - Editor workspace → Media files: opens files
- Media playback → Media probing: reads metadata
- Stream selection → Stream utilities: uses stream data
src/renderer/src/util/streams.ts - Media operations → FFmpeg commands: builds commands
src/renderer/src/hooks/useFfmpegOperations.ts - Media operations → Segment model: uses segments
src/renderer/src/hooks/useFfmpegOperations.ts - Media operations → Smart cut: delegates smart cut
src/renderer/src/hooks/useFfmpegOperations.ts - FFmpeg commands → EDL and project formats: parses subtitles
src/renderer/src/ffmpeg.ts - FFmpeg commands → FFmpeg execution: runs processes
- FFmpeg execution → FFmpeg tools: invokes tools
- Electron main → Configuration store: initializes settings
src/main/index.ts - Electron main → HTTP API: configures API
src/main/index.ts - Electron main → IPC bridge: loads bridge
src/main/index.ts - Media dialogs → EDL and project formats: imports and exports
src/renderer/src/dialogs/index.tsx - Editor user → Website and docs: consults docs