Skip to content

feat: add server-side recording system#392

Closed
wowitsjack wants to merge 1 commit intoFredolx:mainfrom
wowitsjack:feat/recording-system
Closed

feat: add server-side recording system#392
wowitsjack wants to merge 1 commit intoFredolx:mainfrom
wowitsjack:feat/recording-system

Conversation

@wowitsjack
Copy link

@wowitsjack wowitsjack commented Mar 7, 2026

Full source available at FredTV-Next, my personal fork with all features integrated.

Summary

Complete recording system with Rust backend and Angular frontend integration:

  • Backend (recording.rs): Spawn ffmpeg to record livestreams to MP4. Graceful shutdown via stdin q (preserves moov atom), fallback SIGKILL after 5s. Stderr capture for diagnostics. Active recordings tracked in AppState with atomic stop signals.
  • Frontend (recording.service.ts): Tauri event listeners for start/stop, BehaviorSubject state management, busy-channel guard against race conditions, elapsed time timer, state recovery on restart.
  • Integration: Channel tile recording button shows Working/Stop Recording/Record states. New Tauri commands: start_recording, stop_recording, get_active_recordings. ExitRequested handler signals all recordings to stop on app close.

Files

  • New: src-tauri/src/recording.rs, src/app/recording.service.ts, src/app/models/recording.ts
  • Modified: src-tauri/src/lib.rs, src-tauri/src/types.rs, src/app/channel-tile/channel-tile.component.ts, src/app/channel-tile/channel-tile.component.html

Test plan

  • Start recording a livestream, verify ffmpeg spawns and MP4 file grows
  • Stop recording, verify file is playable (moov atom intact)
  • Spam-click record button, verify no duplicate ffmpeg processes
  • Close app while recording, verify ffmpeg is killed (no orphans)
  • Reopen app, verify active recording state is recovered

@CLAassistant
Copy link

CLAassistant commented Mar 7, 2026

CLA assistant check
All committers have signed the CLA.

Add a complete recording system with Rust backend and Angular frontend:

Backend (recording.rs):
- Spawn ffmpeg to record livestreams to MP4 files
- Graceful shutdown via stdin "q" command (preserves moov atom)
- Fallback SIGKILL after 5s timeout
- Stderr capture for diagnostics
- Track active recordings in AppState with atomic stop signals

Frontend (recording.service.ts):
- Listen for recording-started/stopped Tauri events
- Manage recording state via BehaviorSubject
- Busy-channel guard prevents race conditions from spam-clicking
- Timer for elapsed time display
- Recover active recordings on app restart

Integration:
- channel-tile: recording button shows Working/Stop/Record states
- lib.rs: start_recording, stop_recording, get_active_recordings commands
- ExitRequested handler signals all recordings to stop on app exit
@wowitsjack wowitsjack force-pushed the feat/recording-system branch from 8bdd710 to 6a80458 Compare March 7, 2026 00:38
@wowitsjack
Copy link
Author

wowitsjack commented Mar 7, 2026

Yep agreed

@wowitsjack wowitsjack force-pushed the feat/recording-system branch 2 times, most recently from 1e4a7d6 to 6a80458 Compare March 7, 2026 15:54
@wowitsjack
Copy link
Author

Superseded by #396 + #397 which contribute the full FredTV-Next codebase as a proper 2-part stack.

@wowitsjack wowitsjack closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants