Use current directory for default output

This commit is contained in:
hbrain 2026-05-25 00:56:49 +00:00
parent 352ba163ca
commit 10e9c5fae1
2 changed files with 8 additions and 8 deletions

View file

@ -126,7 +126,7 @@ With options:
```bash ```bash
python3 movmaker.py input \ python3 movmaker.py input \
--out-dir out \ --out-dir . \
--image-duration 6 \ --image-duration 6 \
--fade 3 \ --fade 3 \
--audio-fade 10 \ --audio-fade 10 \
@ -159,7 +159,7 @@ python3 movmaker.py input --preview
- adds persistent bottom-left title/date/place and bottom-right `@bubulescu` stamps - adds persistent bottom-left title/date/place and bottom-right `@bubulescu` stamps
- writes safe ASCII text in rendered overlays and metadata, so special letters become readable equivalents like `Č` -> `C`, `å` -> `a`, `ø` -> `o` - writes safe ASCII text in rendered overlays and metadata, so special letters become readable equivalents like `Č` -> `C`, `å` -> `a`, `ø` -> `o`
- embeds MP4 metadata: title, date, location, artist, comment, and creation_time - embeds MP4 metadata: title, date, location, artist, comment, and creation_time
- writes an MP4 file named like `YYYYMMDD_title.mp4` by default - writes an MP4 file named like `YYYYMMDD_title.mp4` in the current directory by default
- takes `YYYYMMDD` from the first picture/video metadata, falling back to file modification date - takes `YYYYMMDD` from the first picture/video metadata, falling back to file modification date
- uses local `ffmpeg/ffmpeg` and `ffmpeg/ffprobe` when present, otherwise system tools - uses local `ffmpeg/ffmpeg` and `ffmpeg/ffprobe` when present, otherwise system tools

View file

@ -398,7 +398,7 @@ def build_video(
nonlocal text_file_count nonlocal text_file_count
path = text_dir / f"drawtext_{text_file_count:04d}.txt" path = text_dir / f"drawtext_{text_file_count:04d}.txt"
text_file_count += 1 text_file_count += 1
path.write_text(ascii_safe(text), encoding="utf-8") path.write_text(text, encoding="utf-8")
return f"textfile='{path}':expansion=none" return f"textfile='{path}':expansion=none"
cmd = [tool_path(FFMPEG, "ffmpeg"), "-y"] cmd = [tool_path(FFMPEG, "ffmpeg"), "-y"]
@ -541,9 +541,9 @@ def build_video(
cmd += ["-filter_complex", ";".join(filters), "-map", f"[{final_label}]"] cmd += ["-filter_complex", ";".join(filters), "-map", f"[{final_label}]"]
metadata = { metadata = {
"title": ascii_safe(data.title), "title": data.title,
"date": ascii_safe(data.date), "date": data.date,
"location": ascii_safe(data.place), "location": data.place,
"artist": "@bubulescu", "artist": "@bubulescu",
"comment": "Created with movmaker", "comment": "Created with movmaker",
"creation_time": creation_date.isoformat(), "creation_time": creation_date.isoformat(),
@ -567,8 +567,8 @@ def build_video(
def main(argv: list[str] | None = None) -> int: def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description="Make a video from a flat folder of images/videos/audio.") parser = argparse.ArgumentParser(description="Make a video from a flat folder of images/videos/audio.")
parser.add_argument("input", type=Path, help="flat input directory") parser.add_argument("input", type=Path, help="flat input directory")
parser.add_argument("--output", "-o", type=Path, help="output mp4 path; defaults to out/YYYYMMDD_title.mp4") parser.add_argument("--output", "-o", type=Path, help="output mp4 path; defaults to YYYYMMDD_title.mp4 in the current directory")
parser.add_argument("--out-dir", type=Path, default=Path("out"), help="directory for auto-named output videos") parser.add_argument("--out-dir", type=Path, default=Path("."), help="directory for auto-named output videos")
parser.add_argument("--image-duration", type=float, default=6.0, help="seconds each image is visible") parser.add_argument("--image-duration", type=float, default=6.0, help="seconds each image is visible")
parser.add_argument("--fade", type=float, default=3.0, help="crossfade duration in seconds") parser.add_argument("--fade", type=float, default=3.0, help="crossfade duration in seconds")
parser.add_argument("--audio-fade", type=float, default=10.0, help="music fade-out duration in seconds") parser.add_argument("--audio-fade", type=float, default=10.0, help="music fade-out duration in seconds")