How to calculate the length of the video file that was encoded so far?
Short answer is No.

Longer answer is, it depends.

If you're encoding a file, then generally the output is the duration of the input, unless there's speed change or trim filters or -ss, -to, -t options applied. For a live input, FFmpeg will stop the encode when it encounters EOF on the input, so unless you know that, you won't know the output duration. For multiple inputs of differing duration, it will depend on what the command is e.g. is there a -shortest in there, is there an amix, which defaults to the longest of the inputs, or amerge which terminates upon the shortest input.

By default, the ffmpeg console readout will display the progress of the encoding in realtime i.e. the duration encoded, so far.