Skip to content

Instantly share code, notes, and snippets.

@benoxoft
Created September 13, 2014 23:27
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 benoxoft/2ff18d8fead052a217ae to your computer and use it in GitHub Desktop.
Save benoxoft/2ff18d8fead052a217ae to your computer and use it in GitHub Desktop.
import cv2
import cv2.cv as cv
import sys
#python capture.py | ffmpeg -f rawvideo -pix_fmt rgb24 -s 320x240 -r 30 -i - -an -f mpeg1video -b 800k -r 30 http://127.0.0.1:8082/patate/320/240
video = cv2.VideoCapture(0)
def pipe_images():
run, img = video.read()
img = cv2.resize(img, (320,240))
img = cv2.cvtColor(img, cv.CV_BGR2RGB)
sys.stdout.write(img.data)
if __name__ == '__main__':
while True:
pipe_images()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment