With VA-API intel-driver 1.3.1 on IVB, or on SNB with the SNB MADI backport applied, I see issues when I upload YUY2 surfaces from a V4L2 capture card to VA-API for deinterlacing using gstreamer-vaapi version 0.5.8 with the patch from https://bugzilla.gnome.org/show_bug.cgi?id=726361 applied to enable me to force deinterlacing.
My pipeline looks like:
gst-launch-1.0 v4l2src ! vaapipostproc deinterlace-mode=interlaced deinterlace-method=motion-adaptive ! vaapisink
The problem is that the reference frame passed to hardware is still in YUY2 format, whereas the hardware is expecting NV12 format. I've come up with a very hacky patch which "fixes" the problem, which I'll attach to this bug.
Created attachment 100041 [details] [review]
Hacky patch that fixes the deinterlacing bug
This patch isn't suitable for applying to the source tree as-is. It puts in a special case for MADI, where the colour space conversion is applied to the reference frame, too.
Applying this "fixes" my issue with deinterlacing YUY2 surfaces, implying that it's about colour space of the reference frame.
It would be better to fix this issue in gstreamer-vaapi, could you file a bug in gsteamer bugzilla to track the issue ?
(In reply to comment #2)
> It would be better to fix this issue in gstreamer-vaapi, could you file a
> bug in gsteamer bugzilla to track the issue ?
I'll file a bug there, too.
At a minimum, though, intel-driver needs to reject the reference surface if it's in the wrong format, just as it refuses to work without a reference surface. I'll cook up a quick patch to show what I mean.
Created attachment 100098 [details] [review]
Patch against staging to reject non-NV12 surfaces
This patch (against the staging branch) simply has intel-driver reject non-NV12 references on SNB and IVB, returning the same error code (different warning message) as it would if you asked for MADI without providing a reference surface.
I haven't gone deep enough into MCDI and MADI on HSW/BDW to work out whether they need a similar patch.
https://bugzilla.gnome.org/show_bug.cgi?id=730925 filed for gstreamer-vaapi.
the patch Patch against staging to reject non-NV12 surfaces has been sent to Libva <firstname.lastname@example.org>. and assign to you.
I can't find the patch in my archive of the list. Could someone give me a pointer to it?
Sorry for slow response. do you still experience this issue?
(In reply to haihao from comment #9)
> Sorry for slow response. do you still experience this issue?
I've left ONELAN, and no longer have access to this hardware. You should be able to reproduce with the details in comment #0 if it's still an issue on IVB or SNB.