3

I have this command:

gst-launch-1.0 ximagesrc startx=1920 starty=0 endx=2943 endy=768 use-damage=0\
! video/x-raw,framerate=15/1 \
! videoscale method=0 \
! video/x-raw,width=640,height=360 \
! videoflip method=horizontal-flip \
! ximagesink

It takes the second display (from pixel 1920 to the last one -1) and shows it in a small window in first display, applying a horizontal-flip and using neighbour scaling method, at 15fps. It is for "monitor" my second display (TV) in my first display (computer monitor).

Now, my second display is a 16:9 TV, and I'm using 1024x768. The images that are shown there are already scaled (from 16:9 to 4:3). Now, I need to scale that 4:3 proportion back to 16:9 in gstreamer window.

But, by using this command, I have what you can see in this complete screenshot (with the actual window and a the "wished" window):

enter image description here

What is the correct command to do that?

Mario Mey
  • 1,582
  • 3
  • 13
  • 13

1 Answers1

2

Do not add borders with videoscale:

gst-launch-1.0 ximagesrc startx=1920 starty=0 endx=2943 endy=768 use-damage=0\
! video/x-raw,framerate=15/1 \
! videoscale method=0 add-borders=false \
! video/x-raw,width=640,height=360 \
! videoflip method=horizontal-flip \
! ximagesink
nayana
  • 3,787
  • 3
  • 20
  • 51
  • Thanks, man. One more thing: my resarch had arrived to this command to save CPU, but now I don't know why I added use-damage=0. What is this for? Is it necessary? – Mario Mey Apr 15 '16 at 20:14
  • @MarioMey the use-damage=0 .. well XDamage is option for X11 which causes to grab only changes instead of full size frames (similar to h264 which is optimizing bitrate for storing only relative changes between frames).. I guess when you use xdamage lot of cpu is eaten to recognize the changes instead of just dumb grabbing.. you can check [this](http://stackoverflow.com/questions/33747500/using-gstreamer-to-capture-screen-and-show-it-in-a-window) answer. But now I am puzzled, previously in that question I thought that XDamage is better for CPU, but I put it =0 .. – nayana Apr 20 '16 at 13:37
  • Oh, I didn't remember where I get that complete command: from a question of mine, what a dumb. Thanks. Also, there's no significant CPU difference between 0 and 1, but I wanted to know why it was there. – Mario Mey Apr 20 '16 at 22:05