muliple gst_element_seek for creating new file

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

muliple gst_element_seek for creating new file

marc dingemans

Hi

I want to extract some video parts from a mkv file and create based on these parts one new mkv file.

This is done with muliple gst_element_seek calls with a time frame.
When a eos is received, then a the next gst_element_seek is started until done.
The destination file is generated, but can not be played with VLC.
The seek is done executed on element "matroskademux" (also used pipeline) with GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE properties

Used pipeline :
filesrc| matroskademux| h264parse | matroskamux | filesink


When I use next pipeline, then everything works fine.
filesrc| matroskademux| h264parse | avdec_h264| autovideosink


Why does the seek seems work to gui and not to file.
Must I use other approaches to put parts from a file in a new one

Thanks for your help


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

Re: muliple gst_element_seek for creating new file

Sebastian Dröge-3
On Mo, 2016-04-25 at 08:28 +0200, marc dingemans wrote:

> Hi
> I want to extract some video parts from a mkv file and create based
> on these parts one new mkv file.
> This is done with muliple gst_element_seek calls with a time frame. 
> When a eos is received, then a the next gst_element_seek is started
> until done.
> The destination file is generated, but can not be played with VLC.
> The seek is done executed on element "matroskademux" (also used
> pipeline) with GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SNAP_BEFORE
> properties
> Used pipeline :
> filesrc| matroskademux| h264parse | matroskamux | filesink
>
> When I use next pipeline, then everything works fine.
> filesrc| matroskademux| h264parse | avdec_h264| autovideosink
>
> Why does the seek seems work to gui and not to file.
> Must I use other approaches to put parts from a file in a new one
You need to ensure that matroskamux sees each segment as contiguous to
the previous one, and also that each segment properly starts with a
keyframe. The latter being a bit tricky without reencoding.
Also flushing seeks are not ideal for this kind of goal.

As a first step, try getting this to work with decoding and reencoding.
Then you can optimize the encoding away and solve the remaining
problems.

What is important for that is that you make sure that the muxer is
never flushed and the running time of the incoming data is continuous
instead of starting from 0 again. With non-flushing seeks you can
achieve this, and you can know when such a seek segment is done based
on the SEGMENT_DONE message on the bus (instead of EOS).


Alternatively you can use GES (gstreamer-editing-services) or the nle
plugin contained in GES for implementing this use case. It's allowing
to do exactly what you want.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


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

signature.asc (968 bytes) Download Attachment