Copying extract from video file

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

Copying extract from video file

Andy Robinson
Hello, I want to copy a short extract from within a large video file to
a new smaller video file (I'm not worrying about the audio for now).

GST 1.2.4

I have a pipeline something like this:
filesource ! decodebin ! videoconvert ! x264enc ! mp4mux ! filesink
and it works fine as long as I am copying the whole file.

For copying an extract I thought I would seek to the start of the part I
want, with:
   gst_element_seek_simple(pipeline...)
then while playing keep a close eye on where we are up to with
   gst_element_query_position(pipeline...)
and stop playing when we have reached the right point, with
   gst_element_set_state(pipeline, GST_STATE_READY);

But this doesn't work, either for starting or stopping.

If I do the seek to the start point, then play to the end; or if I play
from the start but use GST_STATE_READY to stop; then in both cases I get
a file of plausible size, but Parole Media Player says the file has no
playable streams.

I'm wondering if I'm going about this in completely the wrong way. I
tried putting a valve after decodebin but if I start with drop=TRUE then
I cannot pause the pipeline. I've looked through the list of available
plugins but I can't find anything that looks likely.

There's probably an easy way of doing this, it seems a very simple task.
Help please!

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Copying extract from video file

Nicolas Dufresne-3
Le vendredi 12 février 2016 à 16:42 +0000, Andy Robinson a écrit :
> Hello, I want to copy a short extract from within a large video file
> to 
> a new smaller video file (I'm not worrying about the audio for now).
>
> GST 1.2.4

If you can afford a newer GStreamer, a simplier solution would be to
use ges-launch-1.0 from gst-editing-services repository, or use PiTiVi
(there is daily bundles you can download to avoid having to install,
it's still in serious development).

Nicolas

PiTiVi Bundle at http://fundraiser.pitivi.org/download-bundles
_______________________________________________
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
|

Re: Copying extract from video file

Andy Robinson
On 13/02/16 02:38, Nicolas Dufresne wrote:

> Le vendredi 12 février 2016 à 16:42 +0000, Andy Robinson a écrit :
>> Hello, I want to copy a short extract from within a large video file
>> to
>> a new smaller video file (I'm not worrying about the audio for now).
>>
>> GST 1.2.4
>
> If you can afford a newer GStreamer, a simplier solution would be to
> use ges-launch-1.0 from gst-editing-services repository, or use PiTiVi
> (there is daily bundles you can download to avoid having to install,
> it's still in serious development).
>
> Nicolas
>
> PiTiVi Bundle at http://fundraiser.pitivi.org/download-bundles

Thanks for this - the thing is, it's not for me, it's for my users
(users of my application). So I'd like to avoid distributing, or telling
them to install, a whole other library just for this.

I'll take a look at it, but if anyone knows how to do it purely within
GStreamer then I'd be very grateful.

Incidentally the reason I'd like to be able to run on 1.2.4 is because
there is still quite a lot of 1.2.4 around, e.g. in the current LTS
version of Ubuntu (14.04).

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

AW: Copying extract from video file

Thornton, Keith
In reply to this post by Andy Robinson
I would have thought you can achieve this bei sending a seek event down the pipeline with the start time and the stop time in it. Afterwards follow this with an EOS event.
If you don't send EOS down your pipeline, the MOV data will not be written to the end of the file and it will not be playable. Inject an EOS into the pipeline before the mp4mux and when it arrives at the filesink you can change the state of your pipeline.

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von Andy Robinson
Gesendet: Freitag, 12. Februar 2016 17:43
An: gstreamer-devel
Betreff: Copying extract from video file

Hello, I want to copy a short extract from within a large video file to a new smaller video file (I'm not worrying about the audio for now).

GST 1.2.4

I have a pipeline something like this:
filesource ! decodebin ! videoconvert ! x264enc ! mp4mux ! filesink and it works fine as long as I am copying the whole file.

For copying an extract I thought I would seek to the start of the part I want, with:
   gst_element_seek_simple(pipeline...)
then while playing keep a close eye on where we are up to with
   gst_element_query_position(pipeline...)
and stop playing when we have reached the right point, with
   gst_element_set_state(pipeline, GST_STATE_READY);

But this doesn't work, either for starting or stopping.

If I do the seek to the start point, then play to the end; or if I play from the start but use GST_STATE_READY to stop; then in both cases I get a file of plausible size, but Parole Media Player says the file has no playable streams.

I'm wondering if I'm going about this in completely the wrong way. I tried putting a valve after decodebin but if I start with drop=TRUE then I cannot pause the pipeline. I've looked through the list of available plugins but I can't find anything that looks likely.

There's probably an easy way of doing this, it seems a very simple task.
Help please!

Regards,
Andy Robinson, Seventh String Software, www.seventhstring.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