AnsweredAssumed Answered

How to capture/get a jpeg image from a h264 video shared memory?

Question asked by Rodrigo Pimenta Carvalho on Dec 9, 2017
Latest reply on Dec 14, 2017 by Joan Xie

Hi.

 

I'm starting working in a software that uses video stream getting h264 video from a camera, writing it to a shared memory and than reading it from such memory to show it in the GUI. I'm new with GStreamer and it is version 1.8.3.

 

The C++ code that produces the content into the shared memory uses a pipe with the following characteristics:

 

Video source = imxv4l2src or imxv4l2videosrc (I'm not sure what exactly)

          attributes: do-timestamp =true , fps-n=15

Video encoder = imxvpuenc_h264

          attributes: idr-interval=3, bitrate=1536

Video sink = shmsink

          attributes: socket-path=video_shared_tmp, wait-for-connection=true, shm-size=1000000, sync=false

 

The C++ code that access the shared memory to reproduce the video for the user uses a pipe with the following characteristics:

 

shmsrc socket-path=video_shared_tmp is-live=true do-timestamp=true ! h264parse ! imxvpudec ! imxipuvideotransform

 

It works very well. However, when I try to retrieve a unique jpeg picture (a photo) from the same shared memory, there is a error: "No valid frames decoded before end of stream".

 

The pipe I'm using to get the picture is like this:

 

shmsrc socket-path=video_shared_tmp is-live=true do-timestamp=true num-buffers=1 ! queue ! h264parse ! imxvpudec ! videorate ! video/x-raw,framerate=1/1 ! jpegenc ! filesink location=/temp/file.jpeg

 

What should I change in my pipe?

 

Any hint will be very helpful !!

Best regards.

Rodrigo Pimenta Carvalho

Outcomes