fix capture timing and gif size cap
- capture declares -framerate 999 to accept all frames without dropping - after capture stops, measure actual delivery rate from frame count / elapsed time - re-encode intermediate file with correct fps via stream copy (no quality loss) - same fix applied to pause_capture segments - gif: remove 15% size tolerance - never exceed target size
This commit is contained in:
+1
-10
@@ -397,16 +397,7 @@ fn encode_gif(ffmpeg: &Path, req: &TranscodeRequest) -> Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Only adjust DOWN when file is too big
|
||||
// Accept within 15% over target
|
||||
if ratio >= 0.85 {
|
||||
tracing::info!(
|
||||
"gif encode done on attempt {}: {} bytes (target {} - close enough)",
|
||||
attempt + 1, actual, target
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// Only adjust DOWN when file is too big - never exceed target
|
||||
// File is too big - scale down based on budget priority
|
||||
match req.gif_budget_mode {
|
||||
GifBudgetMode::Resolution => {
|
||||
|
||||
Reference in New Issue
Block a user