简体   繁体   中英

GStreamer udpsrc works with gst-launch but not in app (OSX)

I successfully streamed my webcam's image with GStreamer using gst-launch this way :

SERVER

./gst-launch-1.0 -v -m autovideosrc ! video/x-raw,format=BGRA ! videoconvert ! queue ! x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink host=XXX.XXX.XXX.XXX port=7480

CLIENT

./gst-launch-1.0 udpsrc port=7480 ! "application/x-rtp, payload=127" ! rtph264depay ! decodebin ! glimagesink

Now I try to reproduce the client side in my app using this pipeline (I don't post the code as I made an Objective-C wrapper around my pipeline and elements) :

  1. udpsrc with caps: "application/x-rtp,media=video,payload=127,encoding-name=H264"

  2. rtph264depay

  3. decodebin
  4. glimagesink (for testing) or a custom appsink (in pull-mode) that converts image to CVPixelBufferRef (tested: it works with videotestsrc / uridecodebin / etc.)

It doesn't work, even if the state messages of the pipeline look quite 'normal'. I have messages in the console concerning SecTaskLoadEntitlements failed error=22 but I have them too when working with the command line.
I'm asking myself what's under gst-launch that I'm missing. I couldn't find any example on the web on udpsrc based pipeline.

My questions are :

  • Does anybody knows what's actually happening when we launch gst-launch or a way to know what's actually happening?
  • Are there some examples of working pipelines in code with udpsrc?

EDIT


Here is the image of my pipeline. As you can see, GstDecodeBin element doesn't create a src pad, as it's not receiving - or treating - anything (I set a 'timeout' property to 10 seconds on the udpsrc element, that is thrown). Could it be an OSX sandboxing problem?

Now my pipeline looks like this:

  1. udpsrc
  2. queue
  3. h264 depay
  4. decode bin
  5. video converter
  6. caps filter
  7. appsink / glimagesink

管道

Tested with the method in this question, the app does actually receive something on this port.

Found why it wasn't receiving anything: GstUdpSrc element must be in GST_STATE_NULL to be assigned a port to listen to , or it will listen to the default port (5004) silently.

Everything works fine now.

Setting the environment variable GST_DEBUG to udpsrc:5 helped a lot, for information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM