Frame resolution settings in gstreamer pipeline
Antonio Ospite
ao2 at ao2.it
Fri Feb 2 09:41:06 UTC 2018
On Fri, 2 Feb 2018 04:37:10 +0000
"Mohammad, Jamal M" <MohammadJamal.Mohiuddin at ncr.com> wrote:
> Hi Guys,
>
> 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
>
[...]
> 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
>
The dx9screencapsrc element may define caps for width and height, but
your instance only accepts some values for it, you should see the values
in the output of "gst-launch-1.0 -v" if you look close enough.
So requesting invalid values on the source element will make caps
negotiation to fail.
What you really want to do here is to *resize* the captured 1920x1080
frame down to 1024x768 before encoding it, and that can be done with
the videoscale element:
gst-launch-1.0.exe -v dx9screencapsrc ! queue ! videoconvert ! videoscale ! video/x-raw,width=1024,height=768 ! x264enc ...
Ciao,
Antonio
--
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
More information about the gstreamer-devel
mailing list