1

I have lots of small video lectures but the first and last few seconds are the opening and ending credits which I don't wish to keep. Moreover, it breaks continuity.

So what I want is to remove first 15 seconds and last 10 seconds of all video files and then merge them.

Can anyone suggest a way or software to do that ?

Nikhil Vidhani
  • 709
  • 5
  • 11
  • 1
    you can read through the docs of this great tool FFmpeg [https://www.ffmpeg.org/documentation.html](https://www.ffmpeg.org/documentation.html) it's has a CLI that allows you to do bulk work onto files you can write up a small program via (.NET, Node.js (gulp), Golang) or just use the tool itself to work on bulk files or powershell if you're familiar with scripting. `FFmpeg -i source_video.mpg -ss 00:00:10 -t 00:00:30 final_video.mpg` example of a command to trim – Andrei Oct 04 '17 at 16:24
  • This is a bit broad. An addition to Andrei's good recommendation. Depending on the container (e.g. MP4), there are at least two types of doing this: cut frame-exact which needs re-encoding or not (maybe only key-frame based then) without re-encoding. The details are probably found in ffmpeg's docs. – sascha Oct 04 '17 at 21:56

1 Answers1

0

https://ffmpeg.org/ffmpeg.html#Main-options

  • -ss position (input/output)

    can remove first 15 seconds: -ss "0:00:15" or -ss 15

  • -to position (input/output)

    from pos to pos

  • -t duration (input/output)

    from pos with dur

  • -sseof position (input)

    -sseof -10: get last 10 seconds, https://stackoverflow.com/a/36120894/10298463

but doesn't has -toeof position.

I think it can calc by ffprobe "infile" 2>&1 | grep -Eo "([0-9]{2}:){2}[0-9]{2}", then use option -t

t _ liang
  • 51
  • 6