Module Reference

Cameras Module

Video capture from CSI cameras (Raspberry Pi) and USB webcams with per-frame timing data.

Each camera runs in its own module instance. Multiple cameras can record simultaneously. USB cameras support optional audio recording.

Getting Started

  1. Connect your cameraCSI ribbon cable or USB.
  2. Enable “Cameras”In the Modules menu.
  3. Camera appearsIn the Devices panel when detected.
  4. Click ConnectTo launch this camera’s window.
  5. Adjust settingsVia the View menu if needed.
  6. Start a sessionTo begin recording.

User Interface

Camera module showing live preview and metrics
RSLOGGER · CAMERAS MODULE
FIG. 01 — CAMERAS MODULE INTERFACE LIVE PREVIEW · METRICS

The preview runs at reduced resolution for performance—this does not affect recording quality.

Metrics Panel

USB CamerasCSI CamerasDescription
HardwareCap In/MaxActual frame rate from camera
RecordRec Out/TgtFrame rate being written to disk
PreviewDisp/TgtDisplay frame rate
AudioAudio recording status

Metrics are color-coded: green (healthy), orange (stressed), red (problem). See Performance for details.

Data Output

File Location

Camera TypeOutput DirectoryExample
USB Camera{session_dir}/Cameras/{device_id}/~/recordings/session_001/Cameras/usb_1-2.3/
CSI Camera{session_dir}/picam{N}/~/recordings/session_001/picam0/

Files Generated

FileDescription
trial_001.mp4Video file (USB cameras - H.264, with optional AAC audio)
trial_001.aviVideo file (CSI cameras only - MJPEG)
trial_001_timing.csvPer-frame timing data

Video File Format

Camera TypeContainerVideo CodecAudio Codec
USB cameras (audio enabled)MP4H.264AAC
USB cameras (audio disabled)MP4H.264
CSI cameras (Pi only)AVIMJPEG

Timing CSV Columns

The timing CSV contains per-frame timing for precise synchronization with other modules (9 columns).

ColumnDescription
trialTrial number (integer)
moduleModule name (“USBCameras” or “CSICameras”)
device_idCamera device identifier
labelOptional trial label (may be empty)
record_time_unixWall clock time when captured (Unix seconds, 6 decimals)
record_time_monoMonotonic time when captured (seconds, 9 decimals)
frame_index1-based frame number in video file
sensor_timestamp_nsHardware sensor timestamp in nanoseconds (CSI cameras only, 0 for USB)
video_ptsPresentation timestamp in video stream

Synchronization

All RSLogger modules share the same clock. Use record_time_mono to correlate video frames with events from other modules (DRT, VOG, Eye Tracker, Audio, GPS).

To find the video frame at a specific time:

  1. Find the event’s record_time_mono in the other module’s data
  2. Find the closest record_time_mono in the camera timing CSV
  3. Use that row’s frame_index to seek in the video file

Camera Types

FeatureCSI CamerasUSB Cameras
PlatformRaspberry Pi onlyLinux, macOS, Windows
Hardware timestampsYes (sensor_timestamp_ns)No (use record_time_mono)
Audio recordingNoYes (optional, from built-in mic)
Video formatAVI (MJPEG)MP4 (H.264)
Hot-pluggableNoYes

Supported CSI Sensors

IMX296 (global shutter), IMX708 (12MP autofocus), IMX219, IMX477, and other libcamera-supported sensors.

USB Camera Notes

  • Any UVC-compliant webcam
  • Actual FPS may vary from requested depending on lighting and USB bandwidth

Configuration

Access via View > Camera Settings…

SettingDefaultNotes
Resolution640x480Higher resolution = larger files, more CPU
Frame Rate30Options: 1, 2, 5, 10, 15, 30, 60
Preview Scale1/4Does not affect recording quality
Audio Mode (USB only)autoauto, on, or off

Performance

Metrics Color Coding

  • Green — Healthy (95%+ of target)
  • Orange — Stressed (80-95%)
  • Red — Problem (below 80%)

Multiple USB Cameras

Cameras on the same USB bus share bandwidth. If FPS drops when adding cameras, connect them to different USB controllers (front vs back ports, or a PCIe USB card).

Storage

Use a fast SD card (Class 10 / U3) or SSD. Typical file sizes at 30fps 720p:

  • USB cameras (MP4/H.264): 2-4 GB/hour
  • CSI cameras (AVI/MJPEG): 3-8 GB/hour

Troubleshooting

Camera not detected
  1. Check physical connection
  2. Check if another application is using the camera
  3. On Raspberry Pi: libcamera-hello —list-cameras
  4. On Linux: v4l2-ctl —list-devices
  5. On macOS/Windows: Check camera permissions
Low frame rate or dropped frames
  1. Lower frame rate (biggest impact)
  2. Lower resolution
  3. Improve lighting (cameras slow in low light)
  4. Use faster storage
  5. Try a different USB port
Preview is laggy

Lower preview scale to 1/4 or 1/8. Preview settings don’t affect recording quality.

Audio out of sync

Verify the frame rate setting matches the actual Hardware FPS shown in the metrics panel.