GNOME Bugzilla – Bug 647648
videorate: support for caps modifications in a running pipeline
Last modified: 2011-09-26 09:38:13 UTC
videorate element doesn't support framerate modification in a running pipeline for example in a pipeline such this: ... ! videorate ! capsfilter name=vfps ! .. GstCaps *new_caps=gst_caps_from_string("video/x-raw-yuv,framerate=15/1"); g_object_set(G_OBJECT (vfps),"caps",new_caps,NULL); gst_caps_unref(new_caps); doesn't work if the pipeline is in PLAYING state. Other elements such as videoscale support dynamic modifications.
Could you create a simple test case for this, preferably as a patch to tests/check/elements/videorate.c?
David, I can do a qt application that can demonstrate the issue quickly, is this good enough?
No, i meant something that could go into the test suite.
Created attachment 191051 [details] test app that show the problem Attached is a sample application, David I know this is not enough for you, I hope some other developer can play with it and mark this bug as confirmed. The app assume you have a v4l2src device and the fpsdisplay sink element. It start this pipeline: v4l2src ! videorate ! capsfilter name=vfps caps="video/xraw-yuv,framerate=2/1" ! fpsdisplaysink when the pipeline go to play state start a timer that after 10 seconds change the capsfilter with the following code: GstElement *vfps=gst_bin_get_by_name(GST_BIN(pipe),"vfps"); GstCaps *new_caps; //=gst_caps_from_string("video/x-raw-yuv,framerate=15/1"); new_caps = gst_caps_new_simple("video/x-raw-yuv", "framerate",GST_TYPE_FRACTION, 15, 1, NULL); g_object_set(G_OBJECT (vfps),"caps",new_caps,NULL); gst_caps_unref(new_caps); gst_object_unref(vfps); well, fpsdisplaysink will continue to show 2fps even after this change, to compile the app use qmake && make
Yes I have the same problem! the framerate is always 2 even after the timer running for 10 seconds. PS: I am using the code uploaded by Nicola. (In reply to comment #4) > Created an attachment (id=191051) [details] > test app that show the problem > > Attached is a sample application, David I know this is not enough for you, I > hope some other developer can play with it and mark this bug as confirmed. The > app assume you have a v4l2src device and the fpsdisplay sink element. It start > this pipeline: > > v4l2src ! videorate ! capsfilter name=vfps caps="video/xraw-yuv,framerate=2/1" > ! fpsdisplaysink > > when the pipeline go to play state start a timer that after 10 seconds change > the capsfilter with the following code: > > GstElement *vfps=gst_bin_get_by_name(GST_BIN(pipe),"vfps"); > GstCaps *new_caps; > //=gst_caps_from_string("video/x-raw-yuv,framerate=15/1"); > new_caps = gst_caps_new_simple("video/x-raw-yuv", > "framerate",GST_TYPE_FRACTION, 15, 1, > NULL); > g_object_set(G_OBJECT (vfps),"caps",new_caps,NULL); > gst_caps_unref(new_caps); > gst_object_unref(vfps); > > well, fpsdisplaysink will continue to show 2fps even after this change, > > to compile the app use qmake && make
changing the state to NULL for videorate element before the caps change and then set it to play again, make my sample works, not sure if this is the correct behaviour, for example for the videoscale element a caps change to the framesize works without requiring to set the element to NULL and then to PLAY
No, the element should handle caps changes while staying in the PLAYING state.
(In reply to comment #7) > No, the element should handle caps changes while staying in the PLAYING state. How? Could you please give me some instruction of how to change framerate while staying in the PLAYING state? Thanks!
Hi Tom, here is how: GstElement *vrate=gst_bin_get_by_name(GST_BIN(pipe),"vrate"); gst_element_set_state(vrate,GST_STATE_NULL); g_object_set(G_OBJECT (vfps),"caps",new_caps,NULL); gst_element_set_state(vrate,GST_STATE_PLAYING); however according to Sebastian comment, this should be handled by videorate internally, Nicola
Arg, videorate isn't basetransform based. So it's normal that it doesn't work.. We should just rebase it over BaseTransform and we'd get most of it for free.
Not tested but maybe this commit could fix this issue: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=b9b5b133fd911d048295d959e0bb7fda72347469
No but this one should've fixed it: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=ea46b3c706ea99257d2b31cb5c7fb281f43b3178 Please reopen otherwise