Skip to content

Commit

Permalink
Merge remote-tracking branch 'og/master' into rust-options-module
Browse files Browse the repository at this point in the history
  • Loading branch information
prateekmedia committed Aug 9, 2024
2 parents e60b460 + 90204d4 commit a0fbd24
Show file tree
Hide file tree
Showing 59 changed files with 3,080 additions and 1,544 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:
- name: Install dependencies
run: sudo apt update && sudo apt-get install libgpac-dev libtesseract-dev
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build
run: ./build
working-directory: ./linux
Expand All @@ -38,7 +38,7 @@ jobs:
run: mkdir ./linux/artifacts
- name: Copy release artifact
run: cp ./linux/ccextractor ./linux/artifacts/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: CCExtractor Linux build
path: ./linux/artifacts
Expand All @@ -47,7 +47,7 @@ jobs:
steps:
- name: Install dependencies
run: sudo apt update && sudo apt-get install libgpac-dev
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: run autogen
run: ./autogen.sh
working-directory: ./linux
Expand All @@ -65,7 +65,7 @@ jobs:
steps:
- name: Install dependencies
run: sudo apt update && sudo apt-get install libgpac-dev
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: cmake
run: mkdir build && cd build && cmake ../src
- name: build
Expand All @@ -76,7 +76,7 @@ jobs:
cmake_ocr_hardsubx:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt update && sudo apt install libgpac-dev libtesseract-dev libavformat-dev libavdevice-dev libswscale-dev yasm
- name: cmake
Expand All @@ -94,9 +94,9 @@ jobs:
steps:
- name: Install dependencies
run: sudo apt update && sudo apt-get install libgpac-dev
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
src/rust/.cargo/registry
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
steps:
- name: Install dependencies
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: build
run: ./build.command
working-directory: ./mac
Expand All @@ -38,14 +38,14 @@ jobs:
run: mkdir ./mac/artifacts
- name: Copy release artifact
run: cp ./mac/ccextractor ./mac/artifacts/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: CCExtractor mac build
path: ./mac/artifacts
build_autoconf:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install pkg-config autoconf automake libtool gpac
- name: run autogen
Expand All @@ -63,10 +63,10 @@ jobs:
cmake:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: dependencies
run: brew install gpac
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: cmake
run: mkdir build && cd build && cmake ../src
- name: build
Expand All @@ -77,7 +77,7 @@ jobs:
cmake_ocr_hardsubx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac ffmpeg
- name: cmake
Expand All @@ -93,9 +93,9 @@ jobs:
build_rust:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
src/rust/.cargo/registry
Expand Down
77 changes: 49 additions & 28 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -22,65 +24,83 @@ on:

jobs:
build_release:
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Check out repository
uses: actions/checkout@v3
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.06.20"
cache-version: "2"
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
run: ./ccextractorwinfull.exe --version
working-directory: ./windows/x64/Release-Full
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: CCExtractor Windows Release build
path: |
./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@v3
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.06.20"
cache-version: "2"
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
Expand All @@ -93,13 +113,14 @@ 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@v3
- uses: actions/upload-artifact@v4
with:
name: CCExtractor Windows Debug build
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Format code
run: |
find src/ -type f -not -path "src/thirdparty/*" -not -path "src/lib_ccx/zvbi/*" -name '*.c' -not -path "src/GUI/icon_data.c" | xargs clang-format -i
Expand All @@ -30,9 +30,9 @@ jobs:
run:
working-directory: ./src/rust
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
src/rust/.cargo/registry
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
shell: bash
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
uses: microsoft/setup-msbuild@v2.0.0
- name: Install llvm and clang
uses: egor-tensin/setup-clang@v1
with:
Expand Down Expand Up @@ -62,20 +62,20 @@ jobs:
run: wix build -ext "$HOME\.wix\extensions\WixToolset.UI.wixext\4.0.0-preview.0\tools\WixToolset.UI.wixext.dll" -d "AppVersion=${{ steps.get_version.outputs.VERSION }}.0.0" -o CCExtractor.msi installer.wxs
working-directory: ./windows
- name: Upload as asset
uses: AButler/upload-release-assets@v2.0
uses: AButler/upload-release-assets@v3.0
with:
files: './windows/CCExtractor.msi;./windows/CCExtractor_win_portable.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}
create_linux_package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
path: ./ccextractor
- name: Create .tar.gz without git and windows folders
run: tar -pczf ./ccextractor_minimal.tar.gz --exclude "ccextractor/windows" --exclude "ccextractor/.git" ccextractor
- name: Upload as asset
uses: AButler/upload-release-assets@v2.0
uses: AButler/upload-release-assets@v3.0
with:
files: './ccextractor_minimal.tar.gz'
repo-token: ${{ secrets.GITHUB_TOKEN }}
61 changes: 61 additions & 0 deletions docker/README.md
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.
Loading

0 comments on commit a0fbd24

Please sign in to comment.