0

I am streaming my laptop screen on my IP based display using gstreamer.

Here is the pipeline on both ends:

Laptop:

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v dx9screencapsrc ! queue ! videoconvert ! x264enc ! "video/x-h264,profile=baseline" ! h264parse config-interval=-1 ! rtph264pay pt=96 config-interval=-1 ! udpsink host=<ipaddr> port=5004 sync=true

IP Display:

gst-launch -v udpsrc port=5004 ! application/x-rtp, payload=96 ! rtph264depay ! vpudec low-latency=true ! imxv4l2sink sync=false

The problem is Display resolution is 1024x768 but the source plugin is generating 1920x1080, which is my laptop resolution..

I need to convert this to the resolution of IP Display, I modified the pipeline on the laptop to following:

C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v dx9screencapsrc  ! video/x-raw, width=1024,height=768,framerate=30/1 !queue ! videoconvert  ! x264enc  ! "video/x-h264,profile=baseline" ! h264parse config-interval=-1 ! rtph264pay pt=96 config-interval=-1 ! udpsink host=<IPAddress> port=5004 sync=true

It fails with the following error:

WARNING: erroneous pipeline: could not link dx9screencapsrc0 to queue0, dx9screencapsrc0 can't handle caps video/x-raw, width=(int)1024, height=(int)768, framerate=(fraction)30/1

Looking at the caps of dx9screencapsrc using gst-inspect-1.0, it has cap for width and height.

How can I acheive my requirement of capturing the whole screen but converting it to 1024x768

md.jamal
  • 4,067
  • 8
  • 45
  • 108
  • Did you have look at dx9screencapsrc plugin properties you can specify x/y/width/height. – Prabhakar Lad Feb 02 '18 at 08:39
  • Those are window specific capture width and height, I need to capture the whole window, but frame resolution should be 1024x768 – md.jamal Feb 02 '18 at 08:40
  • Then you might want to use videobox (https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-videobox.html) / videocrop (https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-videocrop.html) plugin. – Prabhakar Lad Feb 02 '18 at 08:45
  • I used VideoBox it didn't worked, it cropped the frames.. C:\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe -v dx9screencapsrc ! videobox autocrop=true ! "video/x-raw, width=1024,height=768" ! queue ! videoconvert ! x264enc ! "video/x-h264,profile=baseline" ! h264parse config-interval=-1 ! rtph264pay pt=96 config-interval=-1 ! udpsink host= port=5004 sync=true – md.jamal Feb 02 '18 at 08:52
  • ahh you could use videoscale plugin (https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-plugins/html/gst-plugins-base-plugins-videoscale.html) this shouldn’t crop. – Prabhakar Lad Feb 02 '18 at 09:03
  • I used videoscale plugin, the caps did show 1024,768 but the Display is not full screen. – md.jamal Feb 02 '18 at 09:58
  • add " ! videoconvert ! videoscale ! video/x-raw,width=1024,height=768" before your imxv4l2sink – Prabhakar Lad Feb 02 '18 at 10:10
  • Added.. But the same effect, it is not full screen. – md.jamal Feb 02 '18 at 10:16
  • should be issue with imxv4l2sink, try displaying some video locally and see if you get full screen! – Prabhakar Lad Feb 02 '18 at 10:23
  • Playing video locally will get full screen – md.jamal Feb 02 '18 at 10:53
  • did you add " ! videoconvert ! videoscale ! video/x-raw,width=1024,height=768" before your imxv4l2sink before playing video locally ? – Prabhakar Lad Feb 02 '18 at 10:54
  • No i didn't add – md.jamal Feb 02 '18 at 10:55

0 Answers0