[FFmpeg-user] Removing parts of a video using the select filter
george at nsup.org
Sun Jan 9 16:53:06 EET 2022
Simon van Bernem via ffmpeg-user (12022-01-08):
> I am trying to remove parts of a video (with audio) using the select
> filter. I constructed this command to remove seconds 20-25:
> (newlines only for readability)
> ffmpeg -i input.mkv
> -vf "select='1-between(t,20,25)', setpts=N/FRAME_RATE/TB"
> -af "aselect='1-between(t,20,25)', asetpts=N/SR/TB" output.mkv
> This works great, except that when I use multiple "between" clauses
> to discard multiple sections, audio and video will start to get out of
The select filter is very generic, and therefore not very robust. It
does not update the timestamps, hence the need to update them
afterwards. Furthermore, it works with whole frames, which can
accumulate for audio.
For your use case, consider the segment and concat filters.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the ffmpeg-user