Extract th frame from camera source in deepstream

Hello,
I need to extract the camera frame from deepstream sdk.
In order to run a specific algorithm on the camera frame separately from the DeepStream pipline.