[Libva] VAAPI encoding with Intel Sandybridge GPU

Xiang, Haihao haihao.xiang at intel.com
Thu Aug 9 22:41:40 PDT 2012


> Hi,
> 
> I am trying to use libva with Intel driver back-end for decode and
> encode. Decoding works like charm, but when I try to encode, I get
> some problems.

Which branch are you using, staging or master ? Encoder on staging has
more features.

> I got the same errors using the sample code provided by Intel for encoding ,
> I get the error :
> 
> video: 720x480; fourcc:0x56595559
> negotiated frame resolution: 640x480
> libva: VA-API version 0.32.0
> libva: va_getDriverName() returns 0
> libva: Trying to open /usr/local/lib/dri/i965_drv_video.so
> libva: va_openDriver() returns 0
> encode frame:0
> h264enc: i965_drv_video.c:1408: i965_EndPicture: Assertion
> `obj_context->codec_state.encode.seq_param' failed.
> Aborted

Try with avcenc in test/encode

> 
> 
> First frame's encoding does succeed, but any subsequent pictures does
> not because  when end_frame is called,
> obj_context->codec_state.encode.sq_param is NULL, but pic_param is
> valid (reasonably so). But there is an assert in i965_EndPicture
> function :
> 
> 
>  if (obj_context->codec_type == CODEC_ENC) {
>         assert(VAEntrypointEncSlice == obj_config->entrypoint);
> 
>         assert(obj_context->codec_state.encode.pic_param);
>         assert(obj_context->codec_state.encode.seq_param);
>         assert(obj_context->codec_state.encode.num_slice_params >= 1);
>     } else ...
> 
> which traps the code. My question is why would the seq.param need to
> be non-null for subsequent pictures?

Some parameters in VAEncSequenceParameterBufferH264 are needed, such as 
direct_8x8_inference_flag. 

> 
> Also the first frames H.264 bitstream does not look like regular h.264
> bitstream that I am familiar with - usually  SPS / PPS 0x67, 0x68
> followed by slice NALU 0x65 etc. But the bitstream looks like the
> following (first uint is the offset) :
> 
> 0000000 5300 0007 0000 0000 0000 0000 0000 0000
> 0000010 5040 5d16 7ff0 0000 0000 0000 0000 0000
> 0000020 0000 0000 0000 0000 0000 0000 0000 0000
> 
> 0000040 93f8 a443 ecff 8770 ca3a 84bf fc7d b1e0
> 0000050 8c8c 5fc2 2481 8b8a 1f10 d558 a347 3638
> 0000060 6f06 2c98 a616 9988 6d46 271f 07a8 e866
> 0000070 16f2 a335 06b4 859c 738a 5bee 8cdf 6fd5
> 0000080 3c70 788a eda8 9462 6ce1 2768 cf16 d700
> 

Bitstream generated by avcenc contains valid SPS/PPS/SLICE headers.

Thanks
haihao



> Any body have any idea?
> 
> Thanks
> 
> Ratin
> _______________________________________________
> Libva mailing list
> Libva at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libva




More information about the Libva mailing list