0

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..?

Clem's
  • 41
  • 1
  • 7

1 Answers1

0

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);

jfoytik
  • 910
  • 7
  • 3
  • I already tried this without succes, but I found others errors since, so I will retry this. Unfortunately I can not try before tuesday =/ – Clem's Feb 12 '16 at 17:14
  • Finally I don't use gstreamer, only opencv with cv::VideoCapture("rtsp://..."). Thank you! – Clem's Feb 18 '16 at 09:51