setting up camera controls!
This commit is contained in:
parent
a93434251c
commit
86be5bf621
12
readme.md
12
readme.md
@ -22,4 +22,14 @@ screensaver = false
|
|||||||
dpms = false
|
dpms = false
|
||||||
|
|
||||||
|
|
||||||
maybe take security steps? disable keyboards? how are we gonna secure this?
|
maybe take security steps? disable keyboards? how are we gonna secure this? zipties.
|
||||||
|
|
||||||
|
$ v4l2-ctl --list-ctrls-menus
|
||||||
|
$ v4l2-ctl -c brightness=64
|
||||||
|
$ v4l2-ctl -c contrast=65
|
||||||
|
|
||||||
|
set screen resolution to 1280x720 (720p)
|
||||||
|
|
||||||
|
install flatpak, install cameractls?
|
||||||
|
|
||||||
|
cameractrls exists in the start menu in the "office" section for some reason. i think we're ready
|
||||||
|
11
webcam.py
11
webcam.py
@ -13,7 +13,7 @@ def five_minute_segment_from(the_time):
|
|||||||
|
|
||||||
|
|
||||||
def path_to_video_at(time_stamp):
|
def path_to_video_at(time_stamp):
|
||||||
return 'videos/' + str(time_stamp) + '.mkv' # mkv required for h264 encoding
|
return 'videos/' + str(time_stamp) + '.mp4' # mkv required for h264 encoding
|
||||||
|
|
||||||
#delay for long delay
|
#delay for long delay
|
||||||
long_delay = timedelta(minutes=1)
|
long_delay = timedelta(minutes=1)
|
||||||
@ -27,7 +27,10 @@ if not camera.isOpened():
|
|||||||
exit()
|
exit()
|
||||||
|
|
||||||
# video writer
|
# video writer
|
||||||
fourcc = cv2.VideoWriter_fourcc(*'x264')
|
|
||||||
|
|
||||||
|
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
||||||
|
camera.set(cv2.CAP_PROP_FPS, 60.0)
|
||||||
camera_fps = camera.get(cv2.CAP_PROP_FPS)
|
camera_fps = camera.get(cv2.CAP_PROP_FPS)
|
||||||
camera.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
|
camera.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
|
||||||
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
|
camera.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
|
||||||
@ -35,7 +38,7 @@ video_writer = cv2.VideoWriter(path_to_video_at(last_time_stamp),
|
|||||||
fourcc,
|
fourcc,
|
||||||
camera_fps,
|
camera_fps,
|
||||||
(int(camera.get(3)),int(camera.get(4))), #resolution
|
(int(camera.get(3)),int(camera.get(4))), #resolution
|
||||||
|
(cv2.VIDEOWRITER_PROP_HW_ACCELERATION, cv2.VIDEO_ACCELERATION_ANY)
|
||||||
)
|
)
|
||||||
|
|
||||||
# video feed from previously captured video
|
# video feed from previously captured video
|
||||||
@ -109,7 +112,7 @@ with gpiod.request_lines(
|
|||||||
last_time_stamp = five_minute_segment_from(datetime.now())
|
last_time_stamp = five_minute_segment_from(datetime.now())
|
||||||
|
|
||||||
ret, frame = camera.read()
|
ret, frame = camera.read()
|
||||||
frame = cv2.flip(frame, 1)
|
#frame = cv2.flip(frame, 1)
|
||||||
# record the frame to the appropriate file, and also to the short term buffer
|
# record the frame to the appropriate file, and also to the short term buffer
|
||||||
video_writer.write(frame)
|
video_writer.write(frame)
|
||||||
queue[idx] = ret, frame
|
queue[idx] = ret, frame
|
||||||
|
Loading…
Reference in New Issue
Block a user