diff --git a/src/video/actors.rs b/src/video/actors.rs index 7722a5d..cfe2aa7 100644 --- a/src/video/actors.rs +++ b/src/video/actors.rs @@ -108,15 +108,27 @@ pub async fn create_playlist(video_path: &str, playlist_file: &str) -> Result std::io::Result<()> { + // -vf scale + -c:v mjpeg mirrors `generate_image_thumbnail_ffmpeg`. The + // filter chain matters as much as the scale does: without it, ffmpeg + // hands the decoded frame straight to the mjpeg encoder, which rejects + // any non-yuvj420p source ("Non full-range YUV is non-standard"). The + // filter chain lets ffmpeg auto-insert the pix_fmt converter the + // encoder needs, which is how the image-thumbnail path already handles + // the same class of source. let output = Command::new("ffmpeg") + .arg("-y") .arg("-ss") .arg("3") .arg("-i") .arg(path) .arg("-vframes") .arg("1") + .arg("-vf") + .arg("scale=200:-1") .arg("-f") .arg("image2") + .arg("-c:v") + .arg("mjpeg") .arg(destination) .output()?;