Video Glitches When Encoding Custom appsrc in GStreamer

Please try to feed frame data like:
Latency issue: nvv4l2h265enc accumulates four images before releasing the first - #3 by DaneLLL

Not sure but need-data signal looks to be periodic. There may be improvement if you feed the frame as soon as you have it.