Stopping command-line gst-launch, after processing certain no. of frames

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

Stopping command-line gst-launch, after processing certain no. of frames

Icarus Alive
Is it possible using gst-launch, to stop a stream processing (&
gracefully exit gst-launch), after a certain no. of frames have been
processed ?

thanks,
Icarus
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Wes Miller
Administrator

Many of the src elements have num-buffs properties that you may use to
limit the number of sourced frames.  Some, however, do not.

I suppose someone of us <grin> needs to write an element that accepts a
time to run or a number of buffers before issuing an EOS to the pipeline.

Sink pad - any caps
Src pad - any caps
Properties:
   name         as usual
   timeout      UINT64 n-secs - readable, writable, default = UINT64_MAX
   num-buffs    UINT64 - readable writable, default = UINT64_MAX

Sends EOS to the pipeline when time >= timeout OR number_of_buffers >=
num_buffs

Of course this would be pretty useless in a C (or whatever) program since
they have more sophisticated mechanisms to halt the pipeline, e.g.
External timers sending the EOS.


Wes



On 10/19/11 3:50 PM, "Icarus Alive" <[hidden email]> wrote:

>Is it possible using gst-launch, to stop a stream processing (&
>gracefully exit gst-launch), after a certain no. of frames have been
>processed ?
>
>thanks,
>Icarus
>_______________________________________________
>gstreamer-devel mailing list
>[hidden email]
>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


CONFIDENTIALITY NOTE:

This e-mail and any attachments are confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you for your cooperation.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Icarus Alive
On Thu, Oct 20, 2011 at 2:20 AM, Wesley J. Miller <[hidden email]> wrote:
>
> Many of the src elements have num-buffs properties that you may use to
> limit the number of sourced frames.  Some, however, do not.

Excellent. Thanks for the tips/hints.

> I suppose someone of us <grin> needs to write an element that accepts a
> time to run or a number of buffers before issuing an EOS to the pipeline.
>
> Sink pad - any caps
> Src pad - any caps
> Properties:
>   name         as usual
>   timeout      UINT64 n-secs - readable, writable, default = UINT64_MAX
>   num-buffs    UINT64 - readable writable, default = UINT64_MAX
>
> Sends EOS to the pipeline when time >= timeout OR number_of_buffers >=
> num_buffs

Sounds like a nice idea and approach. Still scratching the surface of
Gstreamer, but eventually might give it a shot.

> Of course this would be pretty useless in a C (or whatever) program since
> they have more sophisticated mechanisms to halt the pipeline, e.g.
> External timers sending the EOS.
>
>
> Wes
>
>
>
> On 10/19/11 3:50 PM, "Icarus Alive" <[hidden email]> wrote:
>
>>Is it possible using gst-launch, to stop a stream processing (&
>>gracefully exit gst-launch), after a certain no. of frames have been
>>processed ?
>>
>>thanks,
>>Icarus
>>_______________________________________________
>>gstreamer-devel mailing list
>>[hidden email]
>>http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> CONFIDENTIALITY NOTE:
>
> This e-mail and any attachments are confidential. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please notify us immediately by returning it to the sender and delete this copy from your system. Thank you for your cooperation.
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Arjen Veenhuizen
I am well-aware of bumping an old thread, but does an element with the features described above exist in GStreamer 1.x?

It would be very convenient, e.g. when one wants to limit the number of decoded frames and requires an EOS as soon as that number has been reached. My primary suspect-element would be identity, but it does not seem to have this capability.
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Yasushi SHOJI-2
Hi,

On Fri, Jan 27, 2017 at 12:30 AM, Arjen Veenhuizen <[hidden email]> wrote:
>
> I am well-aware of bumping an old thread, but does an element with the
> features described above exist in GStreamer 1.x?

You mean, source elements with the num-buffer property?
There are many:

gst-inspect-1.0 -a | awk -F ":" '/src:.+num-buffers/ {print $1}
-- 
              yashi


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Arjen Veenhuizen
AFAIK that does not work for my case, e.g.

gst-launch-1.0 filesrc location=big_buck_bunny.ts num-buffers=x ! tsdemux ! h264parse ! avdec_h264 ! videoconvert ! autovideosink

Would read up to X bytes before going into EOS. Because the blocksize at the filesrc is just an arbitrary number of bytes (default value: 4096) you can in no way relate that to a specific number of video frames after the decoder (although you could use num-buffers and blocksize for raw video, but that is out of scope).
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Yasushi SHOJI-2
Hi,

On Fri, Jan 27, 2017 at 4:08 PM, Arjen Veenhuizen <[hidden email]> wrote:
>
> AFAIK that does not work for my case, e.g.

> Would read up to X bytes before going into EOS. Because the blocksize at the
> filesrc is just an arbitrary number of bytes (default value: 4096) you can
> in no way relate that to a specific number of video frames after the decoder
> (although you could use num-buffers and blocksize for raw video, but that is
> out of scope).

I got what you mean. 
You can write a few lines of C code to do it but I don't think there is an
element doing that at the moment.

Would it be upstream-acceptable to extend identity to do it?
-- 
            yashi

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping command-line gst-launch, after processing certain no. of frames

Arjen Veenhuizen
That would be great and fit right in with other properties of the identity element (we already have "error-after", so adding "eos-after" would make sense, right?).