Stream a video with synchronized subtitles

I have created an application that is able to stream a local file through rtmp with hard-coded (burnt) subtitles. However, the subtitles are not synchronized with audio since i have a real time subtitle generator and it has a small delay in order to create the subtitles. This is the gstreamer command i am using:

pipeline = Gst.parse_launch("""
        filesrc location=/home/j.murua@elhuyar.local/Bideoak/OnePiece001.mp4 ! decodebin3 name=dec
        dec. ! queue ! videoconvert ! textoverlay name=overlay ! x264enc tune=zerolatency ! queue ! mux. 
        dec. ! queue ! audioconvert ! audioresample ! tee name=t
        t. ! queue ! voaacenc ! queue ! mux.
        t. ! queue ! audioconvert ! audioresample ! audio/x-raw, channels=1, rate=16000, format=S16LE ! appsink name=audio_sink emit-signals=true
        flvmux name=mux streamable=true ! rtmp2sink location=rtmp://localhost/live/stream
    """)

Is there a way to add a delay to the whole rmtp stream in order to wait until the audio is transcribed?

I have tried queue with max-size-time=10000000000 but i have not been able to get the result i want. Do you know if there is any other way or i have taken the right approach?

Any help will be appreciated.