This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

gst-launch to capture rtsp stream from a camera and decode H264 and display

Hi,

I am new to video decoding and TI Sitara family. I am using a BeagleBone black to receive a rtsp stream from a camera which is H264 encoded and display using the onbpard HDMI port. I have tried the following. 

1. gst-launch videotestsrc ! video/x-raw-rgb, framerate=25/1, width=1280, height=720 ! fbdevsink device=/dev/fb0

This works fine.

2. gst-launch-0.10 filesrc location=/home/big_buck_bunny_720p_h264.mov ! h264parse ! ffdec_h264 ! ffmpegcolorspace ! fbdevsink device=/dev/fb0

This is a H264 test clip that I have tried to play back but didn't work and got the following.

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstH264Parse:h264parse0: GStreamer encountered a general stream error.
Additional debug info:
gstbaseparse.c(2890): gst_base_parse_loop (): /GstPipeline:pipeline0/GstH264Parse:h264parse0:
streaming stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

3. gst-launch-0.10 rtspsrc location=rtsp://192.168.6.176:554 ! rtph264depay ! ffdec_h264 ! fbdevsink device=/dev/fb0

I Get the following reply but nothing on the display

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

4. gst-launch-0.10 rtspsrc location=rtsp://192.168.6.176:554 ! fbdevsink device=/dev/fb0

Same as above.

How can I use gst-launch to capture the rtsp stream? Also why the 720p video clip cannot work?

Thanks in advance,

Kaushalya

  • Hi,

    Please check this wiki for HDMI resolutions supported on BB Black: http://elinux.org/Beagleboard:BeagleBoneBlack_HDMI

  • I think you might have to use qtdemux for .mov files.  See here for more details.  The pipeline should be similar to the MPEG+AAC example in the sitara sdk.

    Also, decoding 720p h264 on Beagle Bone Black is probably way more than the cpu can handle; I would expect the cpu usage to be maxed out and lots of frames dropped.

    For your rtsp stream, you usually need to specify the caps of the transmit pipe on the receive pipe.  There are some examples here, although you need to ignore all of the "TIDmai" plugins, as those are not available on AM335x.

  • Hi jelliott, 

    Thanks for your valuable comments.

    You are absolutely correct regarding the demuxing of the video clip. After posting my question, I managed to get that sorted in a similar fashion as you have mentioned. The 720p clip did have a bit of latency and it stopped after playing for a while though.

    I managed to get the rtsp stream as well using the following but with a huge latency. Any suggestions?

    gst-launch-0.10 rtspsrc location=rtsp://192.168.6.176/ latency=10 ! rtph264depay ! decodebin ! ffmpegcolorspace ! fbdevsink device=/dev/fb0  sync=false

    What sort of realistic bit rates/resolutions do you think is possible with BBB? 

    Cheers,

  • For an idea of multimedia performance, check out the Sitara ARM Multimedia benchmark wiki.

    The large latency might be due to the "latency = 10" parameter in your rtspsrc. Also, I've noticed that GStreamer seems to introduce a lot of latency that can be hard (or maybe impossible) to remove.  I have had the same issue with audio streaming, and in the end I ended writing my own custom application using the ALSA API to get latency very low.

    As for the stalling, maybe you could try adding some queues. It would probably hurt your latency, but it might keep the stream from dying.

  • You could also refer to some of the example pipelines @ https://github.com/aditya-nellutla/TI-Graphics-Accelerated-Video-streaming-/tree/master/documentation.


    Also look at the performance ppt which gives you idea on CPU utilization for a given resolution