master
Michael Murtaugh 8 years ago
parent 7f85a36c57
commit 916d8ff25d

@ -1,4 +1,4 @@
#!/usr/bin/env python #!/usr/bin/python
import subprocess import subprocess

@ -67,7 +67,7 @@ print Template(u"""<html>
<div class="movies"> <div class="movies">
{% for i in items %} {% for i in items %}
<a href="../clips/{{i.mp4}}"><img src="../clips/{{i.jpg}}" /></a> <a href="/static/gait/{{i.mp4}}"><img src="/static/gait/{{i.jpg}}" /></a>
<p>{{i.mp4}}</p> <p>{{i.mp4}}</p>
{% endfor %} {% endfor %}
</div> </div>

@ -11,8 +11,8 @@ from picamera import PiCamera
p = ArgumentParser("") p = ArgumentParser("")
p.add_argument("--video", type=int, default=0, help="video, default: 0") p.add_argument("--video", type=int, default=0, help="video, default: 0")
p.add_argument("--output", default=None, help="path to save movie, default: None (show live)") p.add_argument("--output", default=None, help="path to save movie, default: None (show live)")
p.add_argument("--width", type=int, default=640, help="pre-detect resize width") p.add_argument("--width", type=int, default=160, help="pre-detect resize width")
p.add_argument("--height", type=int, default=480, help="pre-detect resize height") p.add_argument("--height", type=int, default=128, help="pre-detect resize height")
p.add_argument("--fourcc", default="XVID", help="MJPG,mp4v,XVID") p.add_argument("--fourcc", default="XVID", help="MJPG,mp4v,XVID")
p.add_argument("--framerate", type=float, default=25, help="output frame rate") p.add_argument("--framerate", type=float, default=25, help="output frame rate")
p.add_argument("--show", default=False, action="store_true") p.add_argument("--show", default=False, action="store_true")
@ -20,9 +20,9 @@ p.add_argument("--frames", type=int, default=100)
args = p.parse_args() args = p.parse_args()
fourcc = None fourcc = None
cam = cv2.VideoCapture(args.video) #cam = cv2.VideoCapture(args.video)
cam.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, args.width) #cam.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, args.width)
cam.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, args.height) #cam.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, args.height)
if args.output: if args.output:
try: try:
@ -36,7 +36,7 @@ else:
print ("Starting camera", file=sys.stderr) print ("Starting camera", file=sys.stderr)
cam = PiCamera() cam = PiCamera()
framesize = (160, 128) framesize = (args.width, args.height)
cam.resolution = framesize cam.resolution = framesize
cam.framerate = 32 cam.framerate = 32
rawCapture = PiRGBArray(cam, size=framesize) rawCapture = PiRGBArray(cam, size=framesize)

Loading…
Cancel
Save