Cropping with compositor?

Florian Echtler floe at butterbrot.org
Fri Aug 11 05:17:58 UTC 2023


Hello Tim,

that was an excellent suggestion, thanks 😁

For future reference, the equivalent Python code looks like this (for cropping 
out a centered 640x720 slice from a 1280x720 video):

             pad.set_property("xpos",offsets[padnum][0])
             pad.set_property("ypos",offsets[padnum][1])
             pad.set_property("width",640)
             pad.set_property("height",720)

             cc = Gst.Structure.new_empty("cc")
             cc.set_value("GstVideoConverter.src-x",320)
             cc.set_value("GstVideoConverter.src-width",640)
             pad.set_property("converter-config",cc)

Note that you need to set both the "width" pad property and the "src-width" 
config item to the same value, otherwise it won't work.

Thanks again and best, Florian

On 10.08.23 21:16, Tim-Philipp Müller via gstreamer-devel wrote:
> 
>>> is there any way to achieve cropping of input video streams with compositor,
>>> without using extra videocrop/videobox elements?
>>
>> I think you might be able to do that with the "converter-config" ..., but I 
>> don't have any
>> example code to point at
> 
> There's an example here actually:
> 
> https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/main/examples/src/bin/video_converter.rs#L24 <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/blob/main/examples/src/bin/video_converter.rs#L24>
> 
> Cheers
>   Tim
> 

-- 
SENT FROM MY DEC VT50 TERMINAL

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20230811/dee3e97e/attachment-0001.sig>


More information about the gstreamer-devel mailing list