update_encoder_list_cinfo() declares enc_ctx uninitialised and uses it as the
list_for_each_entry() iterator. For a DVB stream carrying a language, the search
loop continues past every encoder whose dvb_lang does not match, so it can finish
without returning. When the encoder list is non-empty none of the creation
branches below run either, and the function falls through to
enc_ctx->prev = NULL;
with enc_ctx still holding the value the loop terminated on: the list head
reinterpreted as an encoder_ctx. That pointer is written to, and later
general_loop.c does dvb_enc->timing = dvb_dec->timing on it, which segfaults.
It reproduces on any recording that carries both a teletext stream and a DVB
subtitle stream, in every output format, with no extra flags:
ccextractor --out=srt sample.mpg -> SIGSEGV
ccextractor --out=webvtt sample.ts -> SIGSEGV
Restricting to one PID (--datapid) avoids it, which is why the regression suite
never caught it: the only affected sample it runs passes --datapid.
Clear the iterator after the loop so "not found" is distinguishable, and give
such a stream its own per-language encoder, which is what the multi-DVB path
already does. The existing dvb_pid_count >= 2 test stays as an OR so a recording
whose only caption stream is a single DVB PID keeps its plain output filename --
that case reaches the standard path with an empty encoder list. A NULL guard
before the tail keeps the fall-through honest if some future path adds one.
Both streams are now extracted into separate, well-formed files (out.srt plus
out_eng.srt) rather than one file with two interleaved numberings.
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)