feat(arr): extract text subtitle tracks to srt

ffmpeg, spawned and left to die like ffprobe, maps one subtitle stream
and converts it to SRT under §15's sidecar name. Text formats become
legal translation sources; bitmap tracks never extract.
This commit is contained in:
Miguel Palhas
2026-08-24 22:32:26 +01:00
parent e852f42a9c
commit 0bdf0103bd
6 changed files with 255 additions and 2 deletions
+15
View File
@@ -94,6 +94,21 @@ pub enum Error {
/// among them.
#[error("no video file among the candidates")]
NoCandidates,
/// `ffmpeg` failed extracting a subtitle track — a missing or bitmap
/// stream included, which is how §15's "never extract an image track"
/// surfaces when it is asked for anyway.
#[error("ffmpeg failed extracting subtitle stream {stream} from {path}: {stderr}")]
Extract {
/// The video that was read.
path: PathBuf,
/// The subtitle stream that was mapped.
stream: usize,
/// Exit status, absent when the process was killed by a signal.
status: Option<i32>,
/// `ffmpeg`'s own diagnostics, truncated to something loggable.
stderr: String,
},
}
impl Error {