3

GOAL:

  • Real-Time Closed Captioning via ffmpeg

My setup:

  • Real-Time video from "touchdesigner" shared via "spout" to "ffmpeg" ffmpeg -f dshow -i video="SpoutCam"
  • The srt subtitle file below encoded with ffmpeg via ... -sub_charenc CP1252 -i test.srt ... -c:s:0 mov_text -metadata:s:s:0 language=eng

1

00:00:00,000 --> 00:00:05,000

Subtitle text to be updated on the fly

  • I'm trying to update the srt file on the fly in order for the new subtitle-text to get encoded and muxed the into an mpegts, but when using the following cmd i'm not getting any subtitle tracks in VLC.

    ffmpeg -f dshow -i video="SpoutCam" -sub_charenc CP1252 -i test.srt -map 0:v -map 1 -c:s:0 mov_text -metadata:s:s:0 language=eng -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f mpegts udp://127.0.0.1:1234?pkt_size=1316

And when inspecting the mpegts-stream with another instance of ffmpeg, i see the subtitle stream is still there but empty or with a wrong/different encoding:

Input #0, mpegts, from 'udp://127.0.0.1:1234?pkt_size=1316':
Duration: N/A, start: 394.666278, bitrate: N/A Program 1 Metadata: service_name : Service01 service_provider: FFmpeg Stream #0:0[0x100]: Video: h264 (High 4:4:4 Predictive) ([27][0][0][0] / 0x001B), yuv444p(progressive), 1024x768, 30 fps, 30 tbr, 90k tbn, 60 tbc Stream #0:1[0x101]: Data: bin_data ([6][0][0][0] / 0x0006)

Any idea if this is possible at all? And if so, what should i correct in order to get this working?

ab_out
  • 31

0 Answers0