Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activities/Turtle Art/Using Turtle Art Sensors
(view source)
Revision as of 05:17, 24 December 2010
3 bytes removed
,
05:17, 24 December 2010
→Capturing with the camera
Line 491:
Line 491:
def myblock(lc, x):
def myblock(lc, x):
import gst, time
import gst, time
−
# grab a frame from camera to file
# grab a frame from camera to file
pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/turtlepic.jpg')
pipeline = gst.parse_launch('v4l2src ! ffmpegcolorspace ! jpegenc ! filesink location=/tmp/turtlepic.jpg')
pipeline.set_state(gst.STATE_PLAYING)
pipeline.set_state(gst.STATE_PLAYING)
−
# pause for a second to allow the camera frame to be grabbed
# pause for a second to allow the camera frame to be grabbed
time.sleep(1)
time.sleep(1)
−
# stop the camera frame grabbing
# stop the camera frame grabbing
pipeline.set_state(gst.STATE_NULL)
pipeline.set_state(gst.STATE_NULL)
Tonyforster
2,486
edits