Rtmp with hardcoded subtitles

Hello, i am new to gstreamer and I would like to ask if this is achievable. I have an automatic simultaneous transcription service and i would like to create an rtmp stream that streams a file with hardcoded captions or subtitles. Is it posible to do this with python and where can i found the documentation to make an application to do so?

By hardcoded you mean “burnt” into the video?

For that you would have to decode the file, then use textoverlay to overlay the text subtitles and re-encode it and re-mux it, then stream it out with rtmpsink2.

And what is the difference between rtmpsink2 and rtmpsink? I have been using the second one and it streams the video correctly through rtmp.