I am currently using ffmpeg to convert videos in various formats to flv files. One request has also come up and that is to get closed caption info out o the file as well. Does anyone have any experience with this or know it can even be done. I don't see any options for it but thought I would ask and see.
相关问题
- Improving accuracy of Google Cloud Speech API
- MP4 codec support in Chromium
- Streaming video (C# using FFmpeg AutoGen) sends mu
- How do I decode opus file to pcm file using libavc
- ffmpeg for Android: neon build has text relocation
相关文章
- Handling ffmpeg library interface change when upgr
- How to use a framework build of Python with Anacon
- c++ mp3 library [closed]
- Passing a native fd int to FFMPEG from openable UR
- FFmpeg - What does non monotonically increasing dt
- ffmpeg run from shell runs properly, but does not
- Issues in executing FFmpeg command in Java code in
- Terminal text becomes invisible after terminating
For getting just the subtitles and not any meta junk, I've found that
works best for me.
If anyone, like me, ends up on this thread, here's a bit more detailed explanation on
ffmpeg
command that worked for me.There seems a hard requirement on source to be of
mpegts
format (file extension.ts
). Otherwise thelavfi
filter does not seem to work. The specout+subcc
forces ffmpeg to treat closed captions (which are embedded into frame data) as separate stream. Later-map 0:1
makesffmpeg
map only that stream and discard everything else. Result is saved tooutput.srt
. Depending on your input the mapping might be different. One easy way to figure out the closed captions mapping is to runffprobe
command, like soStream
Subtitle: eia_608
has "index"0:1
, so that is what should be mapped.Few parting notes, order of arguments matters for
ffmpeg
,-f lavfi
must go before-i move=...
, otherwise the spec will not be recognized. Also this feature is pretty recent, so double check yourffmpeg
version and upgrade if needed.If the caption are included as a separate stream, then extracting them is (relatively) straightforward:
If it's "burned in" on the video file, then you're probably out of luck, but I that would be more common for subtitles than closed captions.
Closed Captions are not separate streams, nor are they burned into the picture, they are interlaced in scanlines IN the picture - this a strange American idea, not really used elsewhere. Though you can buy DVD's which has this kind of subtitling, usually people outside the US can't see the subtitles, and may not even know there are some in the file.
CCExtractor can extract this information from VOB's by looking at the TS metadata: http://ccextractor.sourceforge.net/
Closed caption are of 2 format
1) ATSC American standard (support is there in ffmpeg)
2) ISDB Japanese standard (support is yet not there in ffmpeg)
you can use following command
This thing has been recently developed so please check out your version of ffmpeg.