Skip to content

Desktop Features

Desktop (Electron) specific features and architecture.

🖥️ Complete Desktop Workflow (Download-Create-Encode)

Desktop-exclusive complete workflow from source acquisition to final output:


🚀 Full-Auto End-to-End Mode

This is an Electron-exclusive core feature, coordinating Main Process (resource scheduling) and Renderer Process (AI computation) via IPC for "one-click hardsub".

Cross-Process Interaction Architecture

Key IPC Channels

ChannelDirectionPayloadPurpose
end-to-end:startRenderer -> MainEndToEndConfigStart full-auto task
end-to-end:generate-subtitlesMain -> Rendererpath, configMain ready, request generation
end-to-end:subtitle-resultRenderer -> MainSubtitleItem[]Generation complete, return result
end-to-end:progressMain -> Rendererstage, progressReal-time progress sync

🛰️ Custom Media Protocol

To bypass browser security restrictions (CSP, sandbox) and support large file streaming:

local-video:// Protocol

  • Location: electron/main.ts
  • Core Permissions: standard, secure, stream, supportFetchAPI, bypassCSP
  • Key Tech - Tailing Reader: Supports reading "growing files" (transcoding in progress). Uses polling to read new data FFmpeg is writing to disk.

📺 Video Preview & Cache Strategy

System uses fragmented MP4 (fMP4) transcoding strategy for progressive playback during transcoding.

Architecture Overview

ComponentLocationFunction
VideoPlayerPreviewsrc/components/editor/React player, ASS subtitle overlay
useVideoPreviewsrc/hooks/Transcode progress, video source, state
videoPreviewTranscoderelectron/services/FFmpeg transcoding, GPU accel, caching

Flow Diagram

Core Features

FeatureDescription
Progressive PlayPlay before transcoding completes via fMP4 + Tailing
GPU AccelerationAuto-detect NVENC/QSV/VCE for faster transcoding
Format DetectionSkip transcoding for browser-compatible formats
WYSIWYG SubtitlesReal-time ASS rendering with assjs
Float/Dock ModeResizable floating window or docked panel

Cache Lifecycle

  • Location: User data directory (/preview_cache/)
  • Limit: Auto-enforce total size limit (default 3GB)
  • Cleanup: Auto-detect on startup (oldest first), UI manual cleanup

IPC Channels

ChannelDirectionPayloadPurpose
transcode-for-previewRenderer → Main{ filePath }Request video transcoding
transcode-startMain → Renderer{ outputPath, duration }Transcoding started
transcode-progressMain → Renderer{ percent, transcodedDuration }Real-time progress
cache:get-sizeRenderer → Main-Get preview cache size
cache:clearRenderer → Main-Clear preview cache

🔧 Desktop Service Modules

FileDescription
main.tsElectron main process, window & IPC
preload.tsPreload script, secure Node.js API exposure
logger.tsUnified logging, file rotation, JSON view
utils/paths.tsPortable path resolution, exe-relative storage
services/localWhisper.tsLocal Whisper, GPU detection
services/ffmpegAudioExtractor.tsFFmpeg audio extraction
services/ytdlp.tsVideo download (YouTube/Bilibili)
services/videoCompressor.tsVideo encoding, NVENC/QSV/AMF acceleration
services/videoPreviewTranscoder.tsPreview transcoding, fMP4, caching
services/endToEndPipeline.tsFull automation pipeline
services/storage.tsPortable storage, exe-relative config/logs

Released under the MIT License.