HUD overlay for viewport renders

Hi,

I have been developing a script to create viewport movie renders inside blender and everything works fine for movie generation part. But I need to also add text overlays on these movie files with general information such as project and artist details, frame number and focal length etc. But I am unable to figure out a way to do this. I have tried Spaceview3D.draw_handler_add and it creates the required heads up element on viewport but they do not render with ‘Viewport Render Animation’ option. (Possibly because that uses opengl?) Drawing text geometry seems inefficient and unnecessary and I am sure there must be a better way which I am not aware of, being new to Blender.
So I was wondering how to achieve what I am looking for and any help is greatly appreciated.
Thanks!

In Properties > Output, there is a panel called Metadata, in it you can find properties like Date, Frame, Camera, Lens, etc.

At the bottom of the panel is a Note box for you to add whatever text you like, and below that is Burn Into Image, which will render this info as part of your image.

If the info you need is not there, you can pipe existing text into bpy.context.scene.render.stamp_note_text and that will enter it into the Note box.

Exactly what I needed. Makes it much easier than other software actually. Thank you so much @SpectralVectors