fps = 1 / thisComp.frameDuration;
fps % 1 === 0 ? fps.toFixed(0) : fps.toFixed(2);
Fetches the active comp’s frame duration and converts it into frames per second (FPS), automatically formatting it to match whole or fractional frame rates. This ensures accurate display whether you’re working at 23.976, 24, 29.97, 30, or 60 FPS.
Contributed by:
Display the frame rate directly inside your video for metadata overlays, debugging multiple deliverables, or automated template workflows.