[Libva] Directly encoding a surface after decoding

ykzhao yakui.zhao at intel.com
Thu Jan 24 19:24:39 PST 2013


On Thu, 2013-01-24 at 18:55 -0700, Timo Rothenpieler wrote:
> > Will you please describe more clearly how you combine them together? It
> > will be better that you can attach your test case.
> 
> > It seems that the surface for encoding can't be accessed. Will you
> > please describe how you use the decoding/encoding in the combined
> > transcoder?
> 
> Adding a test case is not that simple, as i'm building VLC modules.
> You can take a look at the code on Github:
> https://github.com/BtbN/vlc/blob/vaapi/modules/codec/avcodec/vaapi.c
> Relevant parts starting at line 610
> 
> https://github.com/BtbN/vlc/blob/vaapi/modules/codec/avcodec/vaapienc.c
> The EncodeVideo Function at line 1057
> Basicaly what i'm doing is:
> In the decoder part:
> In the place where I'd normaly call vaDeriveImage and vaMapBuffer to 
> access the decoded yuv data(what works fine), I instead just store the 
> VASurfaceID and pass it to the encoder.
> There's logic in place that prevents this SurfaceID from beeing reused 
> before the encoder is finished.
> 
> In the encoding part:
> Where i'd normaly call vaDeriveImage and vaMapBuffer to write the yuv 
> data into the Surface, i just use the VASurfaceID i got from the decoder 
> instead of my own surface.
> All i do with this VASurfaceID is passing it to vaBeginPicture(I later 
> also pass it to vaSyncSurface, but the assertion happens before this 
> code is run), so the encoder uses it as input surface.
> Once this code reaches vaEndPicture, the assertion happens, cause of 
> obj_surface->bo beeing NULL.

It seems that the objsurface->bo is released. Maybe we should debug it.
Will you please try to add the file of /etc/libva.conf as the following
and then send out the corresponding tracelogs?
    LIBVA_TRACE=/root/trace_test/tracelog

/root/trace_test is the directory that is used to store the tracelog.
You can define it as you expected. 

Best regards.
    Yakui



More information about the Libva mailing list