Tool
Encoding a two-hour video in full for every CRF value you want to compare can take a whole day. Enter the video duration and this tool picks a few short segments spread evenly across it, avoiding the start and end, and builds the ffmpeg commands that cut out just those segments. Calculations happen only inside this browser, and no video file is read.
Cut method
Selected clips (video duration 1:32:40.000)
| # | Start | End | Position |
|---|---|---|---|
| 1 | 18:27.000 | 18:37.000 | 19.9% |
| 2 | 46:15.000 | 46:25.000 | 49.9% |
| 3 | 1:14:03.000 | 1:14:13.000 | 79.9% |
① Clip extraction commands (run one line at a time)
ffmpeg -ss 1107.000 -i "input.mp4" -t 10 -an -c:v libx264 -qp 0 -preset veryfast -pix_fmt yuv420p "input_clip01.mkv" ffmpeg -ss 2775.000 -i "input.mp4" -t 10 -an -c:v libx264 -qp 0 -preset veryfast -pix_fmt yuv420p "input_clip02.mkv" ffmpeg -ss 4443.000 -i "input.mp4" -t 10 -an -c:v libx264 -qp 0 -preset veryfast -pix_fmt yuv420p "input_clip03.mkv"
② Joining the clips into one file: contents of list.txt
file 'input_clip01.mkv' file 'input_clip02.mkv' file 'input_clip03.mkv'
③ Concatenation command
ffmpeg -f concat -safe 0 -i list.txt -c copy "input_testset.mkv"
Check the duration (ffprobe)
ffprobe -v error -show_entries format=duration -of default=nw=1 "input.mp4"
Check keyframe times in the first 60 seconds (ffprobe)
ffprobe -v error -select_streams v:0 -show_entries packet=pts_time,flags -of csv=p=0 -read_intervals "0%+60" "input.mp4"
It takes the target range (the video duration minus the fraction you skip at the start and end), divides it into as many equal bins as the number of clips, and places a clip of the length you set at the center of each bin. That is all. It does not choose by scene content, so ‘representative’ here only means evenly spread out; it does not guarantee that the clips' scores match the average of the whole video.
ffprobe command at the bottom of the tool and enter it (you can also paste the output).-qp 0) H.264. That is safe to use as a test source, but the files are large. For how many times larger near-lossless files get, see the result tables in the lossless archiving measurement.Commands ② and ③ are optional, for when you want to join the clips into one file and test it in one pass. In a joined file the scene changes abruptly between clips, so the encoder's motion prediction starts fresh at each of those points. If you don't want the seams between clips to affect the result, encoding each clip separately is simpler. Only pieces with the same codec, resolution and frame rate can be joined with -c copy, and you can check compatibility with the Concat Compatibility Checker.
-an. If you need audio, remove -an from the command and add -c:a copy.-pix_fmt yuv420p). If that property is part of what you are testing, use ‘Copy as is’ or change the pixel format in the command yourself.