Is there a way to crop in VAAPI?

Nicolas Dufresne nicolas at ndufresne.ca
Sat Aug 3 13:14:15 UTC 2019


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 
> 
> 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?

You can use the glvideomixelement for that. Only limitationis that it
won't let you break aspect ratio (from my testing).

... ! vaapih264dec ! vaapipostproc ! glupload ! glcolorconvert ! glvideomixerelement sink_0::xpos=-160 sink_0::width=640 sink_0::ypos=-120 sink_0::height=480 ! video/x-raw\(memory:GLMemory\),width=320,height=240 ! glcolorconvert ! gldownload ! gtksink

> 
> 
> 
> --
> Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> _______________________________________________
> 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