libcaption icon indicating copy to clipboard operation
libcaption copied to clipboard

Request: srt2scc/vtt2scc

Open aplumafreak500 opened this issue 5 years ago • 1 comments

Title explains

aplumafreak500 avatar Mar 23 '19 20:03 aplumafreak500

@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:

  1. Start with a SRT file, say in.srt
  2. 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"
  3. Use libcaption flv+srt to mux in the captions as 608 into an FLV... $ flv+srt ./in.flv in.srt out.flv
  4. 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"
  5. 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"

image

bbgdzxng1 avatar Dec 26 '19 21:12 bbgdzxng1