Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Gstreamer return only keyframes?

In gstreamer pipeline, I'm trying to figure out if there's a way to specify that I only want key frames from a RTSP stream.

In ffmpeg you can do this with with -skip_frame nokey flag. E.g.:

ffmpeg -skip_frame nokey -i rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov -qscale 0 -r 1/1 frame%03d.jpg

The corresponding gstreamer command to read the RTSP feed looks like this:

gst-launch-1.0 rtspsrc location=rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov ! decodebin ! videorate ! "video/x-raw,framerate=1/1" ! videoconvert ! autovideosink

Does anyone know if it is possible to ask gstreamer to only return keyframes?

like image 591
Anton Fedorov Avatar asked Sep 16 '25 16:09

Anton Fedorov


1 Answers

I think you could try add GST_PAD_PROBE_TYPE_BUFFER pad probe and return GST_PAD_PROBE_DROP on buffers with GST_BUFFER_FLAG_DELTA_UNIT flag set.

like image 69
RSATom Avatar answered Sep 18 '25 08:09

RSATom