0

I am trying to extract a video clip from an mkv file, but its not accurate. I played my mkv file and noted the point e.g. starting 00:06:20 till 10 seconds. Now I executed a command like this

ffmpeg -ss 00:06:20 -i video-with-subs.mkv -t 00:00:10 -vcodec copy -acodec copy part1.mkv

The generated clip was somewhat from 00:06:12 till 10 seconds.

DavidPostill
  • 153,128
  • 77
  • 353
  • 394
coure2011
  • 1,567
  • 9
  • 25
  • 35
  • 2
    I'm hazarding a guess this is due to how video compression works and the fact you are copying and not transcoding the video. I'm thinking the first keyframe before 06:20 starts at 06:12 and thats why it starts there. – Silbee Oct 17 '21 at 10:47
  • 1
    From the documentation: `When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so fmpeg 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. ` – Rajib Oct 17 '21 at 10:50
  • so how should I fix it? – coure2011 Oct 18 '21 at 06:17
  • @Silbee how to enforce it to start exactly at the given time – coure2011 Oct 18 '21 at 06:31
  • 1
    I dont know the exact ffmpeg syntax, but you would have to actually transcode the video and not copy the stream. I assume you can do this by just filling in the codec instead of 'copy'. That way it will rebuild the images and should be able to start at the exact time. – Silbee Oct 18 '21 at 08:05

0 Answers0