Re: how to set “aspect-ratio” GstFraction * in element aspectratiocrop

cfd new newcfd at
Mon Jun 26 14:40:06 UTC 2023

 This setting works. Thank you so much, Michael.


    On Friday, June 23, 2023, 07:45:43 PM EDT, Michael Gruner <michael.gruner at> wrote:  
 You can set fractions as:
gint num=4;gint den=3;g_object_set( G_OBJECT( crop ), "aspect-ratio", num, den, NULL );

On 23 Jun 2023, at 16:24, cfd new via gstreamer-devel <gstreamer-devel at> wrote:
I have a pipeline with element aspectratiocrop. When I tried to set aspect-ratio withstd::string crop_str( "4/3" );
auto crop = gst_element_factory_make( "aspectratiocrop", nullptr );
g_object_set( G_OBJECT( crop ), "aspect-ratio", crop_str.c_str(), nullptr );
the app complains about 
passed '0' as denometer for GstFraction. 
How to set it properly?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gstreamer-devel mailing list