Copying extract from video file

Andy Robinson andy at seventhstring.com
Fri Feb 12 16:42:50 UTC 2016


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


More information about the gstreamer-devel mailing list