website.p1 module
- class website.p1.VideoRecorder[source]
Bases:
objectA class to handle video recording, frame capturing, and live feed display.
- recording
True if recording is active.
- Type:
bool
- show_feed
True if live camera feed is being displayed.
- Type:
bool
- video_writer
OpenCV video writer object.
- Type:
cv2.VideoWriter
- capture
OpenCV camera capture object.
- Type:
cv2.VideoCapture
- output_filename
Filename for saved video.
- Type:
str
- frame_timestamps
Timestamps for each recorded frame.
- Type:
list
- close_feed()[source]
Close the live camera feed display and stop the display thread if not recording.
- setup_camera()[source]
Initialize the camera.
- Returns:
True if camera initialized successfully, False otherwise.
- Return type:
bool
- start_recording()[source]
Start recording video. Saves video to a timestamped file and stores frame timestamps.
- website.p1.command_listener(recorder, conn)[source]
Continuously listen for commands from the parent program and execute them.
- Parameters:
recorder (VideoRecorder) – Instance to execute commands.
conn (multiprocessing.Connection) – Pipe connection to communicate with parent.
- website.p1.handle_command(recorder, command, conn)[source]
Handle a command string received from the parent program.
- Parameters:
recorder (VideoRecorder) – Instance of VideoRecorder to execute commands.
command (str) – Command string.
conn (multiprocessing.Connection) – Pipe connection to send back responses.