After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 797095 - vaapipostproc: deinterlace does not take effect with media-driver
vaapipostproc: deinterlace does not take effect with media-driver
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-09-07 06:41 UTC by Jason
Modified: 2018-10-10 01:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Log of libva and media driver (103.41 KB, text/plain)
2018-09-07 06:41 UTC, Jason
  Details
media sample (2.57 MB, video/mp4)
2018-09-10 09:20 UTC, Jason
  Details
vaapipostproc: change the way of handling deinterlace (2.01 KB, patch)
2018-10-03 06:20 UTC, Soon, Thean Siew
none Details | Review
vaapipostproc: change the way of handling deinterlace v2 (1.35 KB, patch)
2018-10-03 10:22 UTC, Soon, Thean Siew
committed Details | Review

Description Jason 2018-09-07 06:41:55 UTC
Created attachment 373557 [details]
Log of libva and media driver

The issue is from https://github.com/intel/media-driver/issues/181.
It is a Decode+DI case. I checked it on media driver side, found that gstreamer-vaapi didn’t call VP pipeline to do deinterlace. For such Decode+DI case, after decoding, vp context should be created, and then setup DI parameters, and then call VP pipeline to do DI processing.
Comment 1 Víctor Manuel Jáquez Leal 2018-09-07 10:20:12 UTC
did you check with vaapi-intel-driver?
Comment 2 Jason 2018-09-10 03:03:52 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #1)
> did you check with vaapi-intel-driver?

Yes, if using vaapi-intel-driver, it do take effect, but the output is not expected, a black bar can obviously seen at top and bottom of the video, it seems two field is simply splitted into two frames.  And when change to using different deinterlace method, it doesn't work and always output the same result.
Comment 3 Víctor Manuel Jáquez Leal 2018-09-10 06:59:31 UTC
Can you share the media sample? 

H264_Main@L2.2_0720x0576_03.9Mbps_10.0fps_Interlaced_Sound_ToTheLimit@.mp4
Comment 4 Jason 2018-09-10 09:20:22 UTC
Created attachment 373582 [details]
media sample
Comment 5 Soon, Thean Siew 2018-10-02 10:15:18 UTC
It seems like it's due to the reason where gstreamer-vaapi will only call driver's VP pipeline if it's ADI. Code as below in gst/vaapi/gstvaapipostproc.c:

if (postproc->flags) {
    /* Use VA/VPP extensions to process this frame */
    if (postproc->has_vpp &&
        (postproc->flags != GST_VAAPI_POSTPROC_FLAG_DEINTERLACE ||
            deint_method_is_advanced (postproc->deinterlace_method))) {
      ret = gst_vaapipostproc_process_vpp (trans, buf, outbuf);
      if (ret != GST_FLOW_NOT_SUPPORTED)
        goto done;
      GST_WARNING_OBJECT (postproc, "unsupported VPP filters. Disabling");
    }

    /* Only append picture structure meta data (top/bottom field) */
    if (postproc->flags & GST_VAAPI_POSTPROC_FLAG_DEINTERLACE) {
      ret = gst_vaapipostproc_process (trans, buf, outbuf);
      if (ret != GST_FLOW_NOT_SUPPORTED)
        goto done;
    }
  }

I did a quick test on my side by calling gst_vaapipostproc_process_vpp even though it's not ADI, and BOB deinterlace works correctly with media driver. Is there any specific reason with the current code where it will call VP pipeline only if it's ADI?
Comment 6 Soon, Thean Siew 2018-10-03 06:20:51 UTC
Created attachment 373829 [details] [review]
vaapipostproc: change the way of handling deinterlace

I am trying to resolve this issue with the attached patch. Can you please review if the change make sense?
Comment 7 Víctor Manuel Jáquez Leal 2018-10-03 08:45:59 UTC
Comment on attachment 373829 [details] [review]
vaapipostproc: change the way of handling deinterlace

Thanks for the patch!

A couple first questions: 

1. What does mean VP? video processing?
2. What does mean ADI? A-de-interlace?
3. Did you tested it without VPP capability support?
Comment 8 Soon, Thean Siew 2018-10-03 10:22:09 UTC
(In reply to Víctor Manuel Jáquez Leal from comment #7)
> Comment on attachment 373829 [details] [review] [review]
> vaapipostproc: change the way of handling deinterlace
> 
> Thanks for the patch!
> 
> A couple first questions: 
> 
> 1. What does mean VP? video processing?
Yes VP refers to video processing. 

> 2. What does mean ADI? A-de-interlace?
That's referring to Adcanced deinterlacing

> 3. Did you tested it without VPP capability support?
Ouch. Sorry I missed that. I updated the patch so that it remains appending the picture structure meta data when it does not have VPP capabilities support. The changes is very simple now by not limiting driver's deinterlacing capabilities for advance method only.
Comment 9 Soon, Thean Siew 2018-10-03 10:22:41 UTC
Created attachment 373831 [details] [review]
vaapipostproc: change the way of handling deinterlace v2
Comment 10 Víctor Manuel Jáquez Leal 2018-10-09 14:56:53 UTC
attachment 373831 [details] [review] was pushed as commit ee27377c - vaapipostproc: change the way of handling deinterlaced
Comment 11 Jason 2018-10-10 01:30:19 UTC
Thanks all of you.