Skip to content

Instantly share code, notes, and snippets.

@tobert
Created March 10, 2014 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobert/9472582 to your computer and use it in GitHub Desktop.
Save tobert/9472582 to your computer and use it in GitHub Desktop.
2 cameras, 2 files
#!/bin/bash
set -e
timestamp=$(date -Im)
queue_bytes=$((2**24)) # 16mb queues between threads
camfile0="$HOME/Video/gst-video0-${timestamp}.mov"
camfile1="$HOME/Video/gst-video1-${timestamp}.mov"
camera_resolution="width=1280, height=720"
camera0="/dev/video0" # Logitech C920
camera1="/dev/video1" # Microsoft Lifecam
set -x
gst-launch-1.0 --eos-on-shutdown -vvv \
v4l2src device=$camera0 do-timestamp=true ! \
image/jpeg, $camera_resolution ! \
queue max-size-bytes=$queue_bytes ! \
avmux_mov ! \
filesink location=$camfile0 \
v4l2src device=$camera1 do-timestamp=true ! \
image/jpeg, $camera_resolution ! \
queue max-size-bytes=$queue_bytes ! \
avmux_mov ! \
filesink location=$camfile1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment