Skip to content

Commit

Permalink
io.videos.get_first_frame_from_video: replae silent fail by exception
Browse files Browse the repository at this point in the history
  • Loading branch information
walachey committed Jun 29, 2020
1 parent 07eedf7 commit 4c73d34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bb_behavior/io/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def get_first_frame_from_video(vid_file):
capture = cv2.VideoCapture(vid_file)
success, image = capture.read()
if not success:
return None
raise ValueError("Could not read first frame. Is the video file valid? ({})".format(vid_file))
return image

def extract_frames_from_video(video_path, target_directory, start_frame=0, n_frames=1,codec="hevc_cuvid", command="ffmpeg", scale=1.0, framerate=3, output_format="bmp"):
Expand Down

0 comments on commit 4c73d34

Please sign in to comment.