Skip to content

Instantly share code, notes, and snippets.

@alierkan
Forked from ammani-prop/main.py
Created December 24, 2020 12:41
Show Gist options
  • Save alierkan/688f9f3de2ce390ef455390b01d211a4 to your computer and use it in GitHub Desktop.
Save alierkan/688f9f3de2ce390ef455390b01d211a4 to your computer and use it in GitHub Desktop.
# Import the recording process
from camera_record import record_video
# set recording duration
record_time = 20
# To run this as part of a bigger program, use mutltiprocessing to create a seperate process
# for video recording using the following lines.
from multiprocessing import Process
# The line above can go to the top of your file and the following lines should be placed
# where ever you need to record a video
# Create the process thread object
cam_record = Process(target = record_video, args = (record_time, ))
cam_record.start()
# The following statement waits till the process is completed before going to the next line of code
cam_record.join()
cam_record.close()
# If recording a video is not part of a bigger program then you don't need to use multiprocesing
# and can comment out the last 4 lines and uncomment the next line
#record_time(record_time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment