libcaption
libcaption copied to clipboard
Request: srt2scc/vtt2scc
Title explains
@aplumafreak500... in case it helps, you can use a combination of libcaption and FFmpeg. It is a bit of a long-way-around hack, but it works:
- Start with a SRT file, say
in.srt
- Create yourself a dummy FLV file of appropriate duration...
$ ffmpeg -hide_banner -f "lavfi" -i "testsrc=size=640x360:rate=30*1000/1001" -c:v "libx264" -pix_fmt:v "yuv420p" -t "00:02:00.000" "in.flv"
- Use libcaption flv+srt to mux in the captions as 608 into an FLV...
$ flv+srt ./in.flv in.srt out.flv
- Convert the FLV to TS, copying the A/53 608 captions...
$ ffmpeg -y -hide_banner -i "./out.flv" -a53cc "1" -c:v "copy" -f "mpegts" "./out.ts"
- Extract the 608 from the TS into an SCC...
$ ffmpeg -y -f "lavfi" -i "movie=./out.ts[out+subcc]" -vn -an -dn -c:s "copy" "./out.scc"
You have now converted from srt2scc. You can compare the input SRT with the output SCC with FFplay...
$ ffplay in.flv -vf "subtitles=./in.srt,subtitles=./out.scc"
