[FFmpeg-user] Seeking for a method to remove sections of a video

Tom Horsley horsley1953 at gmail.com
Mon Jun 19 21:03:09 EEST 2017


On Mon, 19 Jun 2017 13:17:16 -0400
Eric Wilde wrote:

> It would be great if you figured out a better solution.

My solution works great on linux, it just takes forever
and involves more manual work than is optimal :-).
My algorithm:

1. One quick encoding to add the six decimal point
timestamps to the video as a text overlay.

2. Play that video in mencoder using pause, backup,
single step keycodes to sneak up on the exact timestamp
I want. Read the screen and copy the timestamps to a file.

3. A script that takes my timestamps and uses -ss and -t
options to slowly and painfully start from the beginning
of the file, reach the exact timestamp I want and transcode
a chunk of video of the right duration. (Trying to speed
this up by seeking to a keyframe that preceeds the
timestamp never seems to work right, I have to go through
the video linearly from the beginning).

4. Then a script that does a "concat" to merge all the
chunks into the final video.

Any shortcuts I tried never worked. Audio would get out
of sync, etc. The only part that consumes my time
is copying the timecodes into a file. Everything else
is automated and just involves waiting for the computer
to finish :-).


More information about the ffmpeg-user mailing list