Created
November 28, 2019 03:56
-
-
Save steveatinfincia/796a01f0c269225970a264f6832b8085 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import picamera | |
import subprocess | |
from time import sleep | |
proc = subprocess.Popen([ | |
'/usr/bin/gst-launch-1.0', | |
'fdsrc', '!', | |
'h264parse', '!', | |
'rtph264pay', 'config-interval=1', 'pt=96', '!', | |
'udpsink', 'host=192.168.40.14', 'port=5600' | |
], stdin=subprocess.PIPE) | |
# initialize the camera | |
camera = picamera.PiCamera(resolution=(1280, 720), framerate=30) | |
# start recording to ffmpeg's stdin | |
camera.start_recording(proc.stdin, format='h264', bitrate=2000000) | |
current_brightness = 40 | |
while True: | |
if current_brightness == 40: | |
current_brightness = 50 | |
else: | |
current_brightness = 40 | |
camera.brightness = current_brightness | |
sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment