Skip to content

Commit

Permalink
fixed framerate issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan-Datta committed Nov 6, 2024
1 parent 948a9b7 commit ca4b1f1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/video/mp4-recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def record_zed_to_mp4(output_file="output.mp4", fps=30, duration=10):

# Main loop
frame_count = int(duration * fps)
start_time = time.time()
for i in range(frame_count):
# Grab the current image
if zed.grab(runtime_parameters) == sl.ERROR_CODE.SUCCESS:
Expand All @@ -55,15 +54,14 @@ def record_zed_to_mp4(output_file="output.mp4", fps=30, duration=10):
video_writer.write(frame)

# Print status update
elapsed_time = time.time() - start_time
elapsed_time = i / fps
print(f"\rRecording... {elapsed_time:.2f}/{duration} seconds", end='')

# # Optional: Display the frame (press 'q' to exit early)
# cv2.imshow("ZED Video", frame)
# if cv2.waitKey(1) & 0xFF == ord('q'):
# break


else:
print("Frame grab failed")
break
Expand Down

0 comments on commit ca4b1f1

Please sign in to comment.