Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: srt2scc/vtt2scc #57

Open
aplumafreak500 opened this issue Mar 23, 2019 · 1 comment
Open

Request: srt2scc/vtt2scc #57

aplumafreak500 opened this issue Mar 23, 2019 · 1 comment

Comments

@aplumafreak500
Copy link

Title explains

@bbgdzxng1
Copy link

bbgdzxng1 commented Dec 26, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants