get_data() reads a 32-byte element header and believes whatever 32-bit length it finds. On one recording the parser walks 182,902 elements correctly and then meets 8800 bytes it cannot interpret; the "length" read there is 0x8A9E4344. That value is passed to skip_sized_buffer(), which hands it to buffered_seek() as an int, turning a forward skip into a 1.8 GB backward seek and a segfault. Reject a length that cannot describe an element (below the 32-byte header, or implausibly large) and hunt forward for the next header instead. Most GUIDs that open a timeline element share the same 15 trailing bytes and differ only in the first, which makes them a dependable anchor; the scan keeps a rolling 32-byte window so the caller ends up positioned exactly as after a normal header read. The end-of-file marker is exempt from the length test. It legitimately carries a zero length and is handled further down, so treating it as garbage ended the parse early and changed the last cue of every WTV recording. On the affected file the parser resynchronises after 8800 bytes -- matching the gap measured independently between the last valid element and the next one -- and carries on to the end of the recording. Verified byte for byte over the 45 local WTV samples, master vs this branch: byte-identical output : 44 differing : 0 crash fixed : 1, cues 100 -> 151 Coverage on that recording goes from 228s to 356s of a 358s file, and the resync fires exactly once across the whole corpus.
CCExtractor
CCExtractor is a tool used to produce subtitles for TV recordings from almost anywhere in the world. We intend to keep up with all sources and formats.
Subtitles are important for many people. If you're learning a new language, subtitles are a great way to learn it from movies or TV shows. If you are hard of hearing, subtitles can help you better understand what's happening on the screen. We aim to make it easy to generate subtitles by using the command line tool or Windows GUI.
The official repository is (CCExtractor/ccextractor) and master being the most stable branch.
Features
- Extract subtitles in real-time
- Translate subtitles
- Extract closed captions from DVDs
- Convert closed captions to subtitles
Programming Languages & Technologies
The core functionality is written in C. Other languages used include C++ and Python.
Installation and Usage
Downloads for precompiled binaries and source code can be found on our website.
WebVTT Output Options
CCExtractor supports optional WebVTT-specific headers for advanced use cases such as HTTP Live Streaming (HLS).
--timestamp-map
Enable writing the X-TIMESTAMP-MAP header in WebVTT output.
This header is required for HLS workflows but is disabled by default to preserve compatibility with standard WebVTT players.
Example:
ccextractor input.ts --timestamp-map -o output.vtt
Windows Package Managers
WinGet:
winget install CCExtractor.CCExtractor
Chocolatey:
choco install ccextractor
Scoop:
scoop bucket add extras
scoop install ccextractor
Extracting subtitles is relatively simple. Just run the following command:
ccextractor <input>
This will extract the subtitles.
More usage information can be found on our website:
You can also find the list of parameters and their brief description by running ccextractor without any arguments.
You can find sample files on our website to test the software.
Building from Source
Linux (Autotools) build notes
CCExtractor also supports an autotools-based build system under the linux/
directory.
Important notes:
- The autotools workflow lives inside
linux/. Theconfigurescript is generated there and should be run from that directory. - Typical build steps are:
cd linux
./autogen.sh
./configure
make
- Rust support is enabled automatically if
cargoandrustcare available on the system. In that case, Rust components are built and linked duringmake. - If you encounter unexpected build or linking issues, a clean rebuild
(
make cleanor a fresh clone) is recommended, especially when Rust is involved.
This build flow has been tested on Linux and WSL.
Compiling CCExtractor
To learn more about how to compile and build CCExtractor for your platform check the compilation guide.
Support
By far the best way to get support is by opening an issue at our issue tracker.
When you create a new issue, please fill in the needed details in the provided template. That makes it easier for us to help you more efficiently.
If you have a question or a problem you can also contact us by email or chat with the team in Slack.
If you want to contribute to CCExtractor but can't submit some code patches or issues or video samples, you can also donate to us
Contributing
You can contribute to the project by reporting issues, forking it, modifying the code and making a pull request to the repository. We have some rules, outlined in the contributor's guide.
News & Other Information
News about releases and modifications to the code can be found in the CHANGES.TXT file.
For more information visit the CCExtractor website: https://www.ccextractor.org
License
GNU General Public License version 2.0 (GPL-2.0)