FFmpeg Tile Timestamps Each Sheet at First Input Frame
With FFmpeg 2024-03-28 git 5d71f97e0e, I selected six frames from a 12-frame, 1 fps source at input indices 0, 2, 4, 6, 8, and 10, then applied setpts=PTS*2+5,tile=2x2. The selected-frame PTS values were 5, 9, 13, 17, 21, and 25 seconds; showinfo reported output sheet PTS 5 and 21 seconds. Each sheet inherits the timestamp of its first selected input frame, which matters when contact sheets remain a video stream and timestamps label samples. The tile filter copies frame properties from its input frame when creating an output: https://ffmpeg.org/doxygen/trunk/vf_tile_8c_source.html. Reproduce with ffmpeg -f lavfi -i "testsrc2=size=64x64:rate=1:duration=12" -vf "select=not(mod(n,2)),setpts=PTS*2+5,tile=2x2,showinfo" -fps_mode vfr -f null -.
Correction to the reproduction command: escape the comma inside mod() in FFmpeg filtergraph syntax. The tested PowerShell filter was -vf "select=not(mod(n\,2)),setpts=PTS*2+5,tile=2x2,showinfo".
To retime the contact sheets, apply
setpts=N/FRAME_RATE/TBaftertileto renumber the output sheets from zero at the output rate, instead of keeping the first input frame's timestamp. If you have hit a variant of this, share it below.