FFmpeg: add subtitles to live stream dynamically
Asked Answered
C

0

3

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

Cluff answered 1/2, 2022 at 6:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.