Clem's
Clem's

Reputation: 41

How to watch a h263 video via rtsp with gstreamer

I'm trying to read a video stream, encoded in the h263 format, that I'm receiving via rtsp, with gstreamer, on windows. At the end, I have to get a BGR or RGB format (to use Qimage/Qt).

I can watch the flow with vlc rtsp://172.22.1.2:8554/test

I can watch the flow with a cmd : gst-launch-1.0 rtspsrc location=rtsp://172.22.1.2:8554/test ! rtph263pdepay ! avdec_h263 ! autovideosink

I can't do this in my program. I tried m_pipeline = gst_parse_launch("rtspsrc location=rtsp://172.22.1.2:8554/test ! rtph263pdepay ! avdec_h263 ! appsink name=sink caps=video/x-raw, format=BGR", &error);

I tried uridecodebin uri=.. in state of rtspsrc location=...

I tried video/x-h263 and video/x-raw, format=RGB

Wether I have an error message about the caps, or the program crashes.

I don't know if I don't use the right elements or if the end of my command is wrong or something else..?

Upvotes: 0

Views: 1012

Answers (1)

jfoytik
jfoytik

Reputation: 910

You are likely getting an error because avdec_h263's src caps do not match the caps you have specified for the appsink. Running the cmd gst-inspect-1.0 avdec_h264 you can see that the src pad caps template supports only video/x-raw format = I420, while your appsink is set to video/x-raw format=BGR.

Try adding the videoconvert element to your pipeline between the decoder and appsink : m_pipeline = gst_parse_launch("rtspsrc location=rtsp://172.22.1.2:8554/test ! rtph263pdepay ! avdec_h263 ! videoconvert ! appsink name=sink caps=video/x-raw, format=BGR", &error);

Upvotes: 0

Related Questions