OpenCV build script

Using opencv for converting from I420 to BGR after opencv video capture may often be slower than using nvvidconv to produce BGRx format and using CPU videoconvert for removing the extra 4th byte and produce BGR. A queue between videoconvert and appsink may also help for performance.

However, your case is different since it is sending processed frames to rtsp server. You may better explain your use case, but you if your processing is some filtering, you may also try to check nvivivafilter plugin, and use it in your test-launch pipeline.

[EDIT: Not sure I’ve correctly understood your case. If you want to read an RTSP feed from an IP camera, probably uridecodebin as mentioned by @mdegans would be a good choice. Depending on your processing, DeepStream might be a good choice. You would tell more.]