"Cutting" Video via GStreamer

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

"Cutting" Video via GStreamer

Frede
Hi,
i want to cut an mp4 file i've captured with gstreamer1.0 (e.g. old file start=0s end=10s -> new file=2s end=8s). To achieve this i thought a simple pipeline like

filsrc location=xxx.mp4 | filesink location=xxx2.mp4

would work. So to set the new "starting point" for the cut file im doing a simple_seek before i set the pipeline to playing:

gst_element_seek_simple (pipe, GST_FORMAT_TIME, GST_SEEK_FLAG_ACCURATE | GST_SEEK_FLAG_FLUSH, start); 

And to set the new end I query the position of the video. When its => end, i send an eos and stop the pipeline. So far so good.

Heres the problem:
The seek AND the position query dont seem to work. I always get the full video as a copy...
Can i get this to work as i want it to? Maybe seek and query operations dont work on this kind of simple pipes.
Thanks
Frede
Reply | Threaded
Open this post in threaded view
|

Re: "Cutting" Video via GStreamer

Thibault Saunier-4
Hello Frede,

You should probably use GES (GStreamer Editing Services) for that. In
a simple ges-launch style what you are trying to do would look like:

ges-launch-1.0 file:///path/to/your/file inpoint duration

And it should be pretty easy to do that programatically.

Regards,

Thibault Saunier

On Fri, Dec 5, 2014 at 12:43 PM, Frede <[hidden email]> wrote:

> Hi,
> i want to cut an mp4 file i've captured with gstreamer1.0 (e.g. old file
> start=0s end=10s -> new file=2s end=8s). To achieve this i thought a simple
> pipeline like
>
> /filsrc location=xxx.mp4 | filesink location=xxx2.mp4 /
>
> would work. So to set the new "starting point" for the cut file im doing a
> simple_seek before i set the pipeline to playing:
>
> /gst_element_seek_simple (pipe, GST_FORMAT_TIME, GST_SEEK_FLAG_ACCURATE |
> GST_SEEK_FLAG_FLUSH, start);/
>
> And to set the new end I query the position of the video. When its => end, i
> send an eos and stop the pipeline. So far so good.
>
> Heres the problem:
> The seek AND the position query dont seem to work. I always get the full
> video as a copy...
> Can i get this to work as i want it to? Maybe seek and query operations dont
> work on this kind of simple pipes.
> Thanks
> Frede
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Cutting-Video-via-GStreamer-tp4669815.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel