This repository contains two Python modules that facilitate video recording from different sources: internal/external webcams and Tello drones.
This module provides a convenient way to record video from an internal or external webcam using OpenCV in Python.
- Python
- OpenCV (cv2)
- datetime
- os
from video_recorder import record_over_webcam
# Record video from the default internal camera (channel 0)
record_over_webcam(0)
channel (int): The channel number of the camera to record from.
-
The module uses OpenCV for video processing, datetime for timestamping, and os for file operations.
-
It creates a directory named 'recordings' within the current working directory to save the recorded videos.
-
The
record_over_webcam
function records video over the specified webcam feed and saves it for later viewing. It takes the camera channel number as an argument. -
The recorded video is saved in the 'recordings' directory with a unique timestamped filename.
-
The
stream_video
function reads frames from the capture object, writes them to a file using the writer object, and displays them for viewing until the 'q' key is pressed. -
After recording is complete, it releases the video capture, writer, and destroys the display window.
To run the example, simply call the record_over_webcam
function with the desired camera channel as an argument.
record_over_webcam(0)
This module allows you to record video from a Tello drone using the DJITelloPy library and OpenCV in Python.
- Python
- OpenCV (cv2)
- djitellopy
- datetime
from record_tello import record_tello_video
# Connect to Tello drone, record video, and reboot
record_tello_video()
No parameters are required.
-
The module uses OpenCV for video processing, datetime for timestamping, and djitellopy for Tello drone communication.
-
The record_tello_video function connects to a Tello drone, starts video streaming, and records the video to a file.
-
The recorded video is saved with a unique timestamped filename.
-
The recording continues until the 'q' key is pressed.
-
After recording is complete, it closes the video window, releases resources, and reboots the Tello drone.
To run the example, simply call the record_tello_video function.
record_tello_video()
This module is licensed under the MIT License.