Matt McManis
Matt McManis

Reputation: 4695

Using Cut with Fast Seek -ss -to and HH:MM:SS:MS

I'm trying to cut a video using -ss and -to using HH:MM:SS:MS time.

I'm using -to instead of -t because I want the cut to be "between" a time range and not "up to" time.
I also have to use -to because it's needed for another program's time input textbox I'm using. I won't be able to use -t for this case.

Example:

https://superuser.com/a/670590

-ss 00:01:00:00 -to 00:02:00:00 cut starts at minute 1, ends at minute 2.
-ss 00:01:00:00 -t 00:02:00:00 cut starts at minute 1, ends at minute 3.

https://trac.ffmpeg.org/wiki/Seeking#Cuttingsmallsections


Problem

I'm not able to use Fast Seek, -ss before the -i, -to after.

I'm only able to use Slow Seek, -ss and -to after the -i.


1. Fast

Doesn't Work

This cuts a minute ahead of what's in the time.

Cuts from 00:01:00 to 00:03:00, using the faster seek.

ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy cut.mp4

2. Slow

Works

I'm trying to do this but with fast seek.

Cuts from 00:01:00 to 00:02:00, using the slower seek.

ffmpeg -i video.mp4 -ss 00:01:00 -to 00:02:00 -c copy cut.mp4

3. Fast

Works (with problems)

-copyts ruins video time bar in player.

Cuts from 00:01:00 to 00:02:00, using the faster seek.

ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy -copyts cut.mp4

Upvotes: 0

Views: 1538

Answers (1)

Gyan
Gyan

Reputation: 93339

Remux the result of method 3

ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c copy -copyts cut.mp4

&&

ffmpeg -i cut.mp4 -c copy recut.mp4

or with a recent version of ffmpeg,

ffmpeg -ss 00:01:00 -to 00:02:00 -i video.mp4 -c copy cut.mp4

Upvotes: 1

Related Questions