vpuenc: request generation of the SPS/PPS header for H264

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

vpuenc: request generation of the SPS/PPS header for H264

1,514 Views
jjardon
Contributor I

Hi, in a previous question [1] I asked about the parameter to generate a keyframe (I-frame) and setting forceIPicture=1 seems to do the work.


The problem I have now is that I think I have to send the SPS/PPS for any new segment I created, but currently I get this from the parser after the encoder:


gsth264parse.c:926:gst_h264_parse_handle_frame: no SPS/PPS yet, nal Type: 1 Slice, Size: 28105 will be dropped


The VPU generates the SPS/PPS headers during startup, but seems there is no apparent mechanism to trigger a new SPS/PPS header generation. The problem seems to be when a new segment occurs. Since the headers were created only once, only the previous segment ever saw headers - the new one didn't. h264parse apparently considers this an error, and expects SPS/PPS data for every segment.


Do you know if there is anything I can do to tell the vpu to generate new headers again?


Thanks


[1] https://community.freescale.com/message/353601

Labels (3)
Tags (3)
0 Kudos
1 Reply

536 Views
juangutierrez
NXP Employee
NXP Employee

Hi

Looking into the vpu_api_reference_manual_imx6quad_linux, there is the next API that might help

vpu_EncGiveCommand()

     RetCode vpu_EncGiveCommand(EncHandle handle, CodecCommand cmd, void *param);

that you can use with next arguments:

cmd = ENC_GET_SPS_RBSP

param = is a pointer to an EncParamSet type structure. The first variable, paraSet, is a physical address where the generated stream is located, and size is the size of the stream in bytes.

  OR

cmd = ENC_GET_PPS_RBSP

param = is a pointer to an EncParamSet type structure.

where:

typedef struct {

     Uint8 *paraSet;

     Uint8 *pParaSet;

     int size;

} EncParamSet;

EncParamSet structure is used when the host processor requires SPS or PPS data from an encoder instance. The resulting SPS or PPS data is used in an application as a type of out-of-band information. paraSet The address of the SPS or PPS data. pParaSet The address of the MJPG encoder header data. It is only for MJPG.

size is the size of the data.

0 Kudos