ffmpeg output images filename with time position

Use

ffmpeg -i source -vf fps=1,select='not(mod(t,5))' -vsync 0 -frame_pts 1 z%d.jpg

frame_pts will assign a serial number to the image name, where the number represents the frame position as per the output timebase. So the calculated time position is frame # x timebase. The timebase is the reciprocal of the output framerate e.g. for a 12 fps stream, timebase is 1/12. So output file image212 represents a time of 212 x 1/12 = 17.67s

To represent seconds, you need to generate a 1 fps stream and then pick every 5th frame, to get a frame from every 5th second. The vsync 0 is added to prevent ffmpeg from duplicating frames to generate a constant frame rate stream.