Skip to content

Instantly share code, notes, and snippets.

@borisisok
Last active April 6, 2022 19:36
Show Gist options
  • Save borisisok/1083bc3a30dca023e13f6a224a60f00a to your computer and use it in GitHub Desktop.
Save borisisok/1083bc3a30dca023e13f6a224a60f00a to your computer and use it in GitHub Desktop.
Mirabox - Record via ffmpeg
# The Linux version
VDEV=$(v4l2-ctl --list-devices | grep -A1 -i mirabo | grep /dev | sed 's/\s//g')
ADEV=$(grep "Capture.*Mira" /proc/asound/cards | cut -f2 -d" ")
TS=$(date +%Y%m%d_%H%M%S)
nohup ffmpeg -f alsa -ac 2 -i hw:${ADEV=},0 -f video4linux2 -i ${VDEV} -acodec ac3 -ab 128k -f matroska -movflags frag_keyframe -s 1920x1080 -vcodec libx264 -preset ultrafast -qp 16 ${TS}.mkv &
sleep 5;
vlc ${TS}.mkv
killall ffmpeg
echo ${TS}.mkv
@borisisok
Copy link
Author

pi@raspicam2:~ $ v4l2-ctl -D -d /dev/video0
Driver Info:
Driver name : sonixj
Card type : USB camera
Bus info : usb-20980000.usb-1.4
Driver version : 5.10.17
Capabilities : 0x85200001
Video Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05200001
Video Capture
Read/Write
Streaming
Extended Pix Format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment