Get the character count from LibreOffice writer, measured from the 1st line to a given line number?

I would like to make similar videos of scrolling text, which is syncronous with the reading voice: https://www.youtube.com/watch?v=2zeqWGoiCTA
It is difficult to ensure, that the current line let be always in the scrolling window, preferably in the middle.
Currently I can generate only a steady scrolling of a constant speed. For this reason I have to ensure that the text contains about the same number of letters in every state of the scrolling window, line by line. So I would like to format my text to ensure this criteria, by dividing the text into more paragraph, setting the before- and after paragraph spacing, or even adding empty paragraphs with spacing. I have to do this because the text usually contains dialogues, which contain fewer characters, this is why I have to decrease the average number of letters in the other paragraphs which don’t contain dialogues. This way I could equalize the character count through the whole text, which take place in the current state of the scrolling window.

My problem is that how can I query the character count from top of the text to a given line number ( count of vowels would be even better ) ? Drawing an interactive cumulative distribution of the line-by-line letter count would be optimal for me (or equivalently character counts of the line-by-line scrolling window states). Should I use the internal BASIC interpreter to get this information? Any guidance would be welcome.

Find & Replace
Regular expressions enabled
Find: [aeiouäöü] (In square brackets all the characters you want to count as vowels; I did it for German.)
Replace: & (Meaning: Replace with what you just found.)
Replace All (May need some time.)

Above the Replace: line you will be informed how often something was replaced.

(I don’t know what maximum number of replacements is accepted. My extreme example was 30p with 39510 vowels. The process took about 37 s on my system.)

(Edit:)
Just tested: A primitive user Sub for the task tried on 120p with 4 times the above used text and thuis with 158040 vowels needed 6.0 s for the counting.