From ca0f81831735aa274dda7ca4eb5bb1fabf228c90 Mon Sep 17 00:00:00 2001 From: Anna Date: Wed, 4 Jan 2023 17:38:06 +0100 Subject: [PATCH] extension --- movie_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/movie_util.py b/movie_util.py index 94aa223..e120be9 100644 --- a/movie_util.py +++ b/movie_util.py @@ -166,7 +166,7 @@ def concatenate_movies(fp_final: str, list_fp_movies: List[str]): list_fp_movies : list[str] List of full paths of movie segments. """ - assert fp_final.endswith(".mp4"), "fp_final should end with .mp4" + assert fp_final[-4] == ".", "fp_final seems to miss file extension: {fp_final}" for fp in list_fp_movies: assert os.path.isfile(fp), f"Input movie does not exist: {fp}" assert os.path.getsize(fp) > 100, f"Input movie seems empty: {fp}" @@ -218,7 +218,7 @@ if __name__ == "__main__": fps=2 list_fp_movies = [] for k in range(4): - fp_movie = f"/tmp/my_random_movie_{k}.mp4" + fp_movie = f"/tmp/my_random_movie_{k}.mkv" list_fp_movies.append(fp_movie) ms = MovieSaver(fp_movie, fps=fps) for fn in tqdm(range(30)): @@ -226,6 +226,6 @@ if __name__ == "__main__": ms.write_frame(img) ms.finalize() - fp_final = "/tmp/my_concatenated_movie.mp4" + fp_final = "/tmp/my_concatenated_movie.mkv" concatenate_movies(fp_final, list_fp_movies)