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 <noreply@anthropic.com>
This commit is contained in:
1 parent
0b87320ef7
commit
985f366bc2
2 files changed
+3
-33
No files matched your search
+2
-1
@@ -155,7 +155,8 @@ pub fn beat_filtergraph(opts: &SegmentOpts, per_photo: &[f64]) -> String {
|
||||
|
||||
fn video_encoder_args(nvenc: bool) -> Vec<String> {
|
||||
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",
|
||||
|
||||
+1
-32
@@ -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<String> {
|
||||
let ffmpeg_result: Result<Output> = 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<u32> {
|
||||
Command::new("ffprobe")
|
||||
.args(["-i", input_file])
|
||||
|
||||
Reference in new issue
Block a user