Bird
0
0

You want to record a video on Raspberry Pi that automatically stops after 10 seconds without using time.sleep(). Which method should you use to control recording duration?

hard🚀 Application Q15 of 15
Raspberry Pi - Camera Module
You want to record a video on Raspberry Pi that automatically stops after 10 seconds without using time.sleep(). Which method should you use to control recording duration?
AUse <code>camera.wait_recording(10)</code> after <code>start_recording()</code>
BUse <code>time.sleep(10)</code> before <code>start_recording()</code>
CCall <code>stop_recording()</code> immediately after <code>start_recording()</code>
DUse <code>camera.record_for(10)</code> method
Step-by-Step Solution
Solution:
  1. Step 1: Understand wait_recording() usage

    This method pauses the program while continuing recording, allowing precise control without blocking the whole program.
  2. Step 2: Compare with other options

    time.sleep(10) pauses the entire program, stop_recording() immediately stops recording, and record_for() does not exist.
  3. Final Answer:

    Use camera.wait_recording(10) after start_recording() -> Option A
  4. Quick Check:

    wait_recording() controls duration without sleep [OK]
Quick Trick: Use wait_recording() to record timed video without sleep [OK]
Common Mistakes:
MISTAKES
  • Using sleep() which blocks whole program
  • Calling stop_recording() too soon
  • Assuming record_for() method exists

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes