How to drop first X frames or first X seconds of video

a b genericgroupmail at gmail.com
Wed Jun 5 09:20:16 PDT 2013


Hey Stirling,

Yeah, thought so, to be honest, I'm glad in a way as it has forced me
to look into the python bindings earlier than planned and already I
wish i had done it sooner as it has opened up much more of the
richness of gstreamer. Think I'm almost there with a first solution.

Thanks all!

On Wed, Jun 5, 2013 at 4:38 PM, Stirling Westrup <swestrup at gmail.com> wrote:
> Yeah, as far as I know, there really isn't a clean way to discard the first
> n seconds of a source via cli. The best I can think of is to use
> multifilesink, but that could be really awkward to get working.
>
> I'm afraid you'll need to use python.
>
>
>
> On Wed, Jun 5, 2013 at 10:00 AM, a b <genericgroupmail at gmail.com> wrote:
>>
>> Thank you very much Angel,
>>
>> Really appreciate your input on this!
>>
>> On Wed, Jun 5, 2013 at 2:40 PM, Angel Martin <amartin at vicomtech.org>
>> wrote:
>> > If you prefer the probe method this links could help you:
>> >
>> > http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-dataaccess.html
>> >
>> > http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic-pipelines.html
>> >
>> > If you prefer a output-selector this one (ossbuild example):
>> >
>> > http://code.google.com/p/ossbuild/source/browse/trunk/Main/GStreamer/Source/gst-plugins-bad/tests/icles/output-selector-test.c?r=926
>> >
>> >
>> >
>> > 2013/6/5 a b <genericgroupmail at gmail.com>
>> >>
>> >> Hi Angel,
>> >>
>> >> Thanks for the quick reply!
>> >> So sounds like these methods are for programming a solution.
>> >> I had planned to look into the python pygst module in order to get
>> >> away from relying on executing system calls to gst-launch. Maybe now
>> >> is the time to do that.
>> >>
>> >> Cheers!
>> >>
>> >>
>> >> On Wed, Jun 5, 2013 at 12:52 PM, Angel Martin <amartin at vicomtech.org>
>> >> wrote:
>> >> > Hi,
>> >> >
>> >> > Check valve gst element or the probes to check the buffers timestamp
>> >> > to
>> >> > drop
>> >> > or pass the buffer.
>> >> >
>> >> > Best,
>> >> >
>> >> > Angel
>> >> >
>> >> > 2013/6/5 a b <genericgroupmail at gmail.com>
>> >> >>
>> >> >> Hi all,
>> >> >>
>> >> >> I have an issue with capturing a single snapshot from one particular
>> >> >> device.
>> >> >> Very often when starting to stream from one of our capture cards
>> >> >> using
>> >> >> the decklinksrc element the first few seconds of video are badly
>> >> >> tuned/rendered before things finally correct themselves and the
>> >> >> video
>> >> >> appears normal.
>> >> >> The way in which i am taking a screen shot means that the first
>> >> >> video
>> >> >> frame is output to an image file, which for this device means a very
>> >> >> poor snapshot.
>> >> >> There is no issue with the v4l2src capture cards as the first frame
>> >> >> is
>> >> >> always perfectly tuned/rendered.
>> >> >>
>> >> >> Here is how i am doing it:
>> >> >>
>> >> >> gst-launch decklinksrc mode=2 connection=4 ! ffmpegcolorspace !
>> >> >> video/x-raw-rgb ! pngenc snapshot=true ! filesink
>> >> >> location="frame.png"
>> >> >>
>> >> >> Is there anyway or any element i can use to drop the first few
>> >> >> seconds
>> >> >> of video or the first e.g. 90 frames before taking the snapshot?
>> >> >> I had read about the valve element and played with it but didn't see
>> >> >> how it was going to work (for a start it causes execution to block).
>> >> >> Ideally I'd like the command to run and finish with no further
>> >> >> interaction as it does at the moment.
>> >> >> If there is no real way to do it via a command line, then it would
>> >> >> be
>> >> >> useful if anyone could point to a way to do it programatically via
>> >> >> python.
>> >> >>
>> >> >> Thanks in advance.
>> >> >> _______________________________________________
>> >> >> gstreamer-devel mailing list
>> >> >> gstreamer-devel at lists.freedesktop.org
>> >> >> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> >> >
>> >> >
>> >> >
>> >> > _______________________________________________
>> >> > gstreamer-devel mailing list
>> >> > gstreamer-devel at lists.freedesktop.org
>> >> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> >> >
>> >> _______________________________________________
>> >> gstreamer-devel mailing list
>> >> gstreamer-devel at lists.freedesktop.org
>> >> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> >
>> >
>> >
>> > _______________________________________________
>> > gstreamer-devel mailing list
>> > gstreamer-devel at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>> >
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
>
> --
> Stirling Westrup
> Programmer, Entrepreneur.
> https://www.linkedin.com/e/fpf/77228
> http://www.linkedin.com/in/swestrup
> http://technaut.livejournal.com
> http://sourceforge.net/users/stirlingwestrup
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>


More information about the gstreamer-devel mailing list