Skip to content

Commit

Permalink
forward ffmpeg error
Browse files Browse the repository at this point in the history
  • Loading branch information
jwong-nd committed Oct 18, 2024
1 parent b6609d5 commit 3ab3b29
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/aind_behavior_video_transformation/transform_videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def convert_video(self, video_path: Path) -> None:
input_args = param_set[0].value
output_args = param_set[1].value

print(f'{input_args=}')
print(f'{output_args=}')
logging.info(f'{input_args=}')
logging.info(f'{output_args=}')

ffmpeg_command = ["ffmpeg", "-y", "-v", "info"]
if input_args:
Expand All @@ -132,7 +132,15 @@ def convert_video(self, video_path: Path) -> None:
ffmpeg_command.append(str(out_path))

# Run command in subprocess
subprocess.run(ffmpeg_command, check=True)
try:
result = subprocess.run(
ffmpeg_command,
check=True,
stderr=subprocess.PIPE, # Capture stderr
text=True # Get output as string, not bytes
)
except subprocess.CalledProcessError as e:
print(f"Error running FFmpeg: {e.stderr}")

return

Expand Down

0 comments on commit 3ab3b29

Please sign in to comment.