[FFmpeg-user] extract first 26 seconds not workings as expected
barsnick at gmx.net
Mon Jun 29 13:39:23 EEST 2020
On Sun, Jun 28, 2020 at 18:31:15 +0000, Leonardo via ffmpeg-user wrote:
> $ ffmpeg -i main.mp4 -ss 00:00:00.00 -t 00:00:26.00 -c copy part1.mp4
> frame= 322 fps=0.0 q=-1.0 Lsize= 523kB time=00:00:25.95 bitrate= 165.2kbits/s speed=8.19e+03x
> video:519kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.881877%
322 frames at 23.8 fps looks suspiciously like 13.5 seconds.
> However, file part1.mp4 has only 13 seconds!
> Duration: 00:00:13.42, start: 12.666016, bitrate: 319 kb/s
13.42 + 12.66 is approximately 25.
So my guess is that your input file's first keyframe is at 12.66
seconds, and ffmpeg refuses to copy the frames before that one.
You may want to try the option "-copyinkf" ("copy initial
non-keyframes") when using "-c copy".
> Also, how can I cut one part that begins at 00:01:00 and ends at 00:02:16 ?
How about "-ss 00:01:00 -t 1:16"? (I'm also not sure how this behaves
without keyframes, and whether that segment will ever be playable.)
More information about the ffmpeg-user