diff --git a/cdp_backend/pipeline/event_gather_pipeline.py b/cdp_backend/pipeline/event_gather_pipeline.py index 042d441c..c50be448 100644 --- a/cdp_backend/pipeline/event_gather_pipeline.py +++ b/cdp_backend/pipeline/event_gather_pipeline.py @@ -334,11 +334,6 @@ def convert_video_and_handle_host( trim_video = bool(session.video_start_time or session.video_end_time) - log.info(f"File to trim: {video_filepath}") - log.info(f"File exists: {Path(video_filepath).exists()}") - if Path(video_filepath).exists(): - log.info(f"File stats: {Path(video_filepath).stat()}") - # Convert to mp4 if file isn't of approved web format cdp_will_host = False if ext not in [".mp4", ".webm"]: @@ -351,7 +346,7 @@ def convert_video_and_handle_host( end_time=session.video_end_time, ) - fs_functions.remove_local_file(video_filepath) + # fs_functions.remove_local_file(video_filepath) # Update variable name for easier downstream typing video_filepath = str(mp4_filepath) @@ -368,7 +363,7 @@ def convert_video_and_handle_host( end_time=session.video_end_time, ) - fs_functions.remove_local_file(video_filepath) + # fs_functions.remove_local_file(video_filepath) # Update variable name for easier downstream typing video_filepath = str(trimmed_filepath) diff --git a/cdp_backend/utils/file_utils.py b/cdp_backend/utils/file_utils.py index 042a7cbb..c2c95f97 100644 --- a/cdp_backend/utils/file_utils.py +++ b/cdp_backend/utils/file_utils.py @@ -609,6 +609,11 @@ def convert_video_to_mp4( The filepath of the converted MP4 video. """ + log.info(f"File to trim: {str(video_filepath)}") + log.info(f"File exists: {video_filepath.exists()}") + if video_filepath.exists(): + log.info(f"File stats: {video_filepath.stat()}") + output_path = output_path or video_filepath.with_suffix(".mp4") output_path = clip_and_reformat_video( video_filepath=video_filepath,