Skip to content

Commit 7d94a15

Browse files
committed
Update COMPILATION.md with FFmpeg version configuration
- Document platform-specific FFmpeg defaults - Add instructions for overriding FFmpeg versions - Include hardsubx build examples for all platforms - Add FFmpeg dependency information for macOS
1 parent b0529d8 commit 7d94a15

File tree

1 file changed

+47
-8
lines changed

1 file changed

+47
-8
lines changed

docs/COMPILATION.MD

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ Clone the latest repository from Github
1010
git clone https://github.com/CCExtractor/ccextractor.git
1111
```
1212

13+
### Hardsubx (Burned-in Subtitles) and FFmpeg Versions
14+
15+
CCExtractor's hardsubx feature extracts burned-in subtitles from videos using OCR. It requires FFmpeg libraries. The build system automatically selects appropriate FFmpeg versions for each platform:
16+
17+
- **Linux**: FFmpeg 6.x (default)
18+
- **Windows**: FFmpeg 7.x (default)
19+
- **macOS**: FFmpeg 8.x (default)
20+
21+
You can override the default by setting the `FFMPEG_VERSION` environment variable to `ffmpeg6`, `ffmpeg7`, or `ffmpeg8` before building. This flexibility ensures compatibility with different FFmpeg installations across platforms.
22+
1323
## Docker
1424
You can now use docker image to build latest source of CCExtractor without any environmental hustle. Follow these [instructions](https://github.com/CCExtractor/ccextractor/tree/master/docker/README.md) for building docker image & usage of it.
1525

@@ -62,12 +72,22 @@ cd ccextractor/linux
6272
# compile with debug info
6373
./build -debug # same as ./builddebug
6474

65-
# compile with hardsubx
66-
[Optional] You need to set these environment variables correctly according to your machine,
67-
FFMPEG_INCLUDE_DIR=/usr/include
68-
FFMPEG_PKG_CONFIG_PATH=/usr/lib/pkgconfig
75+
# compile with hardsubx (burned-in subtitle extraction)
76+
# Hardsubx requires FFmpeg libraries. Different FFmpeg versions are used by default:
77+
# - Linux: FFmpeg 6.x (automatic)
78+
# - Windows: FFmpeg 7.x (automatic)
79+
# - macOS: FFmpeg 8.x (automatic)
80+
81+
./build -hardsubx # uses platform-specific FFmpeg version
6982

70-
./build -hardsubx # same as ./build_hardsubx
83+
# To override the default FFmpeg version, set FFMPEG_VERSION:
84+
FFMPEG_VERSION=ffmpeg8 ./build -hardsubx # force FFmpeg 8 on any platform
85+
FFMPEG_VERSION=ffmpeg6 ./build -hardsubx # force FFmpeg 6 on any platform
86+
FFMPEG_VERSION=ffmpeg7 ./build -hardsubx # force FFmpeg 7 on any platform
87+
88+
# [Optional] For custom FFmpeg installations, set these environment variables:
89+
FFMPEG_INCLUDE_DIR=/usr/include
90+
FFMPEG_PKG_CONFIG_PATH=/usr/lib/pkgconfig
7191

7292
# compile in debug mode without rust
7393
./build -debug -without-rust
@@ -113,9 +133,15 @@ sudo make install
113133

114134
`cmake` also accepts the options:
115135
`-DWITH_OCR=ON` to enable OCR
116-
`-DWITH_HARDSUBX=ON` to enable burned-in subtitles
136+
`-DWITH_HARDSUBX=ON` to enable burned-in subtitles (requires FFmpeg)
117137

118-
([OPTIONAL] For hardsubx, you also need to set these environment variables correctly according to your machine)
138+
For hardsubx with specific FFmpeg versions:
139+
Set `FFMPEG_VERSION=ffmpeg6` for FFmpeg 6.x
140+
Set `FFMPEG_VERSION=ffmpeg7` for FFmpeg 7.x
141+
Set `FFMPEG_VERSION=ffmpeg8` for FFmpeg 8.x
142+
(Defaults: Linux=FFmpeg 6, Windows=FFmpeg 7, macOS=FFmpeg 8)
143+
144+
([OPTIONAL] For custom FFmpeg installations, set these environment variables)
119145

120146
FFMPEG_INCLUDE_DIR=/usr/include
121147
FFMPEG_PKG_CONFIG_PATH=/usr/lib/pkgconfig
@@ -136,6 +162,8 @@ brew install cmake gpac
136162
# optional if you want OCR:
137163
brew install tesseract
138164
brew install leptonica
165+
# optional if you want hardsubx (burned-in subtitle extraction):
166+
brew install ffmpeg
139167
```
140168

141169
If configuring OCR, use pkg-config to verify tesseract and leptonica dependencies, e.g.
@@ -151,7 +179,12 @@ pkg-config --exists --print-errors lept
151179

152180
```bash
153181
cd ccextractor/mac
154-
./build.command # OR ./build.command OCR
182+
./build.command # basic build
183+
./build.command -ocr # build with OCR support
184+
./build.command -hardsubx # build with hardsubx (uses FFmpeg 8 by default on macOS)
185+
186+
# Override FFmpeg version if needed:
187+
FFMPEG_VERSION=ffmpeg7 ./build.command -hardsubx
155188

156189
# test your build
157190
./ccextractor
@@ -220,6 +253,12 @@ Other dependencies are required through vcpkg, so you can follow below steps:
220253
```
221254
vcpkg install ffmpeg leptonica tesseract --triplet x64-windows-static
222255
```
256+
Note: Windows builds use FFmpeg 7 by default. To override:
257+
```
258+
set FFMPEG_VERSION=ffmpeg8
259+
msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=x64
260+
```
261+
223262
otherwise if you have Debug, Release
224263
```
225264
vcpkg install libpng --triplet x64-windows-static

0 commit comments

Comments
 (0)