Spaces:
Running on Zero
Running on Zero
Support final-frame trimming across FFmpeg versions
Browse filesKeep passthrough timestamps without an incompatible output-rate option. Preserve exactly N-1 decoded frames and audio timing. Generation and calculators are unchanged.
- end_frame_trim.py +1 -1
end_frame_trim.py
CHANGED
|
@@ -83,7 +83,7 @@ def trim_last_video_frame(input_path: str, output_path: str | None = None) -> st
|
|
| 83 |
f"trim=end_frame={frames - 1},pad=ceil(iw/2)*2:ceil(ih/2)*2",
|
| 84 |
"-af", f"atrim=end={cutoff:.12f}",
|
| 85 |
"-c:v", "libx264", "-preset", "fast", "-crf", "18", "-bf", "0", "-pix_fmt", "yuv420p",
|
| 86 |
-
"-c:a", "aac", "-b:a", "192k", "-vsync", "0",
|
| 87 |
"-movflags", "+faststart",
|
| 88 |
temporary])
|
| 89 |
if not Path(temporary).is_file() or Path(temporary).stat().st_size == 0:
|
|
|
|
| 83 |
f"trim=end_frame={frames - 1},pad=ceil(iw/2)*2:ceil(ih/2)*2",
|
| 84 |
"-af", f"atrim=end={cutoff:.12f}",
|
| 85 |
"-c:v", "libx264", "-preset", "fast", "-crf", "18", "-bf", "0", "-pix_fmt", "yuv420p",
|
| 86 |
+
"-c:a", "aac", "-b:a", "192k", "-vsync", "0",
|
| 87 |
"-movflags", "+faststart",
|
| 88 |
temporary])
|
| 89 |
if not Path(temporary).is_file() or Path(temporary).stat().st_size == 0:
|