Re-encode src (mp4v) → dst (H.264). Returns True on success.
(src: Path, dst: Path)
| 37 | |
| 38 | |
| 39 | def _transcode(src: Path, dst: Path) -> bool: |
| 40 | """Re-encode src (mp4v) → dst (H.264). Returns True on success.""" |
| 41 | result = subprocess.run([ |
| 42 | "ffmpeg", "-y", "-i", str(src), |
| 43 | "-vcodec", "libx264", "-crf", "23", "-preset", "fast", |
| 44 | "-movflags", "+faststart", |
| 45 | str(dst), |
| 46 | ], capture_output=True) |
| 47 | return result.returncode == 0 and dst.exists() and dst.stat().st_size > 0 |
| 48 | |
| 49 | |
| 50 | def _upload(local_path: Path, dest: str, url_base: str, key: str) -> bool: |