1

First of all, you should know this question is titled that way because that's were I ended up stuck after narrowing down my problem for quite a while. Since there probably are better approaches to my problem I'm also explaining below my problem and what I've been doing to try and solve it. Suggestions on other approaches would be very welcome.

The problem

I'm using a gstreamer port to Android to render videos from remote cameras through the RTSP protocol (UDP is the transport method).

Using playbin things were working quite fine until they didn't anymore for a subset of these cameras.

Unfortunately I don't have access to the cameras themselves since they belong to our company's client, but the first thing that sprung to my mind was that it's got to be a problem with them.

Then, there's another Android app which we're using as reference that is still able to play video from these cameras normally, so I'm now trying to do my best to further investigate the issue on my end (our Android app).

The problem has been quite deterministic: some cameras always fail, others always work. When they fail, sometimes it would be with reason not-linked as the cause.

I managed to dump the pipeline graph associated with each of these cameras when the application tries to play video from them. Then I could notice that for each of the cameras that are failing, the associated pipelines are always missing something. Some miss just the sink element, others miss both the source and the sink:

Dump of pipeline with source only: w/ source only

Dump of pipeline without a source or a sink: w/ neither

Dump of pipeline with both (these are the cases where we can indeed play): w/ source and sink

These are dumps of pipelines built by the playbin.

Attempted solution

I've been trying to test what would happen if I built the pipeline manually from scratch (so that it's the same being build by the playbin in the third image above) and forced all camera's videos to be processed by this pipeline. Since all cameras used to work, my guess is that somehow negotiation is failing now for some cameras so that the playbin is not building the pipeline properly for these cameras but if I assemble it myself, eventually it all would work as expected (I'm assuming that rtspsrc in combination with glimagesink was also the chosen pipeline by the playbin for playing video from these cameras).

This is how I'm trying to build this pipeline myself:

priv->pipeline = gst_pipeline_new("rtspstreamer");

source = gst_element_factory_make("rtspsrc", NULL);
if (!source) {
  GST_DEBUG("Source could not be created");
}

sink = gst_element_factory_make("glimagesink", NULL);
if (!sink) {
  GST_DEBUG("Sink could not be created");
}

if (!gst_bin_add(GST_BIN(priv->pipeline), source)) {
  GST_DEBUG("Could not add source to pipeline");
}
if (!gst_bin_add(GST_BIN(priv->pipeline), sink)) {
  GST_DEBUG("Could not add sink to pipeline");
}
if (!gst_element_link(source, sink)) {
  GST_DEBUG("Source and sink could not be linked");
}

g_object_set(source, "location", uri, NULL);

So, running the code above, I get the following error:

Source and sink could not be linked

This is where I'm stuck. How could I investigate further on why these components are unable to link to each other? I think that maybe there should be some other component between them in the pipeline, but I think that's not the case by looking at the dump of the successful pipeline (third image) above.

Thanks in advance for any help.

Community
  • 1
  • 1
Guilherme Santos
  • 328
  • 4
  • 11
  • well you can run with [GST_DEBUG=3,default:4](http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+11%3A+Debugging+tools) or some other combinationand see what will be the output.. I would also test it from PC(if possible) say Ubuntu and newer gstreamer, or probably some other non gstreamer client to see if it works normally all the time. what gstreamer version are you using? – nayana Dec 04 '15 at 09:56
  • Yeah, you're right I should also try things on a PC as well, at the very least the whole process should go a tad faster, and I'll try enabling as much debugging output as possible. Also, I'm using the newest gstreamer-1.0 indeed, version 1.6.1. Thanks for the help! – Guilherme Santos Dec 04 '15 at 14:37
  • also you can try to use uridecodebin instead rtspsrc - I think it should work.. – nayana Dec 04 '15 at 14:49
  • 1
    now I realised that its not so easy just to add rtspsrc and some sink.. you have to add also decoders etc.. the uridecodebin should work as I said, you can check the pipeline graph created.. there is a test stream you can try : `gst-launch-1.0 uridecodebin uri=rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov ! glimagesink` – nayana Dec 04 '15 at 14:56

0 Answers0