Fast decode h264 stream, keyframes only.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fast decode h264 stream, keyframes only.

Krutskikh Ivan
Hi,

Can gstreamer fast decode h264/5 steam and return only keyframes? That would be usefull for opencv processing  of live streams.

Thanks in advance!

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

Re: Fast decode h264 stream, keyframes only.

Nicolas Dufresne-5
Le samedi 11 mars 2017 à 16:39 +0300, Krutskikh Ivan a écrit :
> Hi,
>
> Can gstreamer fast decode h264/5 steam and return only keyframes?
> That would be usefull for opencv processing  of live streams.

I believe this should work in recent version with the
GST_SEEK_FLAG_KEY_UNIT. Pause you streamr, and then operate a flushing
seek with this flag set.

>
> Thanks in advance!
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fast decode h264 stream, keyframes only.

Tim Müller
On Sat, 2017-03-11 at 11:20 -0500, Nicolas Dufresne wrote:

> > Can gstreamer fast decode h264/5 steam and return only keyframes?
> > That would be usefull for opencv processing  of live streams.
>
> I believe this should work in recent version with the
> GST_SEEK_FLAG_KEY_UNIT. Pause you streamr, and then operate a
> flushing seek with this flag set.

You probably meant GST_SEEK_FLAG_TRICKMODE_KEY_UNITS ? :)

Question is, what does one do when seeking is not supported? In that
case one would have to add a pad probe on the decoder sink pad or
parser src pad or so and drop all frames that are flagged as delta
units via the buffer flags or such.

Theoretically a seek without start/stop position change to just change
the flags should work too, but I wouldn't bet on it :)

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fast decode h264 stream, keyframes only.

Nicolas Dufresne-5


Le 11 mars 2017 2:59 PM, "Tim Müller" <[hidden email]> a écrit :
On Sat, 2017-03-11 at 11:20 -0500, Nicolas Dufresne wrote:

> > Can gstreamer fast decode h264/5 steam and return only keyframes?
> > That would be usefull for opencv processing  of live streams.
>
> I believe this should work in recent version with the
> GST_SEEK_FLAG_KEY_UNIT. Pause you streamr, and then operate a
> flushing seek with this flag set.

You probably meant GST_SEEK_FLAG_TRICKMODE_KEY_UNITS ? :)

Yes thanks.


Question is, what does one do when seeking is not supported? In that
case one would have to add a pad probe on the decoder sink pad or
parser src pad or so and drop all frames that are flagged as delta
units via the buffer flags or such.

I'm wondering if a generic property on the base class could also work? Is there any format known to not work without the deltas?


Theoretically a seek without start/stop position change to just change
the flags should work too, but I wouldn't bet on it :)

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


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

Re: Fast decode h264 stream, keyframes only.

Olivier Crête-3
In reply to this post by Tim Müller
On Sat, 2017-03-11 at 19:44 +0000, Tim Müller wrote:

> On Sat, 2017-03-11 at 11:20 -0500, Nicolas Dufresne wrote:
>
> > > Can gstreamer fast decode h264/5 steam and return only keyframes?
> > > That would be usefull for opencv processing  of live streams.
> >
> > I believe this should work in recent version with the
> > GST_SEEK_FLAG_KEY_UNIT. Pause you streamr, and then operate a
> > flushing seek with this flag set.
>
> You probably meant GST_SEEK_FLAG_TRICKMODE_KEY_UNITS ? :)
>
> Question is, what does one do when seeking is not supported? In that
> case one would have to add a pad probe on the decoder sink pad or
> parser src pad or so and drop all frames that are flagged as delta
> units via the buffer flags or such.

You could also add the identity element before the decoder and set the
"drop-buffer-flags" property to GST_BUFFER_FLAG_DELTA_UNIT

--
Olivier Crête
[hidden email]
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fast decode h264 stream, keyframes only.

Krutskikh Ivan
Thanks a lot!

Can someone provide a quick example of subj in python or c? Just for performance tests.

2017-03-13 21:37 GMT+03:00 Olivier Crête <[hidden email]>:
On Sat, 2017-03-11 at 19:44 +0000, Tim Müller wrote:
> On Sat, 2017-03-11 at 11:20 -0500, Nicolas Dufresne wrote:
>
> > > Can gstreamer fast decode h264/5 steam and return only keyframes?
> > > That would be usefull for opencv processing  of live streams.
> >
> > I believe this should work in recent version with the
> > GST_SEEK_FLAG_KEY_UNIT. Pause you streamr, and then operate a
> > flushing seek with this flag set.
>
> You probably meant GST_SEEK_FLAG_TRICKMODE_KEY_UNITS ? :)
>
> Question is, what does one do when seeking is not supported? In that
> case one would have to add a pad probe on the decoder sink pad or
> parser src pad or so and drop all frames that are flagged as delta
> units via the buffer flags or such.

You could also add the identity element before the decoder and set the
"drop-buffer-flags" property to GST_BUFFER_FLAG_DELTA_UNIT

--
Olivier Crête
[hidden email]
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Loading...