Keep MVLog render temp files in work directory
This commit is contained in:
parent
1c84a7cfa0
commit
55a1e457c1
3 changed files with 40 additions and 9 deletions
|
|
@ -1334,6 +1334,7 @@ def main(argv: list[str] | None = None) -> int:
|
|||
parser.add_argument("--preset", default="veryfast", help="x264 speed preset, e.g. ultrafast, superfast, veryfast")
|
||||
parser.add_argument("--crf", type=int, default=20, help="x264 quality; lower is better/larger, higher is faster/smaller")
|
||||
parser.add_argument("--jobs", type=int, default=1, help="parallel clip preparation jobs; try 2 on Raspberry Pi")
|
||||
parser.add_argument("--tmp-dir", type=Path, default=Path(os.environ["MOVMAKER_TMPDIR"]) if os.environ.get("MOVMAKER_TMPDIR") else None, help="directory for large temporary render files; defaults to TMPDIR/tempfile")
|
||||
parser.add_argument("--preview", action="store_true", help="fast preview: 1280x720, 24 fps, ultrafast, CRF 28")
|
||||
parser.add_argument("--music-genre", default="cinematic punk rock", help="Jamendo music search query used only when input has no audio files")
|
||||
args = parser.parse_args(argv)
|
||||
|
|
@ -1377,6 +1378,10 @@ def main(argv: list[str] | None = None) -> int:
|
|||
audio_files.append(downloaded_audio)
|
||||
|
||||
output = default_output_path(media[0].path, data, args.out_dir)
|
||||
temp_dir = args.tmp_dir
|
||||
if temp_dir is not None:
|
||||
temp_dir.mkdir(parents=True, exist_ok=True)
|
||||
console(f"Temp dir: {temp_dir}")
|
||||
|
||||
# Image duration means fully visible time, not including crossfades.
|
||||
# Middle images need both a fade-in and fade-out added to their clip length.
|
||||
|
|
@ -1402,7 +1407,7 @@ def main(argv: list[str] | None = None) -> int:
|
|||
if data.title or data.date or data.place:
|
||||
console("Title data: " + " | ".join(x for x in [data.title, data.date, data.place] if x))
|
||||
|
||||
with tempfile.TemporaryDirectory(prefix="movmaker-") as tmp_name:
|
||||
with tempfile.TemporaryDirectory(prefix="movmaker-", dir=temp_dir) as tmp_name:
|
||||
tmp = Path(tmp_name)
|
||||
jobs = max(1, args.jobs)
|
||||
clips = [tmp / f"clip_{idx:04d}.mp4" for idx in range(len(media))]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue