H.264 produced by ffmpeg from images has no duration
You're outputting to a raw bitstream. Usually, you want to output to a container like .mp4, .mov or .mkv.

H.264 raw bitstreams have no index and individual frames have no timestamps (PTS/DTS). The definitive way to estimate the duration is by counting the frames and dividing by the frame rate. Of course, this only holds for streams to be shown at a constant framerate.