-
Notifications
You must be signed in to change notification settings - Fork 447
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'CCExtractor:master' into master
- Loading branch information
Showing
56 changed files
with
3,857 additions
and
796 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ name: Build CCExtractor on Windows | |
env: | ||
RUSTFLAGS: -Ctarget-feature=+crt-static | ||
VCPKG_DEFAULT_TRIPLET: x64-windows-static | ||
VCPKG_DEFAULT_BINARY_CACHE: C:\vcpkg\.cache | ||
VCPKG_COMMIT: fba75d09065fcc76a25dcf386b1d00d33f5175af | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -22,36 +24,45 @@ on: | |
|
||
jobs: | ||
build_release: | ||
runs-on: windows-2019 | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
- name: Install llvm and clang | ||
run: choco install llvm gpac | ||
with: | ||
msbuild-architecture: x64 | ||
- name: Install gpac | ||
run: choco install gpac --version 2.4.0 | ||
- name: Setup vcpkg | ||
run: mkdir C:\vcpkg\.cache | ||
- name: Cache vcpkg | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
C:\vcpkg\.cache | ||
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }} | ||
- name: Build vcpkg | ||
run: | | ||
git clone https://github.com/microsoft/vcpkg | ||
./vcpkg/bootstrap-vcpkg.bat | ||
- name: Install dependencies | ||
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/ | ||
working-directory: windows | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
- name: Install Win 10 SDK | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
- name: Setup Vcpkg | ||
id: vcpkg | ||
uses: friendlyanon/setup-vcpkg@v1 | ||
with: | ||
committish: "2023.08.09" | ||
cache-version: "3" | ||
ignore-reserve-cache-error: true | ||
- name: Install dependencies | ||
run: cd vcpkg && vcpkg integrate install && vcpkg install leptonica tesseract ffmpeg --triplet x64-windows-static | ||
- name: build Release-Full | ||
env: | ||
LIBCLANG_PATH: "C:\\Program Files\\LLVM\\lib" | ||
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config" | ||
CARGO_TARGET_DIR: "..\\..\\windows" | ||
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0 | ||
VCPKG_ROOT: ${{ github.workspace }}\vcpkg | ||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | ||
run: msbuild ccextractor.sln /p:Configuration=Release-Full /p:Platform=x64 | ||
working-directory: ./windows | ||
- name: Display version information | ||
|
@@ -64,23 +75,32 @@ jobs: | |
./windows/x64/Release-Full/ccextractorwinfull.exe | ||
./windows/x64/Release-Full/*.dll | ||
build_debug: | ||
runs-on: windows-2019 | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Setup MSBuild.exe | ||
uses: microsoft/[email protected] | ||
- name: Install llvm and clang | ||
run: choco install llvm gpac | ||
- name: Setup Vcpkg | ||
id: vcpkg | ||
uses: friendlyanon/setup-vcpkg@v1 | ||
with: | ||
committish: "2023.08.09" | ||
cache-version: "3" | ||
ignore-reserve-cache-error: true | ||
msbuild-architecture: x64 | ||
- name: Install gpac | ||
run: choco install gpac --version 2.4.0 | ||
- name: Setup vcpkg | ||
run: mkdir C:\vcpkg\.cache | ||
- name: Cache vcpkg | ||
id: cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
C:\vcpkg\.cache | ||
key: vcpkg-${{ runner.os }}-${{ env.VCPKG_COMMIT }} | ||
- name: Build vcpkg | ||
run: | | ||
git clone https://github.com/microsoft/vcpkg | ||
./vcpkg/bootstrap-vcpkg.bat | ||
- name: Install dependencies | ||
run: cd vcpkg && vcpkg integrate install && vcpkg install leptonica tesseract ffmpeg --triplet x64-windows-static | ||
run: ${{ github.workspace }}/vcpkg/vcpkg.exe install --x-install-root ${{ github.workspace }}/vcpkg/installed/ | ||
working-directory: windows | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
@@ -93,10 +113,11 @@ jobs: | |
LLVM_CONFIG_PATH: "C:\\Program Files\\LLVM\\bin\\llvm-config" | ||
CARGO_TARGET_DIR: "..\\..\\windows" | ||
BINDGEN_EXTRA_CLANG_ARGS: -fmsc-version=0 | ||
VCPKG_ROOT: ${{ github.workspace }}\vcpkg | ||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | ||
run: msbuild ccextractor.sln /p:Configuration=Debug-Full /p:Platform=x64 | ||
working-directory: ./windows | ||
- name: Display version information | ||
continue-on-error: true | ||
run: ./ccextractorwinfull.exe --version | ||
working-directory: ./windows/x64/Debug-Full | ||
- uses: actions/upload-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# CCExtractor Docker image | ||
|
||
This dockerfile prepares a minimalist Docker image with CCExtractor. It compiles CCExtractor from sources following instructions from the [Compilation Guide](https://github.com/CCExtractor/ccextractor/blob/master/docs/COMPILATION.MD). | ||
|
||
You can install the latest build of this image by running `docker pull CCExtractor/ccextractor` | ||
|
||
## Build | ||
|
||
You can build the Docker image directly from the Dockerfile provided in [docker](https://github.com/CCExtractor/ccextractor/tree/master/docker) directory of CCExtractor source | ||
|
||
```bash | ||
$ git clone https://github.com/CCExtractor/ccextractor.git && cd ccextractor | ||
$ cd docker/ | ||
$ docker build -t ccextractor . | ||
``` | ||
|
||
## Usage | ||
|
||
The CCExtractor Docker image can be used in several ways, depending on your needs. | ||
|
||
```bash | ||
# General usage | ||
$ docker run ccextractor:latest <features> | ||
``` | ||
|
||
1. Process a local file & use `-o` flag | ||
|
||
To process a local video file, mount a directory containing the input file inside the container: | ||
|
||
```bash | ||
# Use `-o` to specifying output file | ||
$ docker run --rm -v $(pwd):$(pwd) -w $(pwd) ccextractor:latest input.mp4 -o output.srt | ||
|
||
# Alternatively use `--stdout` feature | ||
$ docker run --rm -v $(pwd):$(pwd) -w $(pwd) ccextractor:latest input.mp4 --stdout > output.srt | ||
``` | ||
|
||
Run this command from where your input video file is present, and change `input.mp4` & `output.srt` with the actual name of files. | ||
|
||
2. Enter an interactive environment | ||
|
||
If you need to run CCExtractor with additional options or perform other tasks within the container, you can enter an interactive environment: | ||
bash | ||
|
||
```bash | ||
$ docker run --rm -it --entrypoint='sh' ccextractor:latest | ||
``` | ||
|
||
This will start a Bash shell inside the container, allowing you to run CCExtractor commands manually or perform other operations. | ||
|
||
### Example | ||
|
||
I run help command in image built from `dockerfile` | ||
|
||
```bash | ||
$ docker build -t ccextractor . | ||
$ docker run --rm ccextractor:latest --help | ||
``` | ||
|
||
This will show the `--help` message of CCExtractor tool | ||
From there you can see all the features and flags which can be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM alpine:latest as base | ||
|
||
FROM base as builder | ||
|
||
RUN apk add --no-cache --update git curl gcc cmake glew glfw \ | ||
tesseract-ocr-dev leptonica-dev clang-dev llvm-dev make pkgconfig \ | ||
zlib-dev libpng-dev libjpeg-turbo-dev openssl-dev freetype-dev libxml2-dev | ||
|
||
RUN cd && git clone https://github.com/gpac/gpac | ||
WORKDIR root/gpac/ | ||
RUN ./configure && make && make install-lib && cd && rm -rf /root/gpac | ||
|
||
WORKDIR /root | ||
RUN git clone https://github.com/CCExtractor/ccextractor.git | ||
RUN apk add bash cargo | ||
RUN export LIB_CLANG_PATH=$(find / -name 'libclang*.so*' 2>/dev/null | grep -v 'No such file' | head -n 1 | xargs dirname) | ||
RUN cd /root/ccextractor/linux && ./pre-build.sh && ./build | ||
|
||
RUN cp /root/ccextractor/linux/ccextractor /ccextractor && rm -rf ~/ccextractor | ||
|
||
FROM base as final | ||
|
||
COPY --from=builder /lib/ld-musl-x86_64.so.1 /lib/ | ||
COPY --from=builder /usr/lib/libtesseract.so.5 /usr/lib/ | ||
COPY --from=builder /usr/lib/libleptonica.so.6 /usr/lib/ | ||
COPY --from=builder /usr/local/lib/libgpac.so.12 /usr/local/lib/ | ||
COPY --from=builder /usr/lib/libstdc++.so.6 /usr/lib/ | ||
COPY --from=builder /usr/lib/libgcc_s.so.1 /usr/lib/ | ||
COPY --from=builder /usr/lib/libgomp.so.1 /usr/lib/ | ||
COPY --from=builder /usr/lib/libpng16.so.16 /usr/lib/ | ||
COPY --from=builder /usr/lib/libjpeg.so.8 /usr/lib/ | ||
COPY --from=builder /usr/lib/libgif.so.7 /usr/lib/ | ||
COPY --from=builder /usr/lib/libtiff.so.6 /usr/lib/ | ||
COPY --from=builder /usr/lib/libwebp.so.7 /usr/lib/ | ||
COPY --from=builder /usr/lib/libwebpmux.so.3 /usr/lib/ | ||
COPY --from=builder /lib/libz.so.1 /lib/ | ||
COPY --from=builder /lib/libssl.so.3 /lib/ | ||
COPY --from=builder /lib/libcrypto.so.3 /lib/ | ||
COPY --from=builder /usr/lib/liblzma.so.5 /usr/lib/ | ||
COPY --from=builder /usr/lib/libzstd.so.1 /usr/lib/ | ||
COPY --from=builder /usr/lib/libsharpyuv.so.0 /usr/lib/ | ||
|
||
COPY --from=builder /ccextractor / | ||
|
||
ENTRYPOINT [ "/ccextractor" ] | ||
|
||
CMD [ "/ccextractor" ] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.