From 985f366bc25f89c3ab675e0597a67bd7d4ea8349 Mon Sep 17 00:00:00 2001 From: Cameron Cordes Date: Tue, 13 Oct 2026 11:07:05 -0400 Subject: [PATCH] chore(video): drop unused Ffmpeg::_generate_playlist, fix reels comment _generate_playlist was a private, never-called predecessor of the HLS path in video/actors.rs. Its leftover args (-hls_list_size 100, width 1080 scale, libx264 only) no longer described how playlists are built. Removing it also drops the now-unused std::process::Output import. The reels encoder comment said its NVENC settings matched the HLS transcode; reels use preset p4, HLS uses p1. Only the quality target (cq 23) is shared. Co-Authored-By: Claude Opus 5.5 --- src/reels/render.rs | 3 ++- src/video/ffmpeg.rs | 33 +-------------------------------- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/reels/render.rs b/src/reels/render.rs index 221df5f..05e3915 100644 --- a/src/reels/render.rs +++ b/src/reels/render.rs @@ -155,7 +155,8 @@ pub fn beat_filtergraph(opts: &SegmentOpts, per_photo: &[f64]) -> String { fn video_encoder_args(nvenc: bool) -> Vec { if nvenc { - // p4 ≈ balanced; cq 23 ≈ libx264 crf 21. Matches the HLS transcode path. + // p4 ≈ balanced; cq 23 ≈ libx264 crf 21. Same quality target as the + // HLS transcode, which uses the faster p1 preset for throughput. [ "-c:v", "h264_nvenc", diff --git a/src/video/ffmpeg.rs b/src/video/ffmpeg.rs index 019bd86..5c88fcd 100644 --- a/src/video/ffmpeg.rs +++ b/src/video/ffmpeg.rs @@ -1,7 +1,7 @@ use futures::TryFutureExt; use log::{debug, error, info, warn}; use std::io::Result; -use std::process::{Output, Stdio}; +use std::process::Stdio; use std::sync::OnceLock; use std::time::Instant; use tokio::process::Command; @@ -47,37 +47,6 @@ pub enum GifType { } impl Ffmpeg { - async fn _generate_playlist(&self, input_file: &str, output_file: &str) -> Result { - let ffmpeg_result: Result = Command::new("ffmpeg") - .arg("-i") - .arg(input_file) - .arg("-c:v") - .arg("h264") - .arg("-crf") - .arg("21") - .arg("-preset") - .arg("veryfast") - .arg("-hls_time") - .arg("3") - .arg("-hls_list_size") - .arg("100") - .arg("-vf") - .arg("scale=1080:-2,setsar=1:1") - .arg(output_file) - .stdout(Stdio::null()) - .stderr(Stdio::piped()) - .output() - .inspect_err(|e| error!("Failed to run ffmpeg on child process: {}", e)) - .map_err(|e| std::io::Error::other(e.to_string())) - .await; - - if let Ok(ref res) = ffmpeg_result { - debug!("ffmpeg output: {:?}", res); - } - - ffmpeg_result.map(|_| output_file.to_string()) - } - async fn get_video_duration(&self, input_file: &str) -> Result { Command::new("ffprobe") .args(["-i", input_file])