GNOME Bugzilla – Bug 632386
Unable to capture from second screen
Last modified: 2011-04-25 06:19:49 UTC
I think I stumbled upon a bug in ximagesrc. I am using Ubuntu 10.10 with all the lastest patches and the latest driver included in the distro. I have two screens, with resolutions 1600x1200 and 1680x1050. Second screen is placed left of the first one and I use it as a primary screen. I tried to record my desktop with: gst-launch ximagesrc startx=1680 starty=0 endx=3280 endy=1200 \ use-damage=0 ! ffmpegcolorspace ! x264enc ! matroskamux ! \ filesink location="test.mkv" The result was a video with resolution 3280x1200 and both screens were recorded. After some experimenting I noticed that this command line works as it should: gst-launch ximagesrc startx=1680 starty=0 endx=3278 endy=1198 \ use-damage=0 ! ffmpegcolorspace ! x264enc ! matroskamux ! filesink \ location="test.mkv" In this case the result was a video with the resolution of 1598x1198.
You want: ximagesrc startx=1680 starty=0 endx=3279 endy=1199 or ximagesrc startx=1680 starty=0
Unfortunately, this doesn't work for me. If I use first parameters you suggested x264enc will return an error that it cannot be initialized. I am guessing it has to do something with the resolution. If my endx and endy parameters are 3278 and 1198 capturing works on the correct screen, but the video is two pixels smaller on the each side. I did write this in the original bug report. bigwhale@thefish:~$ gst-launch -v ximagesrc startx=1680 starty=0 endx=3279 endy=1199 use-damage=0 ! ffmpegcolorspace ! x264enc ! matroskamux ! filesink location="test.mkv" Setting pipeline to PAUSED ... /GstPipeline:pipeline0/GstXImageSrc:ximagesrc0.GstPad:src: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1599, height=(int)1199, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/2147483647 Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock /GstPipeline:pipeline0/GstXImageSrc:ximagesrc0.GstPad:src: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1599, height=(int)1199, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1 /GstPipeline:pipeline0/GstFFMpegCsp:ffmpegcsp0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)25/1, width=(int)1599, height=(int)1199, pixel-aspect-ratio=(fraction)1/1 /GstPipeline:pipeline0/GstFFMpegCsp:ffmpegcsp0.GstPad:sink: caps = video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1599, height=(int)1199, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1 ERROR: from element /GstPipeline:pipeline0/GstX264Enc:x264enc0: Can not initialize x264 encoder. Additional debug info: gstx264enc.c(1153): gst_x264_enc_init_encoder (): /GstPipeline:pipeline0/GstX264Enc:x264enc0 Execution ended after 32542477 ns. Setting pipeline to PAUSED ... Setting pipeline to READY ... /GstPipeline:pipeline0/GstFFMpegCsp:ffmpegcsp0.GstPad:src: caps = NULL /GstPipeline:pipeline0/GstFFMpegCsp:ffmpegcsp0.GstPad:sink: caps = NULL /GstPipeline:pipeline0/GstXImageSrc:ximagesrc0.GstPad:src: caps = NULL Setting pipeline to NULL ... Freeing pipeline ... If I use the second parameters that you suggested, ximagesrc captures both screeens and I get a video with the resolution of 3200x1200. This bug is not resolved.