Membrane RTSP source

If you buffer the incomplete packet… the next chunk of tcp bytes is not going to start with the RTSP magic code 36, and how would you know how many bytes left to read for this incomplete packet?

Edit: thanks for the added comment I see now your code should work.

It seems now the problem is decoding h264? I suggest you print the size of your frames, H264 should have a few small frames (SPS, PPS, etc) at the beginning before the IDR frame, followed by many smaller P frames. If you don’t have the SPS/PPS frames, that’s what the “non-existing PPS 0 referenced” error is about.