Bird
0
0
Raspberry Piprogramming~10 mins

Recording video in Raspberry Pi - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start recording video using the PiCamera.

Raspberry Pi
from picamera import PiCamera
camera = PiCamera()
camera.[1]('video.h264')
Drag options to blanks, or click blank then click option'
Acapture
Bstop_recording
Cstart_recording
Dpreview
Attempts:
3 left
💡 Hint
Common Mistakes
Using stop_recording instead of start_recording.
Using capture which is for photos, not video.
2fill in blank
medium

Complete the code to stop recording video.

Raspberry Pi
from picamera import PiCamera
camera = PiCamera()
camera.start_recording('video.h264')
# After some time
camera.[1]()
Drag options to blanks, or click blank then click option'
Astop_recording
Bstart_recording
Ccapture
Dwait_recording
Attempts:
3 left
💡 Hint
Common Mistakes
Using start_recording again instead of stop_recording.
Using capture which is for photos.
3fill in blank
hard

Fix the error in the code to record a 5-second video.

Raspberry Pi
from picamera import PiCamera
import time
camera = PiCamera()
camera.start_recording('video.h264')
time.[1](5)
camera.stop_recording()
Drag options to blanks, or click blank then click option'
Adelay
Bsleep
Cpause
Dwait
Attempts:
3 left
💡 Hint
Common Mistakes
Using time.wait or time.pause which do not exist.
Not pausing the program, so recording stops immediately.
4fill in blank
hard

Fill both blanks to record a video with resolution 640x480 and framerate 24.

Raspberry Pi
from picamera import PiCamera
camera = PiCamera()
camera.[1] = (640, 480)
camera.[2] = 24
camera.start_recording('video.h264')
Drag options to blanks, or click blank then click option'
Aresolution
Bframerate
Cbrightness
Dcontrast
Attempts:
3 left
💡 Hint
Common Mistakes
Using brightness or contrast instead of resolution or framerate.
Setting properties after starting recording.
5fill in blank
hard

Fill all three blanks to record a video file named 'myvideo.h264' with resolution 1280x720 and framerate 30.

Raspberry Pi
from picamera import PiCamera
camera = PiCamera()
camera.[1] = (1280, 720)
camera.[2] = 30
camera.start_recording('[3]')
Drag options to blanks, or click blank then click option'
Aresolution
Bframerate
Cmyvideo.h264
Dvideo.h264
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong property names.
Using wrong filename string.
Setting properties after starting recording.