Get the th frame from a video

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

Get the th frame from a video

Antoine
Hi guys !
I'm new here and new with Gstreamer. I'm looking for a way to extract a jpeg image from a h264/mp4 file.
I already have a pipeline which works but it's very slow (12 sec for 1min video) :
gst-launch-1.0 filesrc location=1.mp4 typefind=true ! video/quicktime ! aiurdemux ! queue ! vpudec ! decodebin ! videorate ! video/x-raw, framerate=1/60 !  vpuenc_jpeg ! filesink location=test.jpg
In fact this pipeline it's not really what I'm looking for, I just want to capture the 10th frame from my video and use it like a preview (static preview). I'm sure there is be a simple pipeline to do this.
Thank you for your time.
Antoine
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get the th frame from a video

Nicolas Dufresne-5
Le lundi 24 juillet 2017 à 04:30 -0700, Antoine a écrit :

> Hi guys !
> I'm new here and new with Gstreamer. I'm looking for a way to extract a jpeg
> image from a h264/mp4 file.
> I already have a pipeline which works but it's very slow (12 sec for 1min
> video) :
> gst-launch-1.0 filesrc location=1.mp4 typefind=true ! video/quicktime !
> aiurdemux ! queue ! vpudec ! decodebin ! videorate ! video/x-raw,
> framerate=1/60 !  vpuenc_jpeg ! filesink location=test.jpg
> In fact this pipeline it's not really what I'm looking for, I just want to
> capture the 10th frame from my video and use it like a preview (static
> preview). I'm sure there is be a simple pipeline to do this.
> Thank you for your time.
> Antoine
You could pause the pipeline, and use a step event to skip the first 9
frames. Note that thumbnailing this way does not work very well. The
Gnome thumbnailer as an example will seek at several places, and will
chose the thumbnail based on a small statistic to figure-out if the
frame isn't a black frame, or green frame.

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

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

Re: Get the th frame from a video

Antoine
This post was updated on .
Antoine<quote author="Nicolas Dufresne-5">
Le lundi 24 juillet 2017 à 04:30 -0700, Antoine a écrit :
> Hi guys !
> I'm new here and new with Gstreamer. I'm looking for a way to extract a jpeg
> image from a h264/mp4 file.
> I already have a pipeline which works but it's very slow (12 sec for 1min
> video) :
> gst-launch-1.0 filesrc location=1.mp4 typefind=true ! video/quicktime !
> aiurdemux ! queue ! vpudec ! decodebin ! videorate ! video/x-raw,
> framerate=1/60 !  vpuenc_jpeg ! filesink location=test.jpg
> In fact this pipeline it's not really what I'm looking for, I just want to
> capture the 10th frame from my video and use it like a preview (static
> preview). I'm sure there is be a simple pipeline to do this.
> Thank you for your time.
> Antoine

You could pause the pipeline, and use a step event to skip the first 9
frames. Note that thumbnailing this way does not work very well. The
Gnome thumbnailer as an example will seek at several places, and will
chose the thumbnail based on a small statistic to figure-out if the
frame isn't a black frame, or green frame.

regards,
Nicolas
_______________________________________________


Thx for your quick answer.
In fact I am just looking for a frame to use it as a preview for a web GUI.  I wanted to use the 10th but I really don't care, I just dont want a black screen and a fast  way to have a preview.  
How do you suggest to obtain the thumbnail ?
Regards,
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get the th frame from a video

Nicolas Dufresne-5
Le lundi 24 juillet 2017 à 07:31 -0700, Antoine a écrit :
> Thx for your quick answer.
> In fact I am just looking for a frame to use it as a preview for a
> web GUI.
> I wanted to use the 10th but I really don't care, I just dont want a
> black
> screen and a fast  way to have a preview.  
> How do you suggest to obtain the thumbnail ?
> Regards,
> Antoine

On Gnome installation, you could use the already made one:

  /usr/bin/totem-video-thumbnailer

It's also a good practice to run thumbnailers in sep process, as you
often deal with random streams.

>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble
> .com/Get-the-th-frame-from-a-video-tp4683917p4683923.html
> Sent from the GStreamer-devel mailing list archive at Nabble.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

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

Re: Get the th frame from a video

Antoine
Nicolas Dufresne-5 wrote
Le lundi 24 juillet 2017 à 07:31 -0700, Antoine a écrit :
> Thx for your quick answer.
> In fact I am just looking for a frame to use it as a preview for a
> web GUI.
> I wanted to use the 10th but I really don't care, I just dont want a
> black
> screen and a fast  way to have a preview.  
> How do you suggest to obtain the thumbnail ?
> Regards,
> Antoine

On Gnome installation, you could use the already made one:

  /usr/bin/totem-video-thumbnailer

It's also a good practice to run thumbnailers in sep process, as you
often deal with random streams.

>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble
> .com/Get-the-th-frame-from-a-video-tp4683917p4683923.html
> Sent from the GStreamer-devel mailing list archive at Nabble.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


signature.asc (201 bytes) <http://gstreamer-devel.966125.n4.nabble.com/attachment/4683924/0/signature.asc>
I'm in an embeded device and I can't use Gnome Tool, that's why I choose to capture my thumbnail with Gstreamer.
Antoine

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get the th frame from a video

Baby Octopus
10th frame may be a bad idea since more often than now, you'll end up with a black frame
1. Build the pipeline and set it to paused
2. Seek to the Nth second
3. Put a sink pad probe on the sink element
4. Pass only first buffer through the probe. Moment the 2nd buffer comes, terminate the pipeline
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get the th frame from a video

Nicolas Dufresne-5
In reply to this post by Antoine
Le lundi 24 juillet 2017 à 08:53 -0700, Antoine a écrit :
> I'm in an embeded device and I can't use Gnome Tool, that's why I
> choose to
> capture my thumbnail with Gstreamer.

The Totem thumnailer is entirely implement in GStreamer.

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

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

Re: Get the th frame from a video

Antoine
Nicolas Dufresne-5 wrote
Le lundi 24 juillet 2017 à 08:53 -0700, Antoine a écrit :
> I'm in an embeded device and I can't use Gnome Tool, that's why I
> choose to
> capture my thumbnail with Gstreamer.

The Totem thumnailer is entirely implement in GStreamer.

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


signature.asc (201 bytes) <http://gstreamer-devel.966125.n4.nabble.com/attachment/4683930/0/signature.asc>

Thank you for your time, but as I said I'm new with Gstreamer and I don't know how to use the totem-video-thumbnailer.
I find the source code here https://git.gnome.org//browse/totem/tree/src/totem-video-thumbnailer.c, I have to compile it for my target and use it as a software ?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get the th frame from a video

Antoine
Antoine wrote
Nicolas Dufresne-5 wrote
Le lundi 24 juillet 2017 à 08:53 -0700, Antoine a écrit :
> I'm in an embeded device and I can't use Gnome Tool, that's why I
> choose to
> capture my thumbnail with Gstreamer.

The Totem thumnailer is entirely implement in GStreamer.

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


signature.asc (201 bytes) <http://gstreamer-devel.966125.n4.nabble.com/attachment/4683930/0/signature.asc>

Thank you for your time, but as I said I'm new with Gstreamer and I don't know how to use the totem-video-thumbnailer.
I find the source code here https://git.gnome.org//browse/totem/tree/src/totem-video-thumbnailer.c, I have to compile it for my target and use it as a software ?


Ok Thank you for your help, I resolve my thumbnail problem.
Loading...