Homemade ffmpeg + FastAPI replacement for tdarr. Auto-encodes a media library to size-capped x265 mkv with a small live web UI.
Find a file
Filip Kin 7e114f69b2 Track progress by frame instead of out_time_us
ffmpeg 7.x reports out_time_us='N/A' for the entire run on multi-stream
encodes (video + multiple audio + multiple subtitles). Our parser turned
N/A into 0 via _safe_int(), so the DB row's progress_pct sat at 0.000%
for the whole encode while frame and total_size advanced normally. The
UI displayed 0% progress on real, working encodes.

Worse, the watchdog I added in the previous commit tracked out_time_us
advances, so it would have killed every multi-stream encode at the 15
minute mark.

Changes:
- transcode.py: add Probe.fps (parses avg_frame_rate / r_frame_rate,
  falls back to 24.0) and Probe.total_frames.
- transcode.py run_ffmpeg watchdog: track frame counter + total_size,
  reset on either advance. Either signal is sufficient evidence of
  forward progress; both stuck means a genuine hang.
- transcode.py: don't overwrite current.out_time_us when ffmpeg emits
  'N/A' (preserve last good value rather than reset to 0).
- main.py: compute pct from frame / total_frames, ETA from remaining
  frames at source fps divided by reported speed.
2026-05-29 01:38:42 -04:00
app Track progress by frame instead of out_time_us 2026-05-29 01:38:42 -04:00
docker-compose.yml Initial commit: auto-transcode (We have tdarr at home) 2026-05-28 15:56:23 -04:00
Dockerfile Initial commit: auto-transcode (We have tdarr at home) 2026-05-28 15:56:23 -04:00