[FFmpeg-trac] #2563(avdevice:new): selection and x11grab

FFmpeg trac at avcodec.org
Mon May 13 01:42:14 CEST 2013


#2563: selection and x11grab
---------------------------------------+----------------------------------
               Reporter:  ubitux       |                  Owner:
                   Type:  enhancement  |                 Status:  new
               Priority:  wish         |              Component:  avdevice
                Version:  unspecified  |               Keywords:
             Blocked By:               |               Blocking:
Reproduced by developer:  0            |  Analyzed by developer:  0
---------------------------------------+----------------------------------
 A common use case of x11grab input device is to record a window, or a
 screen selection.

 Recording a window can be achieved with a script such as:

 {{{
 ☭ cat record.sh
 #!/bin/sh

 if [ $# -lt 1 ]; then
     echo "usage: $0 [output options] <output>"
     exit 1
 fi

 win_info=$(xwininfo)
 w=$(echo "$win_info" | grep 'Width:'       | awk         '{print $2}')
 h=$(echo "$win_info" | grep 'Height:'      | awk         '{print $2}')
 x=$(echo "$win_info" | grep 'Absolute.*X:' | awk -F': *' '{print $2}')
 y=$(echo "$win_info" | grep 'Absolute.*Y:' | awk -F': *' '{print $2}')
 cmd="ffmpeg -f x11grab -show_region 1 -draw_mouse 1 -s ${w}x${h} -r 24 -i
 :0.0+$x,$y $*"
 echo "=> $cmd"
 eval $cmd
 }}}

 I was willing to add such script to the wiki, but actually it might be
 more relevant to just add a -x11select option in the x11grab indev,
 allowing a more advanced selection. Basically, exactly the same as
 {{{scrot -s}}} (screenshot command line tool). The user then do a screen
 selection, or clic on a window.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2563>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list