X-TIMESTAMP-MAP emitted a truncated MPEGTS value on every Windows build. sync_pts2fts_pts is LLONG (int64_t) but was printed with %ld, and long is 32 bits on Windows (LLP64 on x64, ILP32 on Win32). A 90kHz PTS of 2^33 printed as "MPEGTS:0"; 2^31 printed as "MPEGTS:-2147483648". On Win32 the argument slots also desynchronise, so the trailing %s reads the PTS high dword as a char *. HLS players use this field to anchor a WebVTT segment to the transport clock, so the result is caption desync. Linux and macOS are LP64, where long is 64 bits and %ld happens to be correct, which is why this went unnoticed. For the same reason %lld would be wrong there, since int64_t is long on LP64. Use the <inttypes.h> macros instead, which are correct on every target and already used elsewhere in the tree; ccx_common_platform.h already includes <inttypes.h>. The same defect class appears at 22 sites across 10 files. They are invisible to the build because mprint() and dbg_print() carry no format(printf) attribute, so the compiler never checks those call sites. Adding the attributes locally surfaced all of them; this commit fixes them with PRId64/PRIu64/PRIx64 for fixed-width types, %zu for size_t, and an explicit (long long) cast for pointer differences. Also fixes ts_readpacket() printing payload->start, an unsigned char *, under the label "PES start". The intended field is payload->pesstart; the pointer was truncated to int and shifted the three arguments after it, so counter, payload length and adapt length were all wrong in the trace. Output on Linux and macOS is byte-identical before and after. No signature, struct, option or output-format change. Refs #2336
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)