is it possible dynamically change framerate in a running pipeline?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

is it possible dynamically change framerate in a running pipeline?

Farkas Levente
hi,
is it possible dynamically change a running pipeline's framerate while
it's in RUNNING state? or should we've to set to READY, set the
framerate and set back to RUNNING? since if've to change it to READY
then we loose a few frame during the state transmission which wouldn't
be useful in case of using a grabber card.
or gstreamer not able to change the capabilities in an already
negotiated pipeline?
thanks in advance.

--
   Levente                               "Si vis pacem para bellum!"

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible dynamically change framerate in a running pipeline?

Tim-Philipp Müller-2
On Sat, 2010-01-09 at 21:23 +0100, Farkas Levente wrote:

Hi,

> is it possible dynamically change a running pipeline's framerate while
> it's in RUNNING state?

Yes.

> or should we've to set to READY, set the
> framerate and set back to RUNNING?

No.

> since if've to change it to READY
> then we loose a few frame during the state transmission which wouldn't
> be useful in case of using a grabber card.
> or gstreamer not able to change the capabilities in an already
> negotiated pipeline?

It depends a bit on the elements involved, but there's no problem in
principle with changing the framerate on the fly. The framerate field in
the caps is at best indicative, what matters more are timestamps on
buffers (and the initial newsegment event). Some elements (e.g.
theoraenc) will not react well if you change the input framerate, but
most elements won't really care and just process things based on the
timestamps.

Cheers
 -Tim



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: is it possible dynamically change framerate in a running pipeline?

John Buckley

Tim-Philipp Müller-2 wrote
On Sat, 2010-01-09 at 21:23 +0100, Farkas Levente wrote:

Hi,

> is it possible dynamically change a running pipeline's framerate while
> it's in RUNNING state?

Yes.

> or should we've to set to READY, set the
> framerate and set back to RUNNING?

No.

> since if've to change it to READY
> then we loose a few frame during the state transmission which wouldn't
> be useful in case of using a grabber card.
> or gstreamer not able to change the capabilities in an already
> negotiated pipeline?

It depends a bit on the elements involved, but there's no problem in
principle with changing the framerate on the fly. The framerate field in
the caps is at best indicative, what matters more are timestamps on
buffers (and the initial newsegment event). Some elements (e.g.
theoraenc) will not react well if you change the input framerate, but
most elements won't really care and just process things based on the
timestamps.

Cheers
 -Tim

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Do you know of any example code of changing these parameters on the fly?
I would like to apply this approach to videocrop, videoscale & the image size...

-John Buckley

Reply | Threaded
Open this post in threaded view
|

Re: is it possible dynamically change framerate in a running pipeline?

Tim-Philipp Müller-2
On Thu, 2010-01-14 at 13:09 -0800, John Buckley wrote:

> Do you know of any example code of changing these parameters on the fly?
> I would like to apply this approach to videocrop, videoscale & the image
> size...

http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/videocrop-test.c

does something along those lines (run with --with-ffmpegcolorspace). Not
sure if the pad blocking that the code there does is still needed.

Cheers
 -tim



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gst-devel] is it possible dynamically change framerate in a running pipeline?

Tamas Korodi
Is there any example code that demonstrates capability renegotiation? For example changing the framerate of a running pipeline, because as i saw in most cases framerate values are set through capabilities, not through properties.
I already tried to change capsfilter's capabilities in the videotestsrc ! capsfilter ! xvimagesink pipeline in PLAYING state, but it didn't work.

Cheers,
Tamas

On Fri, Jan 15, 2010 at 1:10 AM, Tim-Philipp Müller <[hidden email]> wrote:
On Thu, 2010-01-14 at 13:09 -0800, John Buckley wrote:

> Do you know of any example code of changing these parameters on the fly?
> I would like to apply this approach to videocrop, videoscale & the image
> size...

http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/videocrop-test.c

does something along those lines (run with --with-ffmpegcolorspace). Not
sure if the pad blocking that the code there does is still needed.

Cheers
 -tim



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
kotyoTK

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gst-devel] is it possible dynamically change framerate in a running pipeline?

Farkas Levente
Tim,
could you show us a few lines of example?
thanks in advance.
regards.

On 01/20/2010 05:59 PM, Tamas Korodi wrote:

> Is there any example code that demonstrates capability renegotiation?
> For example changing the framerate of a running pipeline, because as i
> saw in most cases framerate values are set through capabilities, not
> through properties.
> I already tried to change capsfilter's capabilities in the videotestsrc
> ! capsfilter ! xvimagesink pipeline in PLAYING state, but it didn't work.
>
> Cheers,
> Tamas
>
> On Fri, Jan 15, 2010 at 1:10 AM, Tim-Philipp Müller <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Thu, 2010-01-14 at 13:09 -0800, John Buckley wrote:
>
>      > Do you know of any example code of changing these parameters on
>     the fly?
>      > I would like to apply this approach to videocrop, videoscale &
>     the image
>      > size...
>
>     http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/videocrop-test.c
>
>     does something along those lines (run with --with-ffmpegcolorspace). Not
>     sure if the pad blocking that the code there does is still needed.
>
>     Cheers
>       -tim
>
>
>
>     ------------------------------------------------------------------------------
>     Throughout its 18-year history, RSA Conference consistently attracts the
>     world's best and brightest in the field, creating opportunities for
>     Conference
>     attendees to learn about information security's most important
>     issues through
>     interactions with peers, luminaries and emerging and established
>     companies.
>     http://p.sf.net/sfu/rsaconf-dev2dev
>     _______________________________________________
>     gstreamer-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
>
> --
> kotyoTK
>
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for Conference
> attendees to learn about information security's most important issues through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


