<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 7 août 2019 02 h 55, Yan Wang <<a href="mailto:yan.wang@linux.intel.com">yan.wang@linux.intel.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<div class="m_6399927642507458517moz-cite-prefix">On 8/7/2019 9:40 AM, Nicolas Dufresne-5
[via GStreamer-devel] wrote:<br>
</div>
<blockquote type="cite">
Le mardi 06 août 2019 à 14:31 +0800, Yan Wang a écrit :
<div class="m_6399927642507458517shrinkable-quote"><br>
> <br>
> On 8/5/2019 9:29 PM, Nicolas Dufresne-5 [via
GStreamer-devel] wrote:
<br>
> > <br>
> > Le lun. 5 août 2019 02 h 55, Yan Wang <[hidden
email]> a écrit :
<br>
> > > <br>
> > > On 8/3/2019 9:25 PM, Nicolas Dufresne-5 [via
GStreamer-devel] wrote:
<br>
> > > > Le vendredi 02 août 2019 à 20:45 -0500,
kmliu a écrit :
<br>
> > > > <br>
> > > > > I need to decode H.264 video via VAAPI
and then extract the decoded frames to <br>
> > > > > main memory. Since I intend to crop the
frames anyway, I'd like to crop them <br>
> > > > > while they're still in graphics memory,
to reduce memory bandwidth <br>
> > > > > consumption. So conceptually, I want to
do this: <br>
> > > > > <br>
> > > > > gst-launch-1.0 rtspsrc
location=rtsp_uri ! rtph264depay ! vaapih264dec ! <br>
> > > > > videocrop left=x right=x top=x bottom=x
! filesink location=video.yuv <br>
> > > > > <br>
> > > > > But I think this will end up copying
the whole frames to main memory before <br>
> > > > > cropping it there. It would be nice if
vaapipostproc supports cropping?
<br>
> > > > <br>
> > > > Another (simplier) option is to use
gltransformation, but apparently <br>
> > > > not all distro ship this plugin. <br>
> > > <br>
> > > May I add the crop option for vaapih264dec? <br>
> > > <br>
> > > It may be more direct.
<br>
> > > <br>
> > > <br>
> > <br>
> > 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.
<br>
> <br>
> Yes. I know vaapipostproc can do this. <br>
> <br>
> IMHO, this could be done in decode context too if
VAConfigAttribDecProcessing can support it.
<br>
> <br>
> <a href="https://github.com/intel/libva/blob/master/va/va.h#L520" rel="nofollow noreferrer" link="external" target="_blank">https://github.com/intel/libva/blob/master/va/va.h#L520</a><br>
> <br>
> Currently It can do scaling (1/8 ~ 8x at most, CSC).
Cropping can be the special case of scaling.
<br>
> <br>
> If vaapih264dec provides the interface, it can reduce the
overhead and power because it is fixed function. And no need
vaapipostproc context.
<br>
> <br>
> But it may make vaapih264dec more complex and cannot
support multiply pipelines of decoding. So it is just one
possible option.
</div>
<br>
If you know how it works, just give it a try. You can find similar
code
<br>
in -good/sys/gstv4l2videodec.c, but only for the CSC bit. Scaling
is
<br>
more complex though, because of the pixel aspect ratio handling.
It's
<br>
this a proper scaler or just multiple of 2 ?
<br>
</blockquote>
<p>I will check -good/sys/gstv4l2videodec.c.</p>
<p>This scaling/CSC has some limitation. It could be attached only
one decoding pipeline.</p>
<p>So it is different with normal videopostproc pipeline but
videopostproc pipeline could select it too. The logic of the
selection should be in media driver currently.</p>
<p>Of course, it can also be selected in gstreamer-vaapi directly.<br>
</p>
<p>Thanks for your comments.</p></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Yes, I'm familiar with those CSC, Coda IP from chip&media and Hantro IP (used in rockchip and imx8) have similar features. I guess when enabled, there will be two set of output surfaces ?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
<p>Yan Wang<br>
</p>
<blockquote type="cite">
<div class="m_6399927642507458517shrinkable-quote"><br>
> <br>
> Thanks.
<br>
> <br>
> Yan Wang
<br>
> <br>
> > <br>
> > > Thanks.
<br>
> > > <br>
> > > Yan Wang
<br>
> > > <br>
> > > <br>
> > > <br>
> > > > > <br>
> > > > > <br>
> > > > > <br>
> > > > > -- <br>
> > > > > Sent from: <a href="http://gstreamer-devel.966125.n4.nabble.com/" rel="nofollow noreferrer" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/</a><br>
> > > > >
_______________________________________________ <br>
> > > > > gstreamer-devel mailing list <br>
> > > > > [hidden email] <br>
> > > > > <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow noreferrer" link="external" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
> > > > <br>
> > > >
_______________________________________________ <br>
> > > > gstreamer-devel mailing list <br>
> > > > [hidden email] <br>
> > > > <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow noreferrer" link="external" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br>
> > > > <br>
> > > > If you reply to this email, your message
will be added to the discussion below:
<br>
> > > > <a href="http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691569.html" rel="nofollow noreferrer" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691569.html</a><br>
> > > > To start a new topic under GStreamer-devel,
email [hidden email] <br>
> > > > To unsubscribe from GStreamer-devel, click
here.
<br>
> > > > NAML
<br>
> > > <br>
> > > _______________________________________________
<br>
> > > gstreamer-devel mailing list
<br>
> > > [hidden email]
<br>
> > > <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow noreferrer" link="external" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
> > <br>
> > _______________________________________________ <br>
> > gstreamer-devel mailing list <br>
> > [hidden email] <br>
> > <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow noreferrer" link="external" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br>
> > <br>
> > If you reply to this email, your message will be added
to the discussion below:
<br>
> > <a href="http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691583.html" rel="nofollow noreferrer" link="external" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691583.html</a><br>
> > To start a new topic under GStreamer-devel, email <a href="http:///user/SendEmail.jtp?type=node&node=4691613&i=0" rel="nofollow noreferrer" link="external" target="_blank">[hidden email]</a> <br>
> > To unsubscribe from GStreamer-devel, click here.
<br>
> > NAML
<br>
> <br>
> _______________________________________________
<br>
> gstreamer-devel mailing list
<br>
> <a href="http:///user/SendEmail.jtp?type=node&node=4691613&i=1" rel="nofollow noreferrer" link="external" target="_blank">[hidden email]</a>
<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow noreferrer" link="external" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div>
<br>
_______________________________________________
<br>
gstreamer-devel mailing list
<br>
<a href="http:///user/SendEmail.jtp?type=node&node=4691613&i=2" rel="nofollow noreferrer" link="external" target="_blank">[hidden email]</a>
<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="nofollow noreferrer" link="external" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
<br>
<br>
<hr size="1" noshade color="#cccccc">
<div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
<div style="font-weight:bold">If you reply to this email, your
message will be added to the discussion below:</div>
<a href="http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691613.html" target="_blank" rel="noreferrer">http://gstreamer-devel.966125.n4.nabble.com/Is-there-a-way-to-crop-in-VAAPI-tp4691566p4691613.html</a>
</div>
<div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
To start a new topic under GStreamer-devel, email
<a class="m_6399927642507458517moz-txt-link-abbreviated" href="mailto:ml+s966125n966125h86@n4.nabble.com" target="_blank" rel="noreferrer">ml+s966125n966125h86@n4.nabble.com</a> <br>
To unsubscribe from GStreamer-devel, <a href="http://gstreamer-devel.966125.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=966125&code=eWFuLndhbmdAbGludXguaW50ZWwuY29tfDk2NjEyNXwxMDk4MzUzMzA=" target="_blank" rel="noreferrer">click here</a>.<br>
<a href="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" rel="nofollow noreferrer" style="font:9px serif" target="_blank">NAML</a>
</div>
</blockquote>
</div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div></div></div>