sword1st
sword1st

Reputation: 555

ffmpeg mp4 cut from correct point | without encode

I'm using this this command for cut my mp4 video :

ffmpeg -i clip.mp4 -ss 00:00:25 -to 00:01:20 -c copy cutted.mp4

But there is a problem with this code. My "cutted" clip has black video for a couple seconds and it's have sync problem on editing software. When i tweak the first parameter -ss like 00:00:24 ... 00:00:23 .... 00:00:26 etc when i found the right position it doesn't have any black frame or sync problem. I want to learn how can i learn all of this correct times for my video ? I don't know what should i call these points. Gop or anything else. Is there any solution built-in ffmpeg to learn this times so i can cut them without any corruption ? Thanks!

Upvotes: 0

Views: 1469

Answers (1)

UltrasoundJelly
UltrasoundJelly

Reputation: 1900

Move your -ss 00:00:25 to before the -i Here it is in your example:

ffmpeg -ss 00:00:25 -i clip.mp4 -t 55 -c copy cutted.mp4

This moves -ss from an output option, which will "seek to the closest seek point before your time," to an input option, which "decodes but discards input until the timestamps reach [your] position." Input option is much more accurate in my experience. More details here. -t denotes time of output clip in seconds.

Upvotes: 1

Related Questions