NvDecoder decodes multiple frames at once

290 Views Asked by At

We are using the following gstreamer pipeline to parse rtsp stream:

gst-launch-1.0 rtspsrc port-range=5000-5100 location="rtsp://.." latency=300 is-live=true ! queue ! rtph264depay name=depayer! video/x-h264 , stream-format=byte-stream, alignment=au ! h264parse ! video/x-h264 , stream-format=byte-stream, alignment=au ! appsink name=mysink sync=true

Then we are decoding the recieved frames using Nvidia Video Codec SDK decoder. We tried using 4 different cameras, in two of them we were able to obtain a smooth video. However, in the remaining two we observed that once in every 25-30 frames, decoder flushes 4 frames at once, causing frame drops.

  • Why would the decoder flushes 4 frames at once?
  • Is there anything we can do to prevent that?
  • Can we somehow maintain a constant fps by modifying the pipeline?

I can also share the decoder code if necessary. Thanks in advance!

1

There are 1 best solutions below

0
On

Frames should come with timestamps. You need to sync playback to these. A decoder may have multiple pictures at once depending on how they have been coded. Read about b-frames in this regard. A decoder is not responsible for smooth playback, thats up to the application.