Skip to content

Instantly share code, notes, and snippets.

@steveatinfincia
Created November 28, 2019 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steveatinfincia/796a01f0c269225970a264f6832b8085 to your computer and use it in GitHub Desktop.
Save steveatinfincia/796a01f0c269225970a264f6832b8085 to your computer and use it in GitHub Desktop.
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