2025-12-20 17:26:27 +01:00
|
|
|
# CCExtractor Docker Image
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
This Dockerfile builds CCExtractor with support for multiple build variants.
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
## Build Variants
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
| Variant | Description | Features |
|
|
|
|
|
|---------|-------------|----------|
|
|
|
|
|
| `minimal` | Basic CCExtractor | No OCR support |
|
|
|
|
|
| `ocr` | With OCR support (default) | Tesseract OCR for bitmap subtitles |
|
|
|
|
|
| `hardsubx` | With burned-in subtitle extraction | OCR + FFmpeg for hardcoded subtitles |
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
## Building
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
### Standalone Build (from Dockerfile only)
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
You can build CCExtractor using just the Dockerfile - it will clone the source from GitHub:
|
2024-07-17 08:47:57 +05:30
|
|
|
|
|
|
|
|
```bash
|
2025-12-20 17:26:27 +01:00
|
|
|
# Default build (OCR enabled)
|
|
|
|
|
docker build -t ccextractor docker/
|
|
|
|
|
|
|
|
|
|
# Minimal build (no OCR)
|
|
|
|
|
docker build --build-arg BUILD_TYPE=minimal -t ccextractor docker/
|
|
|
|
|
|
|
|
|
|
# HardSubX build (OCR + FFmpeg for burned-in subtitles)
|
|
|
|
|
docker build --build-arg BUILD_TYPE=hardsubx -t ccextractor docker/
|
2024-07-17 08:47:57 +05:30
|
|
|
```
|
|
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
### Build from Cloned Repository (faster)
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
If you have already cloned the repository, you can use local source for faster builds:
|
2024-07-17 08:47:57 +05:30
|
|
|
|
|
|
|
|
```bash
|
2025-12-20 17:26:27 +01:00
|
|
|
git clone https://github.com/CCExtractor/ccextractor.git
|
|
|
|
|
cd ccextractor
|
|
|
|
|
|
|
|
|
|
# Default build (OCR enabled)
|
|
|
|
|
docker build --build-arg USE_LOCAL_SOURCE=1 -f docker/Dockerfile -t ccextractor .
|
|
|
|
|
|
|
|
|
|
# Minimal build
|
|
|
|
|
docker build --build-arg USE_LOCAL_SOURCE=1 --build-arg BUILD_TYPE=minimal -f docker/Dockerfile -t ccextractor .
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
# HardSubX build
|
|
|
|
|
docker build --build-arg USE_LOCAL_SOURCE=1 --build-arg BUILD_TYPE=hardsubx -f docker/Dockerfile -t ccextractor .
|
2024-07-17 08:47:57 +05:30
|
|
|
```
|
|
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
## Build Arguments
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
| Argument | Default | Description |
|
|
|
|
|
|----------|---------|-------------|
|
|
|
|
|
| `BUILD_TYPE` | `ocr` | Build variant: `minimal`, `ocr`, or `hardsubx` |
|
|
|
|
|
| `USE_LOCAL_SOURCE` | `0` | Set to `1` to use local source instead of cloning |
|
|
|
|
|
| `DEBIAN_VERSION` | `bookworm-slim` | Debian version to use as base |
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
### Basic Usage
|
2024-07-17 08:47:57 +05:30
|
|
|
|
|
|
|
|
```bash
|
2025-12-20 17:26:27 +01:00
|
|
|
# Show version
|
|
|
|
|
docker run --rm ccextractor --version
|
|
|
|
|
|
|
|
|
|
# Show help
|
|
|
|
|
docker run --rm ccextractor --help
|
2024-07-17 08:47:57 +05:30
|
|
|
```
|
|
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
### Processing Local Files
|
|
|
|
|
|
|
|
|
|
Mount your local directory to process files:
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
```bash
|
|
|
|
|
# Process a video file with output file
|
|
|
|
|
docker run --rm -v $(pwd):$(pwd) -w $(pwd) ccextractor input.mp4 -o output.srt
|
|
|
|
|
|
|
|
|
|
# Process using stdout
|
|
|
|
|
docker run --rm -v $(pwd):$(pwd) -w $(pwd) ccextractor input.mp4 --stdout > output.srt
|
|
|
|
|
```
|
2024-07-17 08:47:57 +05:30
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
### Interactive Mode
|
2024-07-17 08:47:57 +05:30
|
|
|
|
|
|
|
|
```bash
|
2025-12-20 17:26:27 +01:00
|
|
|
docker run --rm -it --entrypoint=/bin/bash ccextractor
|
2024-07-17 08:47:57 +05:30
|
|
|
```
|
|
|
|
|
|
2025-12-20 17:26:27 +01:00
|
|
|
## Image Size
|
|
|
|
|
|
|
|
|
|
The multi-stage build produces runtime images:
|
|
|
|
|
- `minimal`: ~130MB
|
|
|
|
|
- `ocr`: ~215MB (includes Tesseract)
|
|
|
|
|
- `hardsubx`: ~610MB (includes Tesseract + FFmpeg)
|