You may have a look to this dirty patch for jetson-utils (dirty because it may work for your case, but may break some other cases) and adapt for your case.
In short it should end with:
... ! videoconvert ! video/x-raw, format=RGB, width=(int)" << mWidth << ", height=(int)" << mHeight << " ! appsink name=mysink