I am trying to build a pipeline that works with an RTSP server. I have a complete example working with gst-launch and have logs. It doesn't work with my C++ app. :-( The sample RTSP source that I am using has both audio and video. My goal is to receive the RTSP/RTP streams and mux them into a single MP2T (yuck) stream and send them to another system. As a point of reference, here is my gst-launch pipeline that works well. I am using gstreamer v. 0.10.30<br>
<br>#!/bin/sh<br>#export GST_DEBUG=rtspsrc:4,mpegtsmux:4,rtph264depay:4,rtpmp4gdepay:4<br>gst-launch -v rtspsrc location=rtsp://192.168.12.66:/somefile.sdp name=src \<br> src. ! queue ! rtph264depay ! mux. \<br> src. ! queue ! rtpmp4gdepay ! mux. \<br>
mpegtsmux name=mux ! udpsink host=$1 port=$2<br><br>My C++ code starts off well but has a problem with the second RTP stream. I create the rtspsrc element plus an mpegtsmux and udpsink and add them to the pipeline, only linking the mpegtsmux to the udpsink. In the newpadadded callback function, I create a queue and a depayloader based on the caps, add them to the pipeline, link them in and sync the state with the parent. All of that works. In my recent testing the video RTP stream was processed first (just luck) and the rtph264depay and mpegtsmux elements logged a lot of messages, suggesting they were processing packets. However, shortly after linking in the audio the muxer returns an error 10 - Stream is not associated with any program. Specifically, here are the messages.<br>
<br>mpegtsmux mpegtsmux.c:395:mpegtsmux_create_stream:<RTSPMP2TMux:sink_64> [00m Creating H264 stream with PID 0x0040<br>...<br>mpegtsmux mpegtsmux.c:654:mpegtsmux_collected:<RTSPMP2TMux> [00m Pads collected<br>
mpegtsmux mpegtsmux.c:610:mpegtsmux_choose_best_stream:<RTSPMP2TMux> [00m Pulled buffer with ts 0:00:00.080980597 (uncorrected ts 0:00:00.080980597 80980597) for PID 0x0040<br>mpegtsmux mpegtsmux.c:681:mpegtsmux_collected:<RTSPMP2TMux> [00m error: Stream is not associated with any program<br>
<br>There isn't a corresponding creation message for PID 0x0041, though there is one earlier message:<br>mpegtsmux mpegtsmux.c:610:mpegtsmux_choose_best_stream:<RTSPMP2TMux> [00m Pulled buffer with ts 0:00:00.051079480 (uncorrected ts 0:00:00.051079480 51079480) for PID 0x0041<br>
<br>which I assume would correspond to the audio channel. That is the only log message that contains 0x0041. So it seems like it didn't create the audio stream which makes sense given the error. However, I didn't see any messages from the mpegtsmux about failing to create any streams.<br>
<br>I have tried using the caps of the newly created rtspsrc pad passed into my function. That linked but led to this error. I tried creating my own caps ("video/x-h264" and "audio/mpeg", "mpegversion", G_TYPE_INT, 4, NULL) but that didn't even link. I thought that the caps that I created agreed with the results from gst-inspect mpegtsmux:<br>
<br> video/x-h264<br> audio/mpeg<br> mpegversion: { 1, 2, 4 }<br><br>What caps should I be using? I know that this needs to be dynamic because in production I don't know what CODEC types will be contained in the streams.<br>
<br>The documentation states that rtspsrc internally creates an rtpbin. If so, why do I need (or even do I need) to create the rtp jitterbuffer/depay elements? Couldn't I simply link to the rtspsrc created rtpbin(s)? But if I took those elements out of my pipeline, how would the branches be distinguished?<br>
<br>Thank you,<br>Chuck Crisler<br>