001-video-wall #52
@@ -263,7 +263,8 @@ pub async fn generate_preview_clip(input_file: &str, output_file: &str) -> Resul
|
|||||||
|
|
||||||
if duration < 1.0 {
|
if duration < 1.0 {
|
||||||
// Very short video (<1s): transcode the whole thing to 480p MP4
|
// Very short video (<1s): transcode the whole thing to 480p MP4
|
||||||
cmd.args(["-vf", "scale=-2:480"]);
|
// format=yuv420p ensures 10-bit sources are converted to 8-bit for h264_nvenc
|
||||||
|
cmd.args(["-vf", "scale=-2:480,format=yuv420p"]);
|
||||||
} else {
|
} else {
|
||||||
let segment_count = if duration < 10.0 {
|
let segment_count = if duration < 10.0 {
|
||||||
duration.floor() as u32
|
duration.floor() as u32
|
||||||
@@ -272,8 +273,9 @@ pub async fn generate_preview_clip(input_file: &str, output_file: &str) -> Resul
|
|||||||
};
|
};
|
||||||
let interval = duration / segment_count as f64;
|
let interval = duration / segment_count as f64;
|
||||||
|
|
||||||
|
// format=yuv420p ensures 10-bit sources are converted to 8-bit for h264_nvenc
|
||||||
let vf = format!(
|
let vf = format!(
|
||||||
"select='lt(mod(t,{:.4}),1)',setpts=N/FRAME_RATE/TB,fps=30,scale=-2:480",
|
"select='lt(mod(t,{:.4}),1)',setpts=N/FRAME_RATE/TB,fps=30,scale=-2:480,format=yuv420p",
|
||||||
interval
|
interval
|
||||||
);
|
);
|
||||||
let af = format!(
|
let af = format!(
|
||||||
|
|||||||
Reference in New Issue
Block a user