Trimming mp4 video

Pascal Jacquemart pascal at fluffyspider.com.au
Wed Feb 19 06:30:48 UTC 2020


Great,

It seems to be exactly what I need.
But what if I have several audio tracks in the original file I want to trim?

Thanks,       Pascal

> On 19 Feb 2020, at 13:13, Thibault Saunier <tsaunier at gnome.org> wrote:
> 
> 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
> _______________________________________________
> 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/20200219/1f4c5b24/attachment.htm>


More information about the gstreamer-devel mailing list