--
   Levente                               "Si vis pacem para bellum!"

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: [gst-devel] is it possible dynamically change framerate in a running pipeline?

Tamas Korodi
Hi,

I looked the debug info of the above mentioned pipeline (videotestsrc ! capsfilter ! xvimagesink). When i changed the capsfilter's caps property from 20 fps to 1 fps, i got these lines:

-------------------
capsfilter gstcapsfilter.c:162:gst_capsfilter_set_property: set new caps video/x-raw-yuv, framerate=(fraction)1/1, width=(int)176, height=(int)144
capsfilter gstcapsfilter.c:175:gst_capsfilter_set_property: we had negotiated caps video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)20/1
capsfilter gstcapsfilter.c:183:gst_capsfilter_set_property: copied structure fields
basetransform gstbasetransform.c:2432:gst_base_transform_suggest: new suggest video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)1/1
basetransform gstbasetransform.c:1470:gst_base_transform_buffer_alloc:<caps01:sink>alloc with caps video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)20/1, size 50688
basetransform gstbasetransform.c:1496:gst_base_transform_buffer_alloc:<caps01>new format video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)20/1
basetransform gstbasetransform.c:1504:gst_base_transform_buffer_alloc:<caps01>have suggestion video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)1/1
basetransform gstbasetransform.c:462:gst_base_transform_transform_caps:<caps01>transform caps (direction = 2)
capsfilter gstcapsfilter.c:253:gst_capsfilter_transform_caps:<caps01>filter:    video/x-raw-yuv, framerate=(fraction)1/1, width=(int)176, height=(int)144
capsfilter gstcapsfilter.c:254:gst_capsfilter_transform_caps:<caps01>intersect: video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)1/1
basetransform gstbasetransform.c:503:gst_base_transform_transform_caps:<caps01> to: (1) video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)1/1
basetransform gstbasetransform.c:792:gst_base_transform_find_transform:<caps01> intersecting against padtemplate ANY
...
GST_CAPS gstpad.c:2436:gst_pad_set_caps:<src01:src> caps video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)1/1
...
GST_PADS gstpad.c:2263:gst_pad_acceptcaps_default:<xvsink01:sink> caps video/x-raw-yuv, format=(fourcc)YUY2, width=(int)176, height=(int)144, framerate=(fraction)1/1
-------------------

It seems to me that the capabilities are changed to 1 fps, on both the source and the sink side, but the pipeline freezed. I don't have any idea why. 
Before i changed the capsfilter's caps property i blocked the source element's source pad, after it i unblocked it. Did i do it right, or what is the correct way of changing the capabilities of a pad?

Please give me some info or example code about it!

BR, 
Tamas


On Thu, Jan 21, 2010 at 9:35 AM, Farkas Levente <[hidden email]> wrote:
Tim,
could you show us a few lines of example?
thanks in advance.
regards.

On 01/20/2010 05:59 PM, Tamas Korodi wrote:
> Is there any example code that demonstrates capability renegotiation?
> For example changing the framerate of a running pipeline, because as i
> saw in most cases framerate values are set through capabilities, not
> through properties.
> I already tried to change capsfilter's capabilities in the videotestsrc
> ! capsfilter ! xvimagesink pipeline in PLAYING state, but it didn't work.
>
> Cheers,
> Tamas
>
> On Fri, Jan 15, 2010 at 1:10 AM, Tim-Philipp Müller <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     On Thu, 2010-01-14 at 13:09 -0800, John Buckley wrote:
>
>      > Do you know of any example code of changing these parameters on
>     the fly?
>      > I would like to apply this approach to videocrop, videoscale &
>     the image
>      > size...
>
>     http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/icles/videocrop-test.c
>
>     does something along those lines (run with --with-ffmpegcolorspace). Not
>     sure if the pad blocking that the code there does is still needed.
>
>     Cheers
>       -tim
>
>
>
>     ------------------------------------------------------------------------------
>     Throughout its 18-year history, RSA Conference consistently attracts the
>     world's best and brightest in the field, creating opportunities for
>     Conference
>     attendees to learn about information security's most important
>     issues through
>     interactions with peers, luminaries and emerging and established
>     companies.
>     http://p.sf.net/sfu/rsaconf-dev2dev
>     _______________________________________________
>     gstreamer-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
>
>
> --
> kotyoTK
>
>
>
> ------------------------------------------------------------------------------
> Throughout its 18-year history, RSA Conference consistently attracts the
> world's best and brightest in the field, creating opportunities for Conference
> attendees to learn about information security's most important issues through
> interactions with peers, luminaries and emerging and established companies.
> http://p.sf.net/sfu/rsaconf-dev2dev
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


--
  Levente                               "Si vis pacem para bellum!"

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
kotyoTK

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel