Files
ccextractor/docs/HARDSUBX.txt
Carlos Fernandez 70404c29ca fix(mac): Fix HARDSUBX configure script and add documentation
Fixes #1173 - Error in ./configure enabling hardsubx on Mac
Fixes #1306 - Add HARDSUBX compilation docs for macOS

The configure.ac script failed on macOS with "binary operator expected"
because pkg-config output was unquoted. When pkg-config returns multiple
libraries (e.g., "-ltesseract -lcurl"), the unquoted expansion caused
`test ! -z` to receive multiple arguments instead of a single string.

Changes:
- Quote pkg-config output in TESSERACT_PRESENT conditional (mac & linux)
- Add macOS section to docs/HARDSUBX.txt with all build methods
- Add GitHub Actions jobs to test HARDSUBX builds on macOS:
  - build_shell_hardsubx: Tests ./build.command -hardsubx
  - build_autoconf_hardsubx: Tests ./configure --enable-hardsubx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 18:41:37 +01:00

87 lines
2.4 KiB
Plaintext

Overview
========
Subtitles which are burned into the video (or hard subbed) can be extracted using the -hardsubx flag.
The system works by processing video frames and extracting only the subtitles from them, followed
by an OCR recognition using Tesseract.
Dependencies
============
Tesseract (OCR library by Google)
Leptonica (C Image processing library)
FFMpeg (Video Processing Library)
Compilation
===========
Linux
-----
Make sure Tesseract, Leptonica and FFMPeg are installed, and that their libraries can be found using pkg-config.
Refer to OCR.txt for installation details.
FFmpeg from packages (on Debian) plus a couple of other dependencies you will need:
sudo apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libxcb-shm0-dev liblzma-dev
FFmpeg from source:
To install FFmpeg (libav), follow the steps at:-
https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu - For Ubuntu, Debian and Linux Mint
https://trac.ffmpeg.org/wiki/CompilationGuide/Generic - For generic Linux compilation
To validate your FFMpeg installation, make sure you can run the following commands on your terminal:-
pkg-config --cflags libavcodec
pkg-config --cflags libavformat
pkg-config --cflags libavutil
pkg-config --cflags libswscale
pkg-config --libs libavcodec
pkg-config --libs libavformat
pkg-config --libs libavutil
pkg-config --libs libswscale
On success, you should see the correct include directory path and the linker flags.
To build the program with hardsubx support,
== from the Linux directory run:-
./configure --enable-hardsubx
make ENABLE_HARDSUBX=yes
== using cmake from root directory
mkdir build
cd build
cmake -DWITH_OCR=on -DWITH_HARDSUBX=on ../src/
make
NOTE: The build has been tested with FFMpeg version 3.1.0, and Tesseract 3.04.
macOS
-----
Install the required dependencies using Homebrew:
brew install tesseract leptonica ffmpeg
To build the program with hardsubx support, use one of these methods:
== Using build.command (Recommended):
cd ccextractor/mac
./build.command -hardsubx
== Using autoconf:
cd ccextractor/mac
./autogen.sh
./configure --enable-hardsubx --enable-ocr
make
== Using cmake:
cd ccextractor
mkdir build && cd build
cmake -DWITH_OCR=ON -DWITH_HARDSUBX=ON ../src/
make
NOTE: The -hardsubx parameter uses a single dash (not --hardsubx).
Windows
-------
Coming Soon