Is there a way to crop in VAAPI?

Víctor Jáquez vjaquez at igalia.com
Mon Aug 12 09:23:30 UTC 2019


On Tue, 06 Aug 2019 at 14:31, Yan Wang wrote:
> 
> On 8/5/2019 9:29 PM, Nicolas Dufresne-5 [via GStreamer-devel] wrote:
> > 
> > 
> > Le lun. 5 août 2019 02 h 55, Yan Wang <[hidden email]
> > </user/SendEmail.jtp?type=node&node=4691583&i=0>> a écrit :
> > 
> > 
> >     On 8/3/2019 9:25 PM, Nicolas Dufresne-5 [via GStreamer-devel] wrote:
> > >     Le vendredi 02 août 2019 à 20:45 -0500, kmliu a écrit :
> > > 
> > >     > I need to decode H.264 video via VAAPI and then extract the
> > >     decoded frames to
> > >     > main memory. Since I intend to crop the frames anyway, I'd like
> > >     to crop them
> > >     > while they're still in graphics memory, to reduce memory bandwidth
> > >     > consumption. So conceptually, I want to do this:
> > >     >
> > >     > gst-launch-1.0 rtspsrc location=rtsp_uri ! rtph264depay !
> > >     vaapih264dec !
> > >     > videocrop left=x right=x top=x bottom=x ! filesink
> > >     location=video.yuv

There's a work-in-progress for this:

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/merge_requests/121


> > >     >
> > >     > But I think this will end up copying the whole frames to main
> > >     memory before
> > >     > cropping it there. It would be nice if vaapipostproc supports
> > >     cropping?
> > > 
> > >     Another (simplier) option is to use gltransformation, but apparently
> > >     not all distro ship this plugin.
> > 
> >     May I add the crop option for vaapih264dec?
> > 
> >     It may be more direct.
> > 
> > Sounds wrong to me, and I doubt you'll find an API to support that. If
> > there is one element in VAAPI that may have an API for this it would be
> > vaapipostproc.
> 
> Yes. I know vaapipostproc can do this.
> 
> IMHO, this could be done in decode context too if
> VAConfigAttribDecProcessing can support it.
> 
> https://github.com/intel/libva/blob/master/va/va.h#L520
> 
> Currently It can do scaling (1/8 ~ 8x at most, CSC). Cropping can be the
> special case of scaling.
> 
> If vaapih264dec provides the interface, it can reduce the overhead and power
> because it is fixed function. And no need vaapipostproc context.
> 
> But it may make vaapih264dec more complex and cannot support multiply
> pipelines of decoding. So it is just one possible option.
> 
> Thanks.
> 
> Yan Wang
> 
> > 
> > 
> >     Thanks.
> > 
> >     Yan Wang
> > 
> > 
> > > 
> > >     >
> > >     >
> > >     >
> > >     > --
> > >     > Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> > >     > _______________________________________________
> > >     > gstreamer-devel mailing list
> > >     > [hidden email]
> > >     <http:///user/SendEmail.jtp?type=node&node=4691569&i=0>
> > >     > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > > 
> > >     _______________________________________________
> > >     gstreamer-devel mailing list
> > >     [hidden email]
> > >     <http:///user/SendEmail.jtp?type=node&node=4691569&i=1>
> > >     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > > 
> > >     ------------------------------------------------------------------------
> > >     If you reply to this email, your message will be added to the
> > >     discussion below:
> > >     http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691569.html
> > > 
> > >     To start a new topic under GStreamer-devel, email [hidden email]
> > >     </user/SendEmail.jtp?type=node&node=4691583&i=1>
> > >     To unsubscribe from GStreamer-devel, click here.
> > >     NAML
> > >     <http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> > > 
> >     _______________________________________________
> >     gstreamer-devel mailing list
> >     [hidden email] </user/SendEmail.jtp?type=node&node=4691583&i=2>
> >     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > 
> > 
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email] </user/SendEmail.jtp?type=node&node=4691583&i=3>
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > 
> > ------------------------------------------------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> > http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691583.html
> > 
> > To start a new topic under GStreamer-devel, email
> > ml+s966125n966125h86 at n4.nabble.com
> > To unsubscribe from GStreamer-devel, click here <http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=966125&code=eWFuLndhbmdAbGludXguaW50ZWwuY29tfDk2NjEyNXwxMDk4MzUzMzA=>.
> > NAML <http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
> > 

> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list