Generic DMABUF to vaapi h264 encoding

Volker Vogelhuber v.vogelhuber at digitalendoscopy.de
Thu Jul 23 01:34:45 PDT 2015


Hi Nicolas,
> Le mardi 21 juillet 2015 à 14:47 +0200, Volker Vogelhuber a écrit :
>> As this is not a V4L2 exported DMABUF I guess the
>> usual samples using DMABUF-import from the V4L2 plugins do not work.
> I forgot to mention that I didn't understand this sentence.
>
>    v4l2src io-mode=dmabuf ! vaapipostproc ! vaapiencode_h264
>
> Should in theory work. Just like:
>
>    ... ! vaapipostproc ! v4l2sink io-mode=dmabuf-import
>
> But it all depends on the driver expected format and allocation type.
> There is also many ways that this won't work. An example, if you use
> libv4l, it's known limitation that DMABUF cannot be used, color format
> may not match, padding may not match, etc.
Thanks for your reply. I thought that gstreamer's V4L2 plugins require the source for handling DMABUFs to be a V4L2 device, because I seem to remember that I saw ioctl calls somewhere in the gstreamer's code handling V4L2 sources. Is there also the possibility to use v4l2src with DMABUF file descriptors coming from somewhere else (intel GPU driver).

Regarding your other suggestion, you were right, that the format was wrong. I already got vaapipostproc in my pipeline, but the input format accepted seems to be GST_VIDEO_FORMAT_RGBx instead of GST_VIDEO_FORMAT_xRGB.

I can see during debugging that it now continues to run until somewhere else a internal data flow error occurs. I'm trying to find out where it stops.

Basically what I want to do is to render into a texture in another application. This texture is exported using a DMABUF file descriptor and passed to my video recording process. There I want to encode it using the VAAPI h264 encoder and after buffer has been processed I can reuse the buffer within the rendering application.

Therefore it would be also nice if gstreamer can tell me when it is not using the pushed buffer anymore. Is there any callback one could add to maybe the vaapiencode_h264 or vaapipostproc element, that notifies me, when the buffer pushed via appsrc isn't used anymore by the pipeline?

Kind regards,
    Volker




More information about the gstreamer-devel mailing list