Trimming mp4 video

Thibault Saunier tsaunier at gnome.org
Wed Feb 19 02:13:30 UTC 2020


Hello,

You can use GES[0] for that, or with master `nleurisource` has been fixed
to work standalone and you can do:

  gst-launch-1.0 nleurisource uri=file://path/to/file
inpoint=$(TRIMMING_POINT) caps=video/x-h264 duration=$(DURATION_YOU_WANT) !
h264parse ! mp4mux ! filesink

Regards,

Thibault

[0] https://gstreamer.freedesktop.org/documentation/gst-editing-services/

On Mon, Feb 17, 2020 at 11:50 PM Pascal Jacquemart <pascal at fluffyspider.com>
wrote:

>
> Hi everyone,
>
> I am trying to trim a mp4 video file, but having some issues with
> something that simple.
>
> I am running the following pipeline:
>   filesrc ! qtdemux ! h264parse ! mp4mux ! filesink
>
> At this stage, it creates an exact clone of the original video
>
> Then I figured out I should do the following:
>  - Start the pipeline in PAUSED state
>  - Issue a SEEK with FLUSH and KEY_UNIT flags
>  - Put the pipeline to PLAYING state
>  - Wait for the EOS message
>
> This does not work. The created file seems to be the right size but it
> does not play.
>
> After few experiments, I can create the trimmed video but only when I
> start the whole pipeline in PLAYING state. Then the file is valid but I
> can see the very first few frames of the original video before the
> trimmed part.
>
> My sample code is in here: https://trinket.io/python/185bdb1678
> I might be missing something obvious?
>
> Thanks,           Pascal
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200218/571aad98/attachment.htm>


More information about the gstreamer-devel mailing list