x11record.sh
script to capture a window by name (works on main screen only atm) and write the output to file (or youtube)
This commit is contained in:
parent
8ed2ca6701
commit
4b72d75490
1 changed files with 36 additions and 0 deletions
36
x11record.sh
Normal file
36
x11record.sh
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
#! /bin/bash
|
||||||
|
#
|
||||||
|
# afx
|
||||||
|
|
||||||
|
VBR="1500k"
|
||||||
|
FPS="30"
|
||||||
|
#QUAL="medium"
|
||||||
|
QUAL="veryfast"
|
||||||
|
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"
|
||||||
|
KEY="..."
|
||||||
|
|
||||||
|
WINNAME="Minecraft 1.12.2"
|
||||||
|
|
||||||
|
#####################
|
||||||
|
offset_x=`xwininfo -name "$WINNAME" | grep geometry | cut -d '+' -f2`
|
||||||
|
offset_y=`xwininfo -name "$WINNAME" | grep geometry | cut -d '+' -f3`
|
||||||
|
width=`xwininfo -name "$WINNAME" | grep Width | cut -d ':' -f2 | tail -c +2 | head -c -1`
|
||||||
|
height=`xwininfo -name "$WINNAME" | grep Height | cut -d ':' -f2 | tail -c +2 | head -c -1`
|
||||||
|
|
||||||
|
echo "x11 to youtube capture"
|
||||||
|
echo "-=-=-=-=-=-=-=-=-=-=-="
|
||||||
|
echo $WINNAME resolution: $width x $height
|
||||||
|
echo $WINNAME X offset: $offset_x
|
||||||
|
echo $WINNAME Y offset: $offset_y
|
||||||
|
echo " "
|
||||||
|
echo "Ready?"
|
||||||
|
read
|
||||||
|
|
||||||
|
ffmpeg \
|
||||||
|
-video_size "$width"x"$height" -f x11grab -s "$width"x"$height" -i :0.0+"$offset_x","$offset_y" \
|
||||||
|
-f pulse -ac 2 -i default \
|
||||||
|
-vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
|
||||||
|
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
|
||||||
|
test.mp4
|
||||||
|
# -f "$YOUTUBE_URL/$KEY"
|
||||||
|
|
Loading…
Reference in a new issue