please refer to these two samples: Help,dump image from nvv4l2decoder problem Deepstream sample code snippet