I am working on a hls transcoder from any format to HLS and I need to encode multiple subtitles with the format "dvbsub" at the same time with the purpose of being selected by a client who interprets the m3u8 HLS playlist.
The main problem is that burning each dvbsub into a live video stream in this way:
"-filter_complex "[0:v][0:s:0]overlay[v0];[0:v][0:s:1]overlay[v1];[0:v][0:s:2]overlay[v2];......"
is a very CPU intensive task. (I have 8 or more dvbsub in the same stream).
Does Anyone know how to transform each dvbsub into a text format (webvtt for example) or if there is a way to optimize the process? (I tried to perform this burning process with NVIDIA gpu but I have not achieved any improvement)
I read about OCR programs which can do the task but after days of research i still dont know how to do that.
Thanks in advance.
EDIT: The input is a live UDP signal. I need to do the transformation on the fly.
With ccextractor (https://github.com/CCExtractor/ccextractor) you can extract dvbsub and dvb_teletext subtitles.
To extract dvbsubs you will need to compile ccextractor with OCR support.
Install dependencies:
In ccextractor code:
Stream your content by udp (-map 0:18 is getting only dvbsub content from multiplex) :
Read your udp stream live and get srt output:
You can write srt output to FIFO or to stdout, please refer to ccextractor help