Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
192 views
in Technique[技术] by (71.8m points)

How to split bulk video fast by using ffmpeg?

I have a lot of videos, so I want to split them automatically. And they will be divided into 2 parts:

  • Part 1: 15 minutes
  • Part 2: the rest

Searched a lot, but did not find. Please, help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use the -ss and -t options:

ffmpeg -i input -t 00:15:00 -codec copy output
ffmpeg -ss 00:15:00 -i input -codec copy output

From the FFmpeg documentation:

   -ss position (input/output)
       When used as an input option (before "-i"), seeks in this input
       file to position. Note the in most formats it is not possible to
       seek exactly, so ffmpeg will seek to the closest seek point before
       position.  When transcoding and -accurate_seek is enabled (the
       default), this extra segment between the seek point and position
       will be decoded and discarded. When doing stream copy or when
       -noaccurate_seek is used, it will be preserved.

       When used as an output option (before an output filename), decodes
       but discards input until the timestamps reach position.

       position may be either in seconds or in "hh:mm:ss[.xxx]" form.

   -t duration (output)
       Stop writing the output after its duration reaches duration.
       duration may be a number in seconds, or in "hh:mm:ss[.xxx]" form.

       -to and -t are mutually exclusive and -t has priority.

The example uses -codec copy to use stream copy mode instead of re-encoding.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...