Skip to content

Commit

Permalink
Logging to debug file copy
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjkhan committed Dec 31, 2022
1 parent 606a6fc commit 01595c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cdp_backend/pipeline/event_gather_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand All @@ -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)
Expand All @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions cdp_backend/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 01595c3

Please sign in to comment.