8 Commits

Author SHA1 Message Date
fa38caa5a5 feat: capture ffmpeg stderr on failure for diagnostics
- Accumulate stderr in FFmpegRecorder during recording
- Log last 2000 chars of stderr when ffmpeg exits non-zero
- Log ffmpeg input URL and args at start
- RecordingError.processFailed now includes optional stderr string
- Error message shows ffmpeg error details to user
2026-07-17 20:36:09 +08:00
6f2661c3d1 fix: 手动停止录制时跳过耗时的文件分析,避免 save dialog 延迟/卡住
fragmented MP4 在 SIGINT 后可能导致 ffprobe/ffmpeg 分析卡住。
stopRequested 时直接返回基本文件信息,不跑 ffprobe 和音量检测。
2026-07-01 08:02:57 +08:00
ec88e9f530 fix: 修复 waitForProcess race condition,添加调试日志 2026-07-01 08:01:40 +08:00
acb232d38b fix: replace blocking waitUntilExit() with async continuation
proc.waitUntilExit() blocks cooperative thread pool threads and
deadlocks in Swift Concurrency Task context because NSRunLoop
notifications aren't processed. Replace with terminationHandler +
withCheckedContinuation pattern.
2026-06-30 22:24:48 +08:00
68806e1190 fix: use fragmented MP4 for crash-safe HLS live stream recording
-movflags +faststart requires ffmpeg to write moov atom at the end,
which fails when SIGINT interrupts a live HLS recording — the mp4
file has no moov atom and is unplayable (0 bytes effective).

Switch to -movflags +frag_keyframe+empty_moov+default_base_moof
(fragmented MP4): moov atom written immediately at file start,
each segment is self-contained. Even if ffmpeg is killed mid-recording,
the file remains fully playable with both video and audio intact.

Verified: HLS live stream (CBS News) → 45s 1280x720 h264 + AAC 48kHz,
13MB, SIGINT-safe. Local files unaffected.
2026-06-29 23:58:31 +08:00
7263f2d837 fix: re-encode audio to AAC instead of copy for mp4 compatibility
-c copy may produce mp4 files with AC3/DTS/FLAC audio that macOS
AVPlayer cannot decode, resulting in silent playback.
Change to -c:v copy -c:a aac -b:a 192k to preserve video quality
while ensuring universally playable audio.
2026-06-29 23:51:19 +08:00
7d89a332ff fix: omit -t flag when duration=0; use SIGINT for graceful stop 2026-06-28 21:46:38 +08:00
71d321b056 refactor: 跨平台架构 (macOS+iOS)
- StreamRecorderKit: 跨平台库
  - StreamRecorderEngine: 协议+类型
  - HLSVariantResolver: HLS master 解析
  - FFmpegRecorder: macOS (Process+ffmpeg)
  - AVFoundationRecorder: iOS (AVAssetReader+Writer)
  - RecorderFactory: 平台工厂
- StreamRecorder: CLI 入口
- 15秒录制测试通过
2026-06-28 17:49:12 +08:00