Created
October 8, 2025 10:38
-
-
Save lidgnulinux/6e725570ad12c17862f064a73f636896 to your computer and use it in GitHub Desktop.
Record focused window using ffmpeg.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
position=$(xdotool getwindowfocus getwindowgeometry | grep Posit | awk '{print $2}') | |
ffmpeg -f x11grab \ | |
-framerate 30 \ | |
-video_size $1 \ | |
-i ${DISPLAY}+$position \ | |
-c:v libx264 \ | |
-pix_fmt yuv420p \ | |
$2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment