1 year ago

#121520

test-img

Muhammad

FFmpeg: add subtitles to live stream dynamically

Can we use FFmpge's subtitles filter for dynamic subtitles? For example my subtitles are not coming from the original source and I don't have a srt or ASS file, I am extracting the audio from the source(live rtmp url) and sending it to Microsoft Azure to recognize it on realtime and then I am again publishing it to a rtmp push URL with subtitles but currently I am using drawtext filter which is not very flexible.

ffmpeg(rtmpSourceUrl)
    .inputOptions(["-re"])
    .withOption([
      "-y", // Overwrite
      "-vn", // No Video
      "-f s16le", // format (wav)
      "-acodec pcm_s16le", // codec (wav)
      "-ac 1", // audio channles (1 MONO)
      "-ar 16000", // 16KH
    ])
    .output(azurePushStream)

Any help will be greatly appreciated! Thanks

ffmpeg

live-streaming

fluent-ffmpeg

video-subtitles

0 Answers

Your Answer

Accepted video resources