Re: Cropping with compositor?
Florian Echtler via gstreamer-devel <[email protected]>
| Newsgroups | gmane.comp.video.gstreamer.devel |
|---|---|
| Message-ID | <[email protected]> |
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
OpenPGP_signature
(application/pgp-signature, 203 B) - not displayed