# split-video-into-parts test, ffmpeg: ffmpeg version 6.1.1-3ubuntu5 Copyright (c) 2000-2023 the FFmpeg developers srcA: video 3700 frames, 148.000 s, audio 148.023 s, size 24118606 B, keyframes at [0.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0, 120.0, 130.0, 140.0] control 1: expected frames 3700, got 3700 -> OK ## control: stream copy at 40 s (a multiple of the 10 s keyframe spacing) (requested 40 s parts) part | video s | audio s | frames | video start s 1 | 40.000 | 39.962 | 1000 | 0.080 2 | 40.000 | 39.985 | 1000 | 0.000 3 | 40.000 | 40.008 | 1000 | 0.000 4 | 28.000 | 28.069 | 700 | 0.000 parts 4, frames in all parts 3700 (source 3700), worst video-length error 0.000 s (last part is the 28 s remainder, not counted) control 2: worst error 0.000 s -> OK (<0.1 s) ## A stream copy, segment_time 37 (requested 37 s parts) part | video s | audio s | frames | video start s 1 | 40.000 | 39.962 | 1000 | 0.080 2 | 40.000 | 39.985 | 1000 | 0.000 3 | 40.000 | 40.008 | 1000 | 0.000 4 | 28.000 | 28.069 | 700 | 0.000 parts 4, frames in all parts 3700 (source 3700), worst video-length error 9.000 s ## B re-encode with forced keyframes, segment_time 37 (requested 37 s parts) part | video s | audio s | frames | video start s 1 | 37.000 | 36.966 | 925 | 0.080 2 | 37.000 | 36.989 | 925 | 0.000 3 | 37.000 | 36.990 | 925 | 0.000 4 | 37.000 | 37.082 | 925 | 0.000 parts 4, frames in all parts 3700 (source 3700), worst video-length error 0.000 s ## C one trim per part (-ss/-to after -i, re-encode, same command shape as the Koldflux Trim tool) (requested 37 s parts) part | video s | audio s | frames | video start s 1 | 37.000 | 37.023 | 925 | 0.000 2 | 37.000 | 37.023 | 925 | 0.000 3 | 37.000 | 37.023 | 925 | 0.000 4 | 37.000 | 37.023 | 925 | 0.000 parts 4, frames in all parts 3700 (source 3700), worst video-length error 0.000 s ## size cap on srcB (CRF 23, 1 s keyframes: 74 s test pattern then 74 s mandelbrot) srcB: 148.000 s, 48773598 B, average 2636.4 kbit/s; cap 10000000 B naive length from the average with 10% margin: floor(10000000*0.9*8/2636411) = 27 s part | size B | over cap? 1 | 2863732 | ok 2 | 2871276 | ok 3 | 3463454 | ok 4 | 7355483 | ok 5 | 20047763 | OVER 6 | 12178993 | OVER 6 parts, largest 20047763 B = 200% of cap, smallest 2863732 B; 2 over the cap first half (test pattern): 746.8 kbit/s second half (mandelbrot): 4324.4 kbit/s length from the busiest half (4324.4 kbit/s) with 10% margin: floor(10000000*0.9*8/4324352) = 16 s 10 parts, largest 16526649 B = 165% of cap, smallest 1695026 B; 2 over the cap byte-based cut points (keyframes): [83.0, 112.0, 125.88, 136.88, 145.88] 6 parts, largest 9656583 B = 97% of cap, smallest 1374796 B; 0 over the cap part | size B 1 | 9656583 2 | 9134551 3 | 9573218 4 | 9393512 5 | 9648029 6 | 1374796 done