Two equations, four quantities
The math is fixed: shooting duration equals frames times interval, and final video length equals frames divided by the playback rate. Because four quantities sit in two equations, any two known values determine the other two. Give it shoot time and interval and it returns frame count and clip length; give it clip length and frame rate and it works backwards to the interval and shooting duration.