[Libva] Directly encoding a surface after decoding

Timo Rothenpieler timo at rothenpieler.org
Thu Jan 24 16:31:53 PST 2013


Hi,

I'm currently trying to write a transcoder which uses the latest 
libva+intel-driver from git staging.
The encoder and decoder on it's own work fine, but now i'm trying to 
combine them, so that the encoder takes the VASurfaceID from the decoder 
as input surface. This is to avoid the overhead of copying the image 
contents to ram, just to copy them back after.

But when i try to run this, all i get is:
i965_encoder.c:78: intel_encoder_check_yuv_surface: Assertion 
`obj_surface && obj_surface->bo' failed.

This happens on the call to vaEndPicture. The surfaceId from the decoder 
was used as surfaceId for vaBeginPicture, like i did with my manualy 
filled surface before.

I tried to just call vaDeriveImage/vaDestroyImage before using the 
surface. This avoids the assertion, but i get a full green output video.

I'm totaly confused about this, as i can use the SurfaceID from the 
decoder for a deinterlacing video processor.

Also, the next thing i'd do with the surface is calling 
vaDeriveImage+MapBuffer and copy out the YUV data, respectively copying 
in the YUV data on the encoder side, which works fine, but is slow.

Why can't i use the surface from the decoder, which apperently already 
contains yuv data, as input for the encoder?


More information about the Libva mailing list