You can use a combination of two tools to do this: ffmpeg and mp4fpsmod
Step 1 is to generate a constant frame rate file using ffmpeg
ffmpeg -i images%d.bmp -pix_fmt yuv420p ffmpeg-cfr.mp4
Step 2 is to generate a timecode file like the one below, with each line containing the relative timestamp for a frame in milliseconds.
# timecode format v2
0
33
88
100
120
160
200
230
330
347
Step 3 is to use mp4fpsmod to generate the VFR file
mp4fpsmod -o vfr.mp4 -t timecodes.txt ffmpeg-cfr.mp4
This file plays as expected with ffplay
but may not with some players, in which case run
Step 4 Generate a CFR MP4 from the VFR using FFmpeg
ffmpeg -i vfr.mp4 final-cfr.mp4
This is a CFR file but the temporal relations are preserved as per the VFR, although there will be some PTS adjustments, if the timecode intervals are very irregular. That can be remedied by specifying a high framerate -r N
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…