Skip to content

Instantly share code, notes, and snippets.

@makvoid
Created July 8, 2022 01:07
Show Gist options
  • Save makvoid/5a84cfe27ce4f7b16d26edcca1ebbbaf to your computer and use it in GitHub Desktop.
Save makvoid/5a84cfe27ce4f7b16d26edcca1ebbbaf to your computer and use it in GitHub Desktop.
libcamera-vid to FFMPEG example commands
# h264
$ libcamera-vid -t 0 --width 1920 --height 1080 --autofocus -o - | ffmpeg -i - -f alsa -ac 1 -itsoffset 5 -i hw:1,0 -vcodec copy -acodec aac -strict -2 out.flv
# MJPEG
$ libcamera-vid -t 0 --width 1920 --height 1080 --autofocus --codec mjpeg -o - | ffmpeg -i - -f alsa -ac 1 -itsoffset 5 -i hw:1,0 -vcodec copy -acodec aac -strict -2 out.mp4
# YUV420
$ libcamera-vid -t 0 --width 1920 --height 1080 --autofocus --codec yuv420 -o - | ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 1920x1080 -r 30 -i - -f alsa -ac 1 -itsoffset 5 -i hw:1,0 -vcodec copy -acodec aac -strict -2 out.avi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment