Skip to content

Instantly share code, notes, and snippets.

@PatrickKalkman
Created May 26, 2025 13:51
Show Gist options
  • Save PatrickKalkman/4293b7e4798ea514a1ec04eb434d3ac6 to your computer and use it in GitHub Desktop.
Save PatrickKalkman/4293b7e4798ea514a1ec04eb434d3ac6 to your computer and use it in GitHub Desktop.
def encode_outro_segment_core(
video_file_path: str,
duration: float = 600.0, # 10 minutes
# ... other parameters
) -> Optional[str]:
"""Extract the final 10 minutes using ffmpeg's -sseof flag."""
cmd = [
"ffmpeg", "-y",
"-sseof", f"-{duration}", # Start from end minus duration
"-i", str(input_path),
# ... encoding parameters
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment