Homemade ffmpeg + FastAPI replacement for tdarr. Auto-encodes a media library to size-capped x265 mkv with a small live web UI.
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. |
||
|---|---|---|
| app | ||
| docker-compose.yml | ||
| Dockerfile | ||