Unable to use the TK1 gstreamer nvhdmioverlaysink last-sample for a screenshot

I am trying to use the last-sample of the nvhdmioverlaysink to grab a screenshot periodically from an h.264 decode pipeline. When I send it to a pipeline with an appsrc it renders as a solid green image. The memory type if the sample is “omxsink” and does not appear to be usable. Is it possible to grab an image from the last-sample of the nvhdmioverlaysink?

It is not supported in using nvhdmioverlaysink. Suggest yo use tee plugin. Please refer to