Created
March 16, 2012 21:56
-
-
Save stef/2053030 to your computer and use it in GitHub Desktop.
iirc this streams the contents of an x11 window via flash...
This file contains 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/ksh | |
res=svga | |
eval $(xwininfo -frame | awk '/Absolute upper-left X/ { print "x="$NF } | |
/Absolute upper-left Y/ { print "y="$NF } | |
/Width/ { print "width="$NF } | |
/Height/ { print "height="$NF }') | |
offset=${x},${y} | |
res=$(( (width/16)*16))x$(( (height/16)*16)) | |
ffservercfg=$(mktemp /tmp/screenfire.XXXXXXXXXX) || exit 1 | |
cat >$ffservercfg <<EOT | |
Port 8090 | |
BindAddress 0.0.0.0 | |
MaxClients 1000 | |
MaxBandwidth 1000 | |
CustomLog - | |
<Feed screenfire.ffm> | |
File /home/stef/data/screenfire.ffm | |
FileMaxSize 32M | |
ACL allow 127.0.0.1 | |
</Feed> | |
<Stream screenfire.avi> | |
Feed screenfire.ffm | |
Format avi | |
VideoBitRate 600 | |
VideoFrameRate 25 | |
VideoSize ${res} | |
VideoGopSize 12 | |
VideoHighQuality | |
Video4MotionVector | |
NoAudio | |
</Stream> | |
<Stream stat.html> | |
Format status | |
ACL allow localhost | |
ACL allow 192.168.2.0 192.168.2.255 | |
</Stream> | |
<Redirect index.html> | |
URL http://localhost:8090/screenfire.avi | |
</Redirect> | |
EOT | |
cat $ffservercfg | |
ffserver -f $ffservercfg & | |
sleep 1 | |
ffmpeg -f x11grab -s ${res} -r 25 -i $DISPLAY+${offset} http://localhost:8090/screenfire.ffm || { | |
kill %1 | |
rm $ffservercfg | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment