How to decode h264 buffers to CV MAT with gstreamer

Hi,

I have an HW that encode video into h264 and send it as a h264 buffers , the buffers comes in CB function as the follow:
void
EncoddedVideoCB(uint8_t* buf, int bufLen, void* pipline)
{
// Do something with the h264 buffer.
}
I will like to know if there is a way to decode the buffers in gstreamer into appsink in order to get the video framers.
I tried to use the follow gstreamer pipeline:
“appsrc ! video/h264,width=your_width,height=your_height,framerate=your_fps/1 ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! queue ! appsink drop=1”
It doesn’t work for me.

It might just be a typo:
appsrc ! video/x-h264 ! …

It succes to decode only one frame and than nothing.

Hi,
You may save the h264 stream to a file and run pipeline like:

filesrc ! h264parse ! nvv4l2decoder ! nvvidconv ! video/x-raw,format=BGRx ! videoconvert ! video/x-raw,format=BGR ! queue ! appsink

There is no sample with appsrc. A sample close to this use-case is with rtspsrc. You may refer to
Doesn't work nvv4l2decoder for decoding RTSP in gstreamer + opencv - #3 by DaneLLL

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.