I have a simplified test pipeline consisting of:
v4l2src -> ffmpegcolorspace --> videoscale --> ximagesink I would like to detect a loss of signal from the v4lsrc (currently doing by waiting for the EOS signal, though the v42lsrc provides better warnings on camera disconnection if I can figure out how to get them). For now, I'm trying to achieve the simpler case of simply switching the source element to a videotestsrc while the pipeline is playing. I've read the information about pad blocking (http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt), but it doesn't provide any indication on what to do for changing the source element. I read that it may be possible to simply unlink the v4l2src, remove it, add the videotestsrc, and link it. This sort of works in that eventually you see the videotestsrc, but it updates the output every few seconds (like a very slow stuttering). If I stop and play, the output is smooth. I was wondering if anyone could point me towards an example or help me find the search terms to find the proper way to change out the source element on a playing pipeline. Thanks, Louis |
On 10/30/2011 03:40 AM, superlou wrote:
> I have a simplified test pipeline consisting of: > v4l2src -> ffmpegcolorspace --> videoscale --> ximagesink > > I would like to detect a loss of signal from the v4lsrc (currently doing by > waiting for the EOS signal, though the v42lsrc provides better warnings on > camera disconnection if I can figure out how to get them). For now, I'm > trying to achieve the simpler case of simply switching the source element to > a videotestsrc while the pipeline is playing. > > I've read the information about pad blocking > (http://cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design/part-block.txt), > but it doesn't provide any indication on what to do for changing the source > element. I read that it may be possible to simply unlink the v4l2src, > remove it, add the videotestsrc, and link it. This sort of works in that > eventually you see the videotestsrc, but it updates the output every few > seconds (like a very slow stuttering). If I stop and play, the output is > smooth. that you use on v4l2src to videotestsrc. Stefan > I was wondering if anyone could point me towards an example or help me find > the search terms to find the proper way to change out the source element on > a playing pipeline. > > Thanks, > Louis > > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Changing-source-without-stopping-pipeline-tp3952239p3952239.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > 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 |
> You might want to use "videotestsrc ! capsfilter" and set the format
> that you use on v4l2src to videotestsrc. I had actually over simplified my pipeline down too much. The actual pipeline is a bit more complex (http://imgur.com/a/JreEy) with the before image being the working output of mixing the v4l2src with a videotestsrc and the after showing the result of swapping in the second videotestsrc (swapping in the bottom left of both images). I also am swapping the ffmpegcolorspace since I heard there might be a bug with it renegotiating caps, but that might be a red herring. As shown in the after, I had been forgetting to set the new videotestsrc and ffmpegcolorspace playing. Making sure to set both to playing, I see that the two new elements seem to negotiate ok (http://imgur.com/thSlt). This leads to video that updates every few seconds or so. I notice I get alot of this warning: 0:00:19.731523367 17149 0x7fcc00002290 WARN videomixer2 videomixer2.c:706:gst_videomixer2_fill_queues:<videomixer22:sink_0> Buffer from the past, dropping I'm also seeing a lot of Quality of Service messages: Source: ffmpegcsp3, Type: 16777216 Do I need to do something to sync the timestamps on the new source? |
On 11/01/2011 01:19 AM, superlou wrote:
>> You might want to use "videotestsrc ! capsfilter" and set the format >> that you use on v4l2src to videotestsrc. > I had actually over simplified my pipeline down too much. The actual > pipeline is a bit more complex (http://imgur.com/a/JreEy) with the before > image being the working output of mixing the v4l2src with a videotestsrc and > the after showing the result of swapping in the second videotestsrc > (swapping in the bottom left of both images). I also am swapping the > ffmpegcolorspace since I heard there might be a bug with it renegotiating > caps, but that might be a red herring. > > As shown in the after, I had been forgetting to set the new videotestsrc and > ffmpegcolorspace playing. Making sure to set both to playing, I see that > the two new elements seem to negotiate ok (http://imgur.com/thSlt). This > leads to video that updates every few seconds or so. I notice I get alot of > this warning: > > 0:00:19.731523367 17149 0x7fcc00002290 WARN videomixer2 > videomixer2.c:706:gst_videomixer2_fill_queues:<videomixer22:sink_0> Buffer > from the past, dropping Set is-live=true on videotestsrc. > I'm also seeing a lot of Quality of Service messages: > Source: ffmpegcsp3, Type: 16777216 Where does this message come from, try to print it with correct details (Type: 16777216is not helpful). > Do I need to do something to sync the timestamps on the new source? Normally you would need to seek on the new source, but not for live-srcs. Stefan > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Changing-source-without-stopping-pipeline-tp3952239p3962134.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > 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 |
>> 0:00:19.731523367 17149 0x7fcc00002290 WARN videomixer2
>> videomixer2.c:706:gst_videomixer2_fill_queues:<videomixer22:sink_0> Buffer >> from the past, dropping > Set is-live=true on videotestsrc. I tried this and it didn't seem to make any difference. I can see in the graph that the is-live property is set to true. >> I'm also seeing a lot of Quality of Service messages: >> Source: ffmpegcsp3, Type: 16777216 > Where does this message come from, try to print it with correct details > (Type: 16777216is not helpful). Sorry, is there a standard format for getting the details? From what I could tell, the only info in a message is the source, type, timestamp, and Structure. I found that even before I try switching out the webcam source, I'm receiving QoS messages: (18446744073709551615) Source: videomixer20, Type: 16777216, Structure: GstMessageQOS (18446744073709551615) Source: videomixer21, Type: 16777216, Structure: GstMessageQOS After I execute the swap, the messages are: (18446744073709551615) Source: ffmpegcsp3, Type: 16777216, Structure: GstMessageQOS The elements are shown here: http://imgur.com/OmS14 Thanks, Louis |
On 11/03/2011 02:04 AM, superlou wrote:
>>> 0:00:19.731523367 17149 0x7fcc00002290 WARN videomixer2 >>> videomixer2.c:706:gst_videomixer2_fill_queues:<videomixer22:sink_0> >>> Buffer >>> from the past, dropping >> Set is-live=true on videotestsrc. > I tried this and it didn't seem to make any difference. I can see in the > graph that the is-live property is set to true. > Okay, was worth trying. You'll needs to dig down, look at the timestamps and segments on both branches. Drill upstream from the element that complains. >>> I'm also seeing a lot of Quality of Service messages: >>> Source: ffmpegcsp3, Type: 16777216 >> Where does this message come from, try to print it with correct details >> (Type: 16777216is not helpful). > Sorry, is there a standard format for getting the details? From what I > could tell, the only info in a message is the source, type, timestamp, and > Structure. e.g. use gst_message_type_get_name() instead of printing the number. Stefan > I found that even before I try switching out the webcam source, > I'm receiving QoS messages: > > (18446744073709551615) Source: videomixer20, Type: 16777216, Structure: > GstMessageQOS > (18446744073709551615) Source: videomixer21, Type: 16777216, Structure: > GstMessageQOS > > After I execute the swap, the messages are: > > (18446744073709551615) Source: ffmpegcsp3, Type: 16777216, Structure: > GstMessageQOS > > The elements are shown here: http://imgur.com/OmS14 > > Thanks, > Louis > > -- > View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Changing-source-without-stopping-pipeline-tp3952239p3983904.html > Sent from the GStreamer-devel mailing list archive at Nabble.com. > _______________________________________________ > 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 |
From some suggestions of the greats on IRC, it looks like the problem is that the new source causes a newsegment event which has improper timestamps (base time?). The symptom is that the new videotestsrc's output is update every n seconds, where n is the running time at which the source was added.
Is their a proper way to set the base time (or some other time) to match the rest of the pipeline to get smooth playback? Is that the wrong approach and instead there's a procedure for adding a new element that won't throw a newsegment event? Here is the logged debug info from the addition of the new videotestsrc: https://gist.github.com/1362773. The newsegment is sent at line 49. |
Free forum by Nabble | Edit this page |