From 270c603bd282ed14a38c7ff005426a574141f584 Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Thu, 8 Jan 2026 04:09:42 +0530 Subject: [PATCH 1/8] ci(snap): add GitHub Actions workflow for Snapcraft-based builds --- .github/workflows/build_snap.yml | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/build_snap.yml diff --git a/.github/workflows/build_snap.yml b/.github/workflows/build_snap.yml new file mode 100644 index 000000000..7fc5f4df4 --- /dev/null +++ b/.github/workflows/build_snap.yml @@ -0,0 +1,44 @@ +name: Build CCExtractor Snap + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + build_snap: + name: Build Snap package + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repository + uses: actions/checkout@v6 + + - name: Install Snapcraft + run: | + sudo apt update + sudo apt install -y snapd + sudo snap install core22 + sudo snap install snapcraft --classic + + - name: Show Snapcraft version + run: snapcraft --version + + - name: Build snap + run: | + snapcraft --destructive-mode + + - name: List generated snap + run: ls -lh *.snap + + - name: Upload snap as workflow artifact + uses: actions/upload-artifact@v6 + with: + name: CCExtractor Snap + path: "*.snap" + + - name: Upload snap to GitHub Release + if: github.event_name == 'release' + uses: softprops/action-gh-release@v2 + with: + files: "*.snap" From 64ee63a56043c508542581408e29b7416aa20689 Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Thu, 8 Jan 2026 04:42:26 +0530 Subject: [PATCH 2/8] ci(snap): enable push trigger for snap workflow (temporary) --- .github/workflows/build_snap.yml | 16 +++++- snap/local/run-ccextractor.sh | 10 ++++ snap/snapcraft.yaml | 98 ++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 3 deletions(-) create mode 100755 snap/local/run-ccextractor.sh create mode 100644 snap/snapcraft.yaml diff --git a/.github/workflows/build_snap.yml b/.github/workflows/build_snap.yml index 7fc5f4df4..183782132 100644 --- a/.github/workflows/build_snap.yml +++ b/.github/workflows/build_snap.yml @@ -2,6 +2,9 @@ name: Build CCExtractor Snap on: workflow_dispatch: + push: + branches: + - wip/snap-cmake-refactor release: types: [published] @@ -14,10 +17,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 - - name: Install Snapcraft + - name: Install snapd run: | sudo apt update sudo apt install -y snapd + + - name: Start snapd + run: | + sudo systemctl start snapd.socket + sudo systemctl start snapd + + - name: Install Snapcraft + run: | sudo snap install core22 sudo snap install snapcraft --classic @@ -25,8 +36,7 @@ jobs: run: snapcraft --version - name: Build snap - run: | - snapcraft --destructive-mode + run: sudo snapcraft --destructive-mode - name: List generated snap run: ls -lh *.snap diff --git a/snap/local/run-ccextractor.sh b/snap/local/run-ccextractor.sh new file mode 100755 index 000000000..1fca25444 --- /dev/null +++ b/snap/local/run-ccextractor.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +export LD_LIBRARY_PATH="$SNAP/usr/lib/x86_64-linux-gnu:\ +$SNAP/usr/lib/x86_64-linux-gnu/blas:\ +$SNAP/usr/lib/x86_64-linux-gnu/lapack:\ +$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio:\ +${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + +exec "$SNAP/usr/local/bin/ccextractor" "$@" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml new file mode 100644 index 000000000..d3a63bade --- /dev/null +++ b/snap/snapcraft.yaml @@ -0,0 +1,98 @@ +name: ccextractor +base: core22 +version: git +summary: Closed Caption Extractor +description: | + CCExtractor is a tool for extracting closed captions from video files. + +confinement: classic + +apps: + ccextractor: + command: usr/local/bin/ccextractor + command-chain: + - local/run-ccextractor.sh + plugs: + - home + +parts: + ccextractor: + plugin: cmake + source: . + source-subdir: src + + build-snaps: + - cmake/latest/stable + - rustup/latest/stable + + build-packages: + - build-essential + - pkg-config + - clang + - llvm-dev + - libclang-dev + - libzvbi-dev + - libgpac-dev + - libtesseract-dev + - libavcodec-dev + - libavformat-dev + - libavdevice-dev + - libavfilter-dev + - libswscale-dev + - libx11-dev + - libxcb1-dev + - libxcb-shm0-dev + - libpng-dev + - zlib1g-dev + # NEW — math libs required by FFmpeg / gpac + - libblas3 + - liblapack3 + + + stage-packages: + # Core deps + - libgpac11 + - libzvbi0 + - libfreetype6 + - libpng16-16 + - libprotobuf-c1 + - libutf8proc2 + + # OpenGL / X11 + - libgl1 + - libglu1-mesa + + # FFmpeg stack + - libavcodec58 + - libavformat58 + - libavutil56 + - libavdevice58 + - libavfilter7 + - libswscale5 + + # Audio / video codecs + - libjpeg-turbo8 + - libvorbis0a + - libtheora0 + - libxvidcore4 + - libfaad2 + - libmad0 + - liba52-0.7.4 + + # PulseAudio (already proven needed) + - libpulse0 + - pulseaudio-utils + + override-build: | + set -eux + + rustup toolchain install stable + rustup default stable + export PATH="$HOME/.cargo/bin:$PATH" + + snapcraftctl build + + # Install runtime wrapper for command-chain + install -D -m 0755 \ + $SNAPCRAFT_PROJECT_DIR/snap/local/run-ccextractor.sh \ + $SNAPCRAFT_PART_INSTALL/local/run-ccextractor.sh From 504877b928eb7a6ec06f26156a50936f4b7d46d5 Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Thu, 8 Jan 2026 05:31:36 +0530 Subject: [PATCH 3/8] ci(snap): remove temporary push trigger --- .github/workflows/build_snap.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build_snap.yml b/.github/workflows/build_snap.yml index 183782132..757123794 100644 --- a/.github/workflows/build_snap.yml +++ b/.github/workflows/build_snap.yml @@ -2,9 +2,6 @@ name: Build CCExtractor Snap on: workflow_dispatch: - push: - branches: - - wip/snap-cmake-refactor release: types: [published] From 05adb5f47e06f2a7854d451a1e317e326dd44680 Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Thu, 8 Jan 2026 05:40:50 +0530 Subject: [PATCH 4/8] snap: add website and source-code metadata --- snap/local/run-ccextractor.sh | 2 ++ snap/snapcraft.yaml | 12 ++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/snap/local/run-ccextractor.sh b/snap/local/run-ccextractor.sh index 1fca25444..658ca2e15 100755 --- a/snap/local/run-ccextractor.sh +++ b/snap/local/run-ccextractor.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e +# Ensure runtime resolution of bundled libraries (FFmpeg / GPAC / PulseAudio) + export LD_LIBRARY_PATH="$SNAP/usr/lib/x86_64-linux-gnu:\ $SNAP/usr/lib/x86_64-linux-gnu/blas:\ $SNAP/usr/lib/x86_64-linux-gnu/lapack:\ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index d3a63bade..571dc7b9d 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -4,6 +4,8 @@ version: git summary: Closed Caption Extractor description: | CCExtractor is a tool for extracting closed captions from video files. +website: https://www.ccextractor.org +source-code: https://github.com/CCExtractor/ccextractor confinement: classic @@ -44,33 +46,25 @@ parts: - libxcb-shm0-dev - libpng-dev - zlib1g-dev - # NEW — math libs required by FFmpeg / gpac - libblas3 - liblapack3 stage-packages: - # Core deps - libgpac11 - libzvbi0 - libfreetype6 - libpng16-16 - libprotobuf-c1 - libutf8proc2 - - # OpenGL / X11 - libgl1 - libglu1-mesa - - # FFmpeg stack - libavcodec58 - libavformat58 - libavutil56 - libavdevice58 - libavfilter7 - libswscale5 - - # Audio / video codecs - libjpeg-turbo8 - libvorbis0a - libtheora0 @@ -78,8 +72,6 @@ parts: - libfaad2 - libmad0 - liba52-0.7.4 - - # PulseAudio (already proven needed) - libpulse0 - pulseaudio-utils From 643857e98f286441a4048ec64c07b9306f7b5e26 Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Thu, 8 Jan 2026 05:49:55 +0530 Subject: [PATCH 5/8] docs: add changelog entry for Snap packaging --- docs/CHANGES.TXT | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 5e37a7913..8103f9538 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -1,5 +1,6 @@ 0.96.5 (2026-01-05) ------------------- +- New: Added Snap packaging support with Snapcraft configuration and GitHub Actions CI workflow. - New: Add support for raw CDP (Caption Distribution Packet) files (#1406) - New: Add --scc-accurate-timing option for bandwidth-aware SCC output (#1120) - Fix: MXF files containing CEA-708 captions not being detected/extracted (#1647) From 493495361dafb111d40388cb0093a211fde3c7bc Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Thu, 8 Jan 2026 09:06:49 +0530 Subject: [PATCH 6/8] ci(snap): use stable GitHub Actions v6 and make runtime library resolution robust --- docs/CHANGES.TXT | 2 +- snap/local/run-ccextractor.sh | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index 8103f9538..f5a603da0 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -1,6 +1,6 @@ 0.96.5 (2026-01-05) ------------------- -- New: Added Snap packaging support with Snapcraft configuration and GitHub Actions CI workflow. +- New: Add Snap packaging support with Snapcraft configuration and GitHub Actions CI workflow. - New: Add support for raw CDP (Caption Distribution Packet) files (#1406) - New: Add --scc-accurate-timing option for bandwidth-aware SCC output (#1120) - Fix: MXF files containing CEA-708 captions not being detected/extracted (#1647) diff --git a/snap/local/run-ccextractor.sh b/snap/local/run-ccextractor.sh index 658ca2e15..0e4653621 100755 --- a/snap/local/run-ccextractor.sh +++ b/snap/local/run-ccextractor.sh @@ -1,12 +1,21 @@ #!/bin/sh set -e -# Ensure runtime resolution of bundled libraries (FFmpeg / GPAC / PulseAudio) +# Default fallback +LIB_TRIPLET="x86_64-linux-gnu" -export LD_LIBRARY_PATH="$SNAP/usr/lib/x86_64-linux-gnu:\ -$SNAP/usr/lib/x86_64-linux-gnu/blas:\ -$SNAP/usr/lib/x86_64-linux-gnu/lapack:\ -$SNAP/usr/lib/x86_64-linux-gnu/pulseaudio:\ +# Detect multiarch directory if present +for d in "$SNAP/usr/lib/"*-linux-gnu; do + if [ -d "$d" ]; then + LIB_TRIPLET=$(basename "$d") + break + fi +done + +export LD_LIBRARY_PATH="$SNAP/usr/lib/$LIB_TRIPLET:\ +$SNAP/usr/lib/$LIB_TRIPLET/blas:\ +$SNAP/usr/lib/$LIB_TRIPLET/lapack:\ +$SNAP/usr/lib/$LIB_TRIPLET/pulseaudio:\ ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" exec "$SNAP/usr/local/bin/ccextractor" "$@" From 5e6aab89729ad2e3c04b109b934f230aca309f46 Mon Sep 17 00:00:00 2001 From: Chandragupt Date: Sun, 11 Jan 2026 01:10:29 +0530 Subject: [PATCH 7/8] fix(snap): drop snap-injected command argument in runtime wrapper --- snap/local/run-ccextractor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/local/run-ccextractor.sh b/snap/local/run-ccextractor.sh index 0e4653621..d97953d51 100755 --- a/snap/local/run-ccextractor.sh +++ b/snap/local/run-ccextractor.sh @@ -17,5 +17,5 @@ $SNAP/usr/lib/$LIB_TRIPLET/blas:\ $SNAP/usr/lib/$LIB_TRIPLET/lapack:\ $SNAP/usr/lib/$LIB_TRIPLET/pulseaudio:\ ${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" - +shift exec "$SNAP/usr/local/bin/ccextractor" "$@" From 09f21f64e4502f573b398a2c6bf75b78ccddfb4b Mon Sep 17 00:00:00 2001 From: Chandragupt Singh Date: Fri, 23 Jan 2026 15:23:33 +0530 Subject: [PATCH 8/8] fix(snap): resolve GPAC dependency and runtime issues in core22 snap --- docs/CHANGES.TXT | 11 +++++++++- snap/local/run-ccextractor.sh | 8 +++---- snap/snapcraft.yaml | 40 +++++++++++++++++++++++------------ 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/docs/CHANGES.TXT b/docs/CHANGES.TXT index f5a603da0..f30d9d7bc 100644 --- a/docs/CHANGES.TXT +++ b/docs/CHANGES.TXT @@ -1,6 +1,15 @@ -0.96.5 (2026-01-05) +0.96.6 (unreleased) ------------------- - New: Add Snap packaging support with Snapcraft configuration and GitHub Actions CI workflow. +- Fix: Clear status line output on Linux/WSL to prevent text artifacts (#2017) +- Fix: Prevent infinite loop on truncated MKV files +- Fix: Various memory safety and stability fixes in demuxers (MP4, PS, MKV, DVB) +- Fix: Delete empty output files instead of leaving 0-byte files (#1282) +- Fix: --mkvlang now supports BCP 47 language tags (e.g., en-US, zh-Hans-CN) and multiple codes + +0.96.5 (2026-01-05) +------------------- +- New: CCExtractor is available again via Homebrew on macOS and Linux. - New: Add support for raw CDP (Caption Distribution Packet) files (#1406) - New: Add --scc-accurate-timing option for bandwidth-aware SCC output (#1120) - Fix: MXF files containing CEA-708 captions not being detected/extracted (#1647) diff --git a/snap/local/run-ccextractor.sh b/snap/local/run-ccextractor.sh index d97953d51..e318a16b2 100755 --- a/snap/local/run-ccextractor.sh +++ b/snap/local/run-ccextractor.sh @@ -1,9 +1,7 @@ #!/bin/sh set -e - -# Default fallback +# Default fallback LIB_TRIPLET="x86_64-linux-gnu" - # Detect multiarch directory if present for d in "$SNAP/usr/lib/"*-linux-gnu; do if [ -d "$d" ]; then @@ -11,8 +9,8 @@ for d in "$SNAP/usr/lib/"*-linux-gnu; do break fi done - -export LD_LIBRARY_PATH="$SNAP/usr/lib/$LIB_TRIPLET:\ +export LD_LIBRARY_PATH="$SNAP/usr/lib:\ +$SNAP/usr/lib/$LIB_TRIPLET:\ $SNAP/usr/lib/$LIB_TRIPLET/blas:\ $SNAP/usr/lib/$LIB_TRIPLET/lapack:\ $SNAP/usr/lib/$LIB_TRIPLET/pulseaudio:\ diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 571dc7b9d..f124e1226 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,12 +1,11 @@ name: ccextractor base: core22 -version: git +version: '0.96.5' summary: Closed Caption Extractor description: | CCExtractor is a tool for extracting closed captions from video files. website: https://www.ccextractor.org source-code: https://github.com/CCExtractor/ccextractor - confinement: classic apps: @@ -18,15 +17,39 @@ apps: - home parts: + gpac: + plugin: make + source: https://github.com/gpac/gpac.git + source-tag: abi-16.4 + build-packages: + - build-essential + - pkg-config + - zlib1g-dev + - libssl-dev + - libfreetype6-dev + - libjpeg-dev + - libpng-dev + override-build: | + set -eux + ./configure --prefix=/usr + make -j$(nproc) + make DESTDIR=$SNAPCRAFT_PART_INSTALL install-lib + sed -i "s|^prefix=.*|prefix=$SNAPCRAFT_STAGE/usr|" $SNAPCRAFT_PART_INSTALL/usr/lib/pkgconfig/gpac.pc + stage: + - usr/lib/libgpac* + - usr/lib/pkgconfig/gpac.pc + - usr/include/gpac + ccextractor: + after: [gpac] plugin: cmake source: . source-subdir: src - + build-environment: + - PKG_CONFIG_PATH: "$SNAPCRAFT_STAGE/usr/lib/pkgconfig:$PKG_CONFIG_PATH" build-snaps: - cmake/latest/stable - rustup/latest/stable - build-packages: - build-essential - pkg-config @@ -34,7 +57,6 @@ parts: - llvm-dev - libclang-dev - libzvbi-dev - - libgpac-dev - libtesseract-dev - libavcodec-dev - libavformat-dev @@ -48,10 +70,7 @@ parts: - zlib1g-dev - libblas3 - liblapack3 - - stage-packages: - - libgpac11 - libzvbi0 - libfreetype6 - libpng16-16 @@ -74,17 +93,12 @@ parts: - liba52-0.7.4 - libpulse0 - pulseaudio-utils - override-build: | set -eux - rustup toolchain install stable rustup default stable export PATH="$HOME/.cargo/bin:$PATH" - snapcraftctl build - - # Install runtime wrapper for command-chain install -D -m 0755 \ $SNAPCRAFT_PROJECT_DIR/snap/local/run-ccextractor.sh \ $SNAPCRAFT_PART_INSTALL/local/run-ccextractor.sh