From 5d9465551e3654928aa4c9658ab91449b6868ed1 Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Thu, 19 Dec 2024 20:13:42 +0100 Subject: [PATCH 1/2] Makefile: add other tasks to PHONY --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 89d81a7..a27b502 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: dev run-tests +.PHONY: dev run-tests run-e2e-tests publish-release PATHS = open_dubbing/ tests/ e2e-tests/ From 58db5e943a7af448266e65e852d010db20f6f482 Mon Sep 17 00:00:00 2001 From: Jordi Mas Date: Thu, 19 Dec 2024 21:16:45 +0100 Subject: [PATCH 2/2] Do not fail dubbing process if subtitles cannot be added --- open_dubbing/ffmpeg.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/open_dubbing/ffmpeg.py b/open_dubbing/ffmpeg.py index f619e7c..23b998d 100644 --- a/open_dubbing/ffmpeg.py +++ b/open_dubbing/ffmpeg.py @@ -93,7 +93,7 @@ def embed_subtitles( video_file: str, subtitles_files: List[str], languages_iso_639_3: List[str], - ) -> str: + ): filename = "" with tempfile.NamedTemporaryFile(delete=False) as temp_file: shutil.copyfile(video_file, temp_file.name) @@ -131,14 +131,12 @@ def embed_subtitles( logging.debug(f"embed_subtitles. Command: {' '.join(cmd)}") # Run the command using the _run method - self._run(command=cmd, fail=True) + self._run(command=cmd, fail=False) filename = temp_file.name if os.path.exists(filename): os.remove(filename) - return output_file - @staticmethod def is_ffmpeg_installed(): cmd = ["ffprobe", "-version"]