You could do this by making subtitles from your data streams and then either playing them back on a media player that can display subtitles, or rendering them into the video.
Most subtitle formats are very simple ascii files — to demonstrate, here's an srt subtitle file:
1
00:00:01,046 --> 00:00:02,540
This is my home.
2
00:00:03,560 --> 00:00:05,110
I'm living here.
3
00:00:05,110 --> 00:00:08,640
My name's Nickel
Mundabi Ngadwa Nickel.
It is pretty easy to generate them from any data source, as long as you have start [and finish] times. You can then insert them into a video file as a subtitle stream using ffmpeg:
ffmpeg -i inputvideo.mp4 -i inputsubtitles.srt -c:v copy -c:a copy -c:s mov_text outfile.mp4
Any player that is capable of displaying subtitles will be able to display them. SRT subtitles like these don't have formatting info though, so the format will depend on your player's settings.
Other subtitle formats have more formatting capabilities. Here is an Advanced Substation Alpha subtitle file:
[Script Info]
ScriptType: v4.00+
PlayResX: 1920
PlayResY: 1080
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
Style: Default,Univers,56,&Hffffff,&Hffffff,&H0,&H0,0,0,0,1,2,0,2,10,10,16,0,0
[Events]
Format: Layer, Start, End, Style, Text
Dialogue: 0,0:00:01.05,0:00:02.54,Default,This is my home.
Dialogue: 0,0:00:03.56,0:00:05.11,Default,I'm living here.
Dialogue: 0,0:00:05.11,0:00:08.64,Default,My name's Nickel\NMundabi Ngadwa Nickel.
so basically you have the style definitions in the [V4+ Styles] section and the content in the [Events] section, with timing info for each bit of text. You can define multiple styles, and you can add effects and inline formatting.
You can insert them into a video file (you'll need to use the Matroska video container because mp4 doesn't support .ass
subtitles),
ffmpeg -i inputvideo.mp4 -i inputsubtitles.ass -c:v copy -c:a copy -c:s mov_text outfile.mkv
or you can "burn them in" by rendering them into the video stream thusly:
ffmpeg -i inputvideofile.mp4 -c:v libx264 -crf 20 -vf ass="inputsubtitlefile.ass" -c:a copy outputvideofile.mp4
So you can see it's not beyond the capabilities of a fairly simple shell script to do it.