[gst-devel] Using gnonlin to extract time segments from a video file

Edward Hervey bilboed at gmail.com
Tue Feb 10 09:42:36 CET 2009


Hi,

  For your use case apply the following properties if you want to cut D
seconds starting from A:
  # outside time-realm (what it will output)
  gnlsource.props.start = 0 # the output starts from 0 ...
  gnlsource.props.duration = D # ... and lasts D nanoseconds
  # inner time-realm (what you are extracting)
  gnlsource.props.media_start = A
  gnlsource.props.media_duration = D

  One thing to take into account is that gnlfilesource will decode the
contents to raw audio/video (because it uses decodebin(2)). That means
you'll need encoders and muxer after your compositions.

  As a side note, but I'm not sure whether you'll encounter this with
such a simple use-case, gnlfilesource has a few issues due to the queues
it uses internally. If you see the resulting file stopping before the
end, you will have to use a queue-less bin within a regular gnlsource.
  Since you're using python you can re-use such an element I created in
PiTiVi : SingleDecodeBin (git.pitivi.org ,
pitivi/elements/singledecodebin.py) and put that in a regular
'gnlsource' along with the above properties.

  I hope this helps.

    Edward

On Tue, 2009-02-10 at 01:32 -0200, Rodrigo Manhães wrote:
> Hi,
> 
> I need to build a small command-line tool for extracting a time
> segment from a video file, creating another video file as result
> containing the desired segment. I've tried to do this creating a
> pipeline whose source is a gnlfilesource and the sink is a filesink
> and limiting the playback to the desired timebox.
> 
> I got good results on this same goal for audio files. For video files,
> however, the gnlfilesource's properties for start and duration are
> ignored. Has gnonlin some limitation in this sense or the problem is
> in my code?
> 
> I've tried to do the same thing with gstreamer without gnonlin and
> didn't get success.
> 
> The language I'm using is Python.
> 
> I thank any help or link for information.
> 
> []'s
> Rodrigo
> 
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list