Created
February 18, 2012 06:19
-
-
Save lifning/1857803 to your computer and use it in GitHub Desktop.
gstreamer-based camera simulator
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/bash | |
DEV=$(zenity --file-selection \ | |
--filename=/dev/video0 \ | |
--file-filter='V4L2 loopback devices | video*') | |
echo "Select a window to capture..." | |
XID=$(xwininfo -int | grep 'Window id' | awk '{print $4}') | |
# camera width/height | |
CW=640 | |
CH=360 | |
gst-launch-0.10 --eos-on-shutdown \ | |
\ | |
ximagesrc use-damage=false show-pointer=false xid=$XID \ | |
! ffmpegcolorspace \ | |
! videoscale method=0 add-borders=true \ | |
! video/x-raw-yuv,width=$CW,height=$CH \ | |
! videorate \ | |
! tee name=displaypipe \ | |
! tee name=recordpipe \ | |
! queue \ | |
! v4l2sink device=$DEV \ | |
\ | |
displaypipe. \ | |
! queue \ | |
! autovideosink \ | |
exit | |
## Old pipe fragments below | |
## start x/y | |
#SX=0 | |
#SY=0 | |
## end x/y | |
#EX=640 | |
#EY=360 | |
#ximagesrc use-damage=false startx=$SX starty=$SY endx=$EX endy=$EY \ | |
#recordpipe. \ | |
#! queue \ | |
#! vp8enc \ | |
#! webmmux \ | |
#! filesink location=video.webm | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment