Skip to content

Instantly share code, notes, and snippets.

@agragregra
Last active May 18, 2022 14:48
Show Gist options
  • Save agragregra/358ff867f1fce031fd72 to your computer and use it in GitHub Desktop.
Save agragregra/358ff867f1fce031fd72 to your computer and use it in GitHub Desktop.
ffmpeg Scree Capture + Audio/Video Sync
ffmpeg -f alsa -ac 2 -i default -f x11grab -r 60 -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -s 1366x768 -i :0.0 -acodec pcm_s16le -vcodec libx264 -preset ultrafast -threads 0 output.mkv
@jnorthrup
Copy link

jnorthrup commented May 18, 2022

nice!

im using

alias screencap='mytemp=$(mktemp); \
 ffmpeg -hwaccel auto -r ntsc -f pulse -i default \
 -f x11grab $(slop -D -n -f "-video_size %wx%h -i :0.0+%x,%y") \
 -x264opts opencl   -y $mytemp.mp4 ; \
 echo $mytemp.mp4'

slop is an external program, double clicking in slop will report a window frame.

i don't get audio sync, having added the audio just a minute ago. still some features to examine here.

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