This post was updated on .
CONTENTS DELETED
The author has deleted this message.
|
Tom,
you could simply write a gstreamer application. In the capsfilter change the farmerate when needed, this will trigger caps renegotiation. But had never tried, I think this has to be properly supported by the downstream encoder plugin (not sure if jpegenc supports that or not). Best Luck, Kapil On Thu, Mar 10, 2011 at 9:12 AM, Tom <[hidden email]> wrote:
-- www.mediamagictechnologies.com (Gstreamer, ffmpeg, Red5, Streaming) twitter handle: @gst_kaps http://www.linkedin.com/in/kapilagrawal _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by fb8fb8
Hi Tom,
> I use > gst-launch filesrc "location=video/1.MPG" ! decodebin ! videorate ! > video/x-raw-yuv, width=640,height=480,framerate=25/1 ! ffmpegcolorspace ! > jpegenc ! multipartmux ! tcpserversink host=192.168.2.1 port=$portNumber > to stream a video and can change the video frame rate in this way. > But in this way the frame rate is fixed (i.e., framerate=25/1 here). > > I want to change the framerate in REALTIME when video is PLAYING --- > during the streaming of this video, I can change the framerate anytime I > want. Then you need to modify the pipeline from your application. In particular, you need to adjust the caps filter. Here you can find an example how to do it: http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp#line264 It changes width and height property of the named (qos-caps) caps filter by pausing the videoscale element in front of it, updating width and height properties and then un-pausing the videoscale. So in your case you can update the framerate property. However, as Kapil pointed out to work properly, the downstream elements should be able to re-negotiate the new format. HTH, Andrey. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Hello
Another way is to send an appropriate event (through event_new_seek) specifying the rate as parameter. See for instance the set_rate() method in http://svn.gna.org/viewcvs/advene/trunk/lib/advene/player/gstreamer.py?view=markup Olivier On Thu, 2011-03-10 at 09:58 +0100, Andrey Nechypurenko wrote: > Hi Tom, > > > I use > > gst-launch filesrc "location=video/1.MPG" ! decodebin ! videorate ! > > video/x-raw-yuv, width=640,height=480,framerate=25/1 ! ffmpegcolorspace ! > > jpegenc ! multipartmux ! tcpserversink host=192.168.2.1 port=$portNumber > > to stream a video and can change the video frame rate in this way. > > But in this way the frame rate is fixed (i.e., framerate=25/1 here). > > > > I want to change the framerate in REALTIME when video is PLAYING --- > > during the streaming of this video, I can change the framerate anytime I > > want. > > Then you need to modify the pipeline from your application. In > particular, you need to adjust the caps filter. Here you can find an > example how to do it: > http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp#line264 > It changes width and height property of the named (qos-caps) caps > filter by pausing the videoscale element in front of it, updating > width and height properties and then un-pausing the videoscale. So in > your case you can update the framerate property. However, as Kapil > pointed out to work properly, the downstream elements should be able > to re-negotiate the new format. > > HTH, > Andrey. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
This post was updated on .
In reply to this post by Andrey Nechypurenko-2
CONTENTS DELETED
The author has deleted this message.
|
Hi Tom,
> existed...http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp#line264 > Could you please give me another example about adjusting the caps filter? Last couple of months I was working on the project rather active and re-organize the source tree quite a bit. Please try the following link: https://www.gitorious.org/veter/vehicle/blobs/master/src/VideoSenderThread.cpp#line253 Regards, Andrey. ---------------------------------------- Blog: http://veter-project.blogspot.com > Thank you very much! > > Tom > > On Thu, Mar 10, 2011 at 2:58 AM, Andrey Nechypurenko > <[hidden email]> wrote: >> >> Hi Tom, >> >> > I use >> > gst-launch filesrc "location=video/1.MPG" ! decodebin ! videorate ! >> > video/x-raw-yuv, width=640,height=480,framerate=25/1 ! ffmpegcolorspace >> > ! >> > jpegenc ! multipartmux ! tcpserversink host=192.168.2.1 port=$portNumber >> > to stream a video and can change the video frame rate in this way. >> > But in this way the frame rate is fixed (i.e., framerate=25/1 here). >> > >> > I want to change the framerate in REALTIME when video is PLAYING --- >> > during the streaming of this video, I can change the framerate anytime I >> > want. >> >> Then you need to modify the pipeline from your application. In >> particular, you need to adjust the caps filter. Here you can find an >> example how to do it: >> >> http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp#line264 >> It changes width and height property of the named (qos-caps) caps >> filter by pausing the videoscale element in front of it, updating >> width and height properties and then un-pausing the videoscale. So in >> your case you can update the framerate property. However, as Kapil >> pointed out to work properly, the downstream elements should be able >> to re-negotiate the new format. >> >> HTH, >> Andrey. >> _______________________________________________ >> gstreamer-devel mailing list >> [hidden email] >> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > > > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > > gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Il 10/07/2011 11:21, Andrey Nechypurenko ha scritto:
> Hi Tom, > >> existed...http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp#line264 >> Could you please give me another example about adjusting the caps filter? > Last couple of months I was working on the project rather active and > re-organize the source tree quite a bit. > Please try the following link: > https://www.gitorious.org/veter/vehicle/blobs/master/src/VideoSenderThread.cpp#line253 Andrey, changing framesize works for me too but the framerate doesn't, please take a look to the sample code I posted in this bug report: https://bugzilla.gnome.org/show_bug.cgi?id=647648 seems videorate element is not able to renegotiate the new format, could you see something wrong in my sample? thanks NIcola > > Regards, > Andrey. > ---------------------------------------- > Blog: http://veter-project.blogspot.com > > >> Thank you very much! >> >> Tom >> >> On Thu, Mar 10, 2011 at 2:58 AM, Andrey Nechypurenko >> <[hidden email]> wrote: >>> Hi Tom, >>> >>>> I use >>>> gst-launch filesrc "location=video/1.MPG" ! decodebin ! videorate ! >>>> video/x-raw-yuv, width=640,height=480,framerate=25/1 ! ffmpegcolorspace >>>> ! >>>> jpegenc ! multipartmux ! tcpserversink host=192.168.2.1 port=$portNumber >>>> to stream a video and can change the video frame rate in this way. >>>> But in this way the frame rate is fixed (i.e., framerate=25/1 here). >>>> >>>> I want to change the framerate in REALTIME when video is PLAYING --- >>>> during the streaming of this video, I can change the framerate anytime I >>>> want. >>> Then you need to modify the pipeline from your application. In >>> particular, you need to adjust the caps filter. Here you can find an >>> example how to do it: >>> >>> http://gitorious.org/veter/veter/blobs/master/src/vehicle/VideoSenderThread.cpp#line264 >>> It changes width and height property of the named (qos-caps) caps >>> filter by pausing the videoscale element in front of it, updating >>> width and height properties and then un-pausing the videoscale. So in >>> your case you can update the framerate property. However, as Kapil >>> pointed out to work properly, the downstream elements should be able >>> to re-negotiate the new format. >>> >>> HTH, >>> Andrey. >>> _______________________________________________ >>> gstreamer-devel mailing list >>> [hidden email] >>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel >> >> _______________________________________________ >> gstreamer-devel mailing list >> [hidden email] >> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel >> >> > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
> changing framesize works for me too but the framerate doesn't, please take a
> look to the sample code I posted in this bug report: > > https://bugzilla.gnome.org/show_bug.cgi?id=647648 > > seems videorate element is not able to renegotiate the new format, could you > see something wrong in my sample? Well, the only thing which might make the difference is that before changing the caps, I am setting the element state to NULL: gst_element_set_state(qos_scaler, GST_STATE_NULL); and after making changes, set the state back to PLAYING. Not sure that it will change something in your case, but I guess I read somewhere that it is in general necessary. Regards, Andrey. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Il 10/07/2011 17:23, Andrey Nechypurenko ha scritto:
>> changing framesize works for me too but the framerate doesn't, please take a >> look to the sample code I posted in this bug report: >> >> https://bugzilla.gnome.org/show_bug.cgi?id=647648 >> >> seems videorate element is not able to renegotiate the new format, could you >> see something wrong in my sample? > Well, the only thing which might make the difference is that before > changing the caps, I am setting the element state to NULL: > gst_element_set_state(qos_scaler, GST_STATE_NULL); > and after making changes, set the state back to PLAYING. Not sure that > it will change something in your case, but I guess I read somewhere > that it is in general necessary. you are right changing the element state to null and then to play make it work, however changing the framesize doesn't require the state change, thanks Nicola > > > Regards, > Andrey. > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Andrey Nechypurenko-2
Hi Andrey,
I followed your example and it works for me. I added gst_element_set_state(pipe,GST_STATE_NULL); before changing framerate, and also added gst_element_set_state(pipe,GST_STATE_PLAYING); after changing framerate. This changed the framerate. But another problem came by: The video window closed and re-opened at the moment of framerate changing. I want to make the window stay there and ONLY the videoframe change. Is there some way to make the video window never close while changing framerate? Thanks! Tom On Sun, Jul 10, 2011 at 4:21 AM, Andrey Nechypurenko <[hidden email]> wrote: Hi Tom, _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Il 10/07/2011 23:12, Tom ha scritto:
Hi Andrey, you need to set to NULL and then to PLAY only the videorate element not the whole pipeline, Nicola
_______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Andrey Nechypurenko-2
On 07/10/11 17:23, Andrey Nechypurenko wrote:
>> changing framesize works for me too but the framerate doesn't, please take a >> look to the sample code I posted in this bug report: >> >> https://bugzilla.gnome.org/show_bug.cgi?id=647648 >> >> seems videorate element is not able to renegotiate the new format, could you >> see something wrong in my sample? > Well, the only thing which might make the difference is that before > changing the caps, I am setting the element state to NULL: > gst_element_set_state(qos_scaler, GST_STATE_NULL); Stefan > and after making changes, set the state back to PLAYING. Not sure that > it will change something in your case, but I guess I read somewhere > that it is in general necessary. > > > Regards, > Andrey. > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by fb8fb8
On 07/10/11 23:12, Tom wrote:
Hi Andrey,You will want to manage your own window in the long-run and now rely on gst's fallback window. Have a look at the gstxoverlay docs. Stefan I want to make the window stay there and ONLY the videoframe change. _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Stefan Sauer
Il 11/07/2011 16:52, Stefan Kost ha scritto:
> On 07/10/11 17:23, Andrey Nechypurenko wrote: >>> changing framesize works for me too but the framerate doesn't, please take a >>> look to the sample code I posted in this bug report: >>> >>> https://bugzilla.gnome.org/show_bug.cgi?id=647648 >>> >>> seems videorate element is not able to renegotiate the new format, could you >>> see something wrong in my sample? >> Well, the only thing which might make the difference is that before >> changing the caps, I am setting the element state to NULL: >> gst_element_set_state(qos_scaler, GST_STATE_NULL); > wouldn't READY be enough? requiring a state change, Nicola > Stefan >> and after making changes, set the state back to PLAYING. Not sure that >> it will change something in your case, but I guess I read somewhere >> that it is in general necessary. >> >> >> Regards, >> Andrey. >> _______________________________________________ >> gstreamer-devel mailing list >> [hidden email] >> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ > gstreamer-devel mailing list > [hidden email] > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel > _______________________________________________ gstreamer-devel mailing list [hidden email] http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |