fercis
fercis

Reputation: 631

How to define "framerate" property of videoparse element in gstreamer in C

I am currently developing an application using gstreamer using C. I included all the gstreamer library include paths, glib paths, library paths etc. When I try to build an application using Gstreamer lib to play a raw file on the screen, everything works ok.

But, I want to set "framerate" property of the videoparse element described here:

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-videoparse.html

But the type of the framerate is GstFraction. But there is no GstFraction data type in the Gstreamer library. Also from the link, I cannot be redirected to the description of GstFraction... (Unlike GstVideoFormat, I found it under the header gst/video/video.h)

I searched many web posts, all of them are about the python API of the gstreamer-sdk.

Upvotes: 0

Views: 1588

Answers (2)

Aidenhjj
Aidenhjj

Reputation: 1289

It's a fraction type and so you have to set as follows:

g_object_set(videoparser, "framerate", 15, 1, NULL);

Upvotes: 2

S.Seba
S.Seba

Reputation: 121

try this:

GstElement *videoparser;  
...  
...
g_object_set(videoparser,"framerate","15/1",NULL);

https://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-object-set

Upvotes: -1

Related Questions