VMware ESXi and vSphere Cluster Management

Record Slow-Motion Video with a Raspberry Pi Camera

Learn how to record 640 × 480 video at 90 fps with raspivid, install VLC, and understand playback, lighting, storage, and camera limitations.

Slow motion is created by recording more frames each second than you intend to show during playback. For example, a camera recording at 90 frames per second (fps) captures three times as many frames as a 30 fps presentation. If those frames are later displayed at 30 fps, the action takes three times longer and appears slowed.

This lesson uses the Raspberry Pi Camera Module and the legacy raspivid command-line utility. The example records a 640 × 480 clip at 90 fps for 10 seconds.

How slow motion works

A frame is one still image in a video. Frame rate is the number of frames captured or displayed each second, measured in frames per second, or fps. A video’s resolution is the size of each frame in pixels, written as width × height.

Two frame rates matter:

  • Capture frame rate: how many frames the camera records each second.
  • Playback frame rate: how quickly a player displays those recorded frames.

Suppose an event lasts one real second and is captured at 90 fps. The recording contains 90 frames. If a player displays those frames at 30 fps, it needs three seconds to show them all. The result is a three-times slow-motion effect.

Recording at a high frame rate does not automatically guarantee that every player will show the video slowly. Some players may use the recorded timing or interpret the stream differently. High-frame-rate capture supplies the source footage; playback or conversion must use a lower target frame rate to produce a visibly slowed result.

Camera hardware and recording modes

The required capture hardware is a Raspberry Pi Camera Module connected to the Raspberry Pi. High-frame-rate recording depends on the camera hardware, Raspberry Pi model, and selected resolution. In general, higher frame rates require lower resolutions.

For this example, use a supported mode of 640 × 480 at 90 fps. Check the modes supported by your particular camera before changing these values. A camera or operating system that does not support this mode may reject the command or record at a different setting.

Record a 10-second slow-motion source clip

raspivid is a legacy Raspberry Pi Camera command-line application for recording H.264 video. Its settings are supplied as command options in the terminal.

raspivid -w 640 -h 480 -fps 90 -t 10000 -o slowMotion.h264

This command records a 640 × 480 video at 90 fps for 10 seconds and writes it to slowMotion.h264. The output is a raw H.264 elementary video stream.

OptionPurposeExample value
-wSets the frame width in pixels.-w 640
-hSets the frame height in pixels.-h 480
-fpsSets the capture frame rate in frames per second.-fps 90
-tSets the recording duration in milliseconds.-t 10000
-oSets the output filename.-o slowMotion.h264

Understanding the duration value

The -t option uses milliseconds. One second is 1,000 milliseconds, so 10 seconds is 10,000 milliseconds:

10 seconds × 1,000 milliseconds = 10,000 milliseconds

Where the file is saved

slowMotion.h264 is a relative filename because it does not include a directory path. The file is saved in the terminal’s current working directory—the directory from which you ran raspivid. Use pwd to see that directory and ls to check for the file.

pwd
ls -l slowMotion.h264
ResolutionCapture frame rateRecording durationOutput fileUse case
640 × 48090 fps10 secondsslowMotion.h264Basic slow-motion demonstration

Play the recorded H.264 video

VLC is a media player that can open many video formats, including H.264 streams. Install it from the Raspberry Pi terminal with:

sudo apt-get install vlc

Run this command with an internet connection and an account allowed to install packages. After installation, open the file from the directory where it was created:

vlc slowMotion.h264

You can also open VLC from the desktop and select the generated file. If the file is not found, confirm the current directory with pwd and list its contents with ls. An H.264 elementary stream may contain less playback metadata than a packaged video file, so compatibility can depend on the player and playback workflow. If necessary, use a compatible player or package or convert the stream for your target environment.

Lighting, storage, and other tradeoffs

  • Resolution versus frame rate: High frame rates commonly require lower resolutions. Reducing the width or height can make a requested mode available.
  • Lighting: At 90 fps, each frame has less time available for exposure. A dark scene may therefore produce noisy, dark, or blurry footage. Use a well-lit scene.
  • Motion and focus: Fast movement and incorrect focus can make footage appear blurry. Check focus and camera placement before recording.
  • Storage: Longer recordings create larger output files. Check available storage before starting an extended capture.
  • Output format: raspivid produces a raw H.264 elementary stream. Consider the playback or conversion workflow you will use before recording many clips.

Troubleshooting

The camera command cannot access the camera

  • Check the Camera Module ribbon cable orientation and make sure both connections are secure.
  • Confirm that the camera interface is detected and enabled where required by the legacy Raspberry Pi setup.
  • Verify that the operating system provides the legacy raspivid utility. Some environments use different camera applications and do not include it.

The requested high frame rate is unavailable

The selected resolution may be too high for 90 fps, or the camera and Raspberry Pi model may support different modes. Reduce the resolution and check the supported modes for the specific hardware.

The video is dark or blurry

Increase ambient lighting because high-frame-rate capture shortens the exposure available for each frame. Also check focus, camera stability, and the speed of movement in the scene.

The video does not look slow

The player may be presenting the stream at its recorded timing rather than showing it at a lower target frame rate. Remember that the command creates high-frame-rate source footage. Use playback or conversion settings that present the footage at a conventional lower frame rate when a slowed result is required.

VLC does not open the file

  • Install VLC with sudo apt-get install vlc if it is not already installed.
  • Confirm the filename and location with pwd and ls -l slowMotion.h264.
  • Try a compatible player or package or convert the H.264 elementary stream if the selected playback workflow requires additional metadata.

Key points

  • Slow motion comes from capturing at a higher frame rate than the intended playback rate.
  • raspivid can record the example mode with -w 640 -h 480 -fps 90 -t 10000 -o slowMotion.h264.
  • The -t duration value is measured in milliseconds.
  • A relative output filename saves the file in the current working directory.
  • High frame rates usually trade resolution and light sensitivity for more motion samples.

For this Raspberry Pi Camera workflow, see recording videos in slow motion.