Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
# clang-tidy configuration for ceracoder
# clang-tidy configuration for blazarcoder
# Static analysis checks for C code

Checks: >
Expand Down
5 changes: 0 additions & 5 deletions .github/FUNDING.yml

This file was deleted.

16 changes: 8 additions & 8 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
- arch: arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout ceracoder
- name: Checkout blazarcoder
uses: actions/checkout@v4
with:
path: ceracoder
path: blazarcoder
submodules: recursive

- name: Checkout SRT (dependency)
uses: actions/checkout@v4
with:
repository: CERALIVE/srt
repository: blazarhq/srt
path: srt

- name: Install build dependencies
Expand Down Expand Up @@ -56,15 +56,15 @@ jobs:
cmake --build build -j$(nproc)
sudo cmake --install build

- name: Build ceracoder
- name: Build blazarcoder
run: |
cd ceracoder
make ceracoder
cd blazarcoder
make blazarcoder

- name: Verify binary was built
run: |
ls -la ceracoder/ceracoder
file ceracoder/ceracoder
ls -la blazarcoder/blazarcoder
file blazarcoder/blazarcoder

- name: Build Summary
run: |
Expand Down
174 changes: 94 additions & 80 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ jobs:

echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "channel=${CHANNEL}" >> $GITHUB_OUTPUT
echo "Version: ${VERSION} (Channel: ${CHANNEL})"

build:
name: Build (${{ matrix.arch }})
Expand All @@ -75,28 +74,51 @@ jobs:
- arch: arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout code
- name: Checkout blazarcoder
uses: actions/checkout@v4
with:
path: blazarcoder
submodules: recursive

- name: Checkout SRT (dependency)
uses: actions/checkout@v4
with:
repository: blazarhq/srt
path: srt

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
git \
libssl-dev \
pkg-config \
tclsh \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libsrt-dev
gstreamer1.0-plugins-base

- name: Build (${{ matrix.arch }})
- name: Build SRT
run: |
mkdir -p build-output/usr
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
cd srt
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DENABLE_APPS=OFF \
-DENABLE_BONDING=ON \
-DENABLE_ENCRYPTION=ON
cmake --build build -j$(nproc)
DESTDIR=$PWD/build-output cmake --install build
sudo cmake --install build

- name: Build blazarcoder
run: |
cd blazarcoder
make -j$(nproc)
cd ..
mkdir -p build-output/usr/bin
cp blazarcoder/blazarcoder build-output/usr/bin/

- name: Install FPM
run: |
Expand All @@ -113,45 +135,47 @@ jobs:

# Create .deb package
fpm -s dir -t deb \
-n ceracoder \
-n blazarcoder \
-v "${VERSION}" \
-a "${ARCH}" \
--description "Live video encoder with dynamic bitrate control and SRT support" \
--maintainer "CERALIVE <contact@ceralive.com>" \
--url "https://github.com/CERALIVE/ceracoder" \
--maintainer "BLAZAR <hey@blazar.one>" \
--url "https://github.com/blazarhq/blazarcoder" \
--license "GPL-3.0" \
--depends "srtla" \
--depends "gstlibuvch264src" \
--depends "libgstreamer1.0-0" \
--depends "libgstreamer-plugins-base1.0-0" \
-p "dist/ceracoder_${VERSION}_${ARCH}.deb" \
-p "dist/blazarcoder_${VERSION}_${ARCH}.deb" \
build-output/usr/=/usr/

# Create .tar.gz archive
mkdir -p tarball/ceracoder-${VERSION}
cp -r build-output/usr/* tarball/ceracoder-${VERSION}/
mkdir -p tarball/blazarcoder-${VERSION}
cp -r build-output/usr/* tarball/blazarcoder-${VERSION}/
cd tarball
tar -czvf ../dist/ceracoder_${VERSION}_${ARCH}.tar.gz ceracoder-${VERSION}
tar -czvf ../dist/blazarcoder_${VERSION}_${ARCH}.tar.gz blazarcoder-${VERSION}
cd ..

# Create checksums
cd dist
sha256sum ceracoder_${VERSION}_${ARCH}.deb > ceracoder_${VERSION}_${ARCH}.deb.sha256
sha256sum ceracoder_${VERSION}_${ARCH}.tar.gz > ceracoder_${VERSION}_${ARCH}.tar.gz.sha256
sha256sum blazarcoder_${VERSION}_${ARCH}.deb > blazarcoder_${VERSION}_${ARCH}.deb.sha256
sha256sum blazarcoder_${VERSION}_${ARCH}.tar.gz > blazarcoder_${VERSION}_${ARCH}.tar.gz.sha256

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ceracoder-${{ matrix.arch }}
name: blazarcoder-${{ matrix.arch }}
path: |
dist/*.deb
dist/*.tar.gz
dist/*.sha256

sign-and-publish:
name: Sign and Publish to R2
name: Publish to APT Repository
needs: [calculate-version, build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
Expand All @@ -161,111 +185,101 @@ jobs:
- name: Prepare dist directory
run: |
mkdir -p dist/arm64 dist/amd64 dist/release
mv artifacts/ceracoder-arm64/*.deb dist/arm64/
mv artifacts/ceracoder-amd64/*.deb dist/amd64/
cp artifacts/ceracoder-arm64/*.tar.gz dist/release/
cp artifacts/ceracoder-amd64/*.tar.gz dist/release/
cp artifacts/ceracoder-arm64/*.sha256 dist/release/
cp artifacts/ceracoder-amd64/*.sha256 dist/release/

- name: Import GPG key
run: |
echo "${{ secrets.DEB_SIGNING_KEY_B64 }}" | base64 -d | gpg --batch --import

- name: Install apt-utils
run: sudo apt-get update && sudo apt-get install -y apt-utils

- name: Generate and sign repo metadata (arm64)
run: |
cd dist/arm64
dpkg-scanpackages . > Packages
gzip -k Packages
apt-ftparchive release . > Release
gpg --batch --yes -abs -o Release.gpg Release
gpg --batch --yes --clearsign -o InRelease Release

- name: Generate and sign repo metadata (amd64)
run: |
cd dist/amd64
dpkg-scanpackages . > Packages
gzip -k Packages
apt-ftparchive release . > Release
gpg --batch --yes -abs -o Release.gpg Release
gpg --batch --yes --clearsign -o InRelease Release

- name: Install AWS CLI
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install

- name: Upload to R2
mv artifacts/blazarcoder-arm64/*.deb dist/arm64/
mv artifacts/blazarcoder-amd64/*.deb dist/amd64/
cp artifacts/blazarcoder-arm64/*.tar.gz dist/release/
cp artifacts/blazarcoder-amd64/*.tar.gz dist/release/
cp artifacts/blazarcoder-arm64/*.sha256 dist/release/
cp artifacts/blazarcoder-amd64/*.sha256 dist/release/

- name: Upload and Publish via API
env:
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
R2_BUCKET: ${{ secrets.R2_BUCKET }}
APT_REPO_URL: ${{ secrets.APT_REPO_URL }}
APT_REPO_USER: ${{ secrets.APT_REPO_USER }}
APT_REPO_PASS: ${{ secrets.APT_REPO_PASS }}
CHANNEL: ${{ needs.calculate-version.outputs.channel }}
run: |
aws configure set aws_access_key_id "$R2_ACCESS_KEY_ID"
aws configure set aws_secret_access_key "$R2_SECRET_ACCESS_KEY"

aws s3 sync dist/arm64/ "s3://$R2_BUCKET/dists/$CHANNEL/binary-arm64/" \
--endpoint-url "$R2_ENDPOINT"
aws s3 sync dist/amd64/ "s3://$R2_BUCKET/dists/$CHANNEL/binary-amd64/" \
--endpoint-url "$R2_ENDPOINT"
TEMP_DIR="${GITHUB_REPOSITORY#*/}-${GITHUB_RUN_ID}"
echo "Staging directory: $TEMP_DIR"
echo "Target Channel: $CHANNEL"

# Upload all .deb files dynamically
find dist -name "*.deb" | while read deb; do
echo "Uploading $deb..."
curl -f -s -X POST -u "${APT_REPO_USER}:${APT_REPO_PASS}" \
-F file=@"$deb" "${APT_REPO_URL}/api/files/${TEMP_DIR}"
done

# Import into the repository database
echo "Importing packages to blazar-${CHANNEL}..."
curl -f -s -X POST -u "${APT_REPO_USER}:${APT_REPO_PASS}" \
"${APT_REPO_URL}/api/repos/blazar-${CHANNEL}/file/${TEMP_DIR}"

# Publish to remote storage
echo "Publishing to remote storage..."
curl -f -s -X PUT -H 'Content-Type: application/json' \
-u "${APT_REPO_USER}:${APT_REPO_PASS}" \
--data '{"ForceOverwrite": true}' \
"${APT_REPO_URL}/api/publish/s3:r2-blazar:/${CHANNEL}"

- name: API Upload Summary
run: |
echo "## 📦 Published to APT Repository" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Channel:** \`${{ needs.calculate-version.outputs.channel }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ needs.calculate-version.outputs.version }}
name: ceracoder v${{ needs.calculate-version.outputs.version }}
name: blazarcoder v${{ needs.calculate-version.outputs.version }}
prerelease: ${{ needs.calculate-version.outputs.channel == 'beta' }}
files: |
dist/arm64/*.deb
dist/amd64/*.deb
dist/release/*.tar.gz
dist/release/*.sha256
body: |
## ceracoder v${{ needs.calculate-version.outputs.version }}
## blazarcoder v${{ needs.calculate-version.outputs.version }}

Live video encoder with dynamic bitrate control and SRT support.

### Dependency Chain
```
srt
└── srtla
└── ceracoder (this package)
└── blazarcoder (this package)
├── Depends: srtla, gstlibuvch264src
├── Depends: libgstreamer1.0-0, libgstreamer-plugins-base1.0-0
└── Used by: ceralive-device
└── Used by: blazarbox-device

gstlibuvch264src ──┘
```

### Debian Packages
| Architecture | Package |
|--------------|---------|
| ARM64 | `ceracoder_${{ needs.calculate-version.outputs.version }}_arm64.deb` |
| AMD64 | `ceracoder_${{ needs.calculate-version.outputs.version }}_amd64.deb` |
| ARM64 | `blazarcoder_${{ needs.calculate-version.outputs.version }}_arm64.deb` |
| AMD64 | `blazarcoder_${{ needs.calculate-version.outputs.version }}_amd64.deb` |

### Binary Archives
| Architecture | Archive |
|--------------|---------|
| ARM64 | `ceracoder_${{ needs.calculate-version.outputs.version }}_arm64.tar.gz` |
| AMD64 | `ceracoder_${{ needs.calculate-version.outputs.version }}_amd64.tar.gz` |
| ARM64 | `blazarcoder_${{ needs.calculate-version.outputs.version }}_arm64.tar.gz` |
| AMD64 | `blazarcoder_${{ needs.calculate-version.outputs.version }}_amd64.tar.gz` |

### Installation

**Debian/Ubuntu:**
```bash
sudo dpkg -i ceracoder_${{ needs.calculate-version.outputs.version }}_<arch>.deb
sudo dpkg -i blazarcoder_${{ needs.calculate-version.outputs.version }}_<arch>.deb
sudo apt-get install -f # Install dependencies
```

**Manual:**
```bash
tar -xzf ceracoder_${{ needs.calculate-version.outputs.version }}_<arch>.tar.gz
sudo cp -r ceracoder-${{ needs.calculate-version.outputs.version }}/* /usr/
```
tar -xzf blazarcoder_${{ needs.calculate-version.outputs.version }}_<arch>.tar.gz
sudo cp -r blazarcoder-${{ needs.calculate-version.outputs.version }}/* /usr/
```
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Install SRT library
run: |
git clone https://github.com/CERALIVE/srt.git /tmp/srt
git clone https://github.com/blazarhq/srt.git /tmp/srt
cd /tmp/srt
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Compiled binary
ceracoder
blazarcoder

# Test binaries
tests/test_balancer
Expand All @@ -19,3 +19,6 @@ tests/test_srt_live_transmit
bindings/typescript/node_modules/
bindings/typescript/dist/
bindings/typescript/*.tsbuildinfo

#MacOS
*.DS_Store
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ FROM ubuntu:latest AS build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install build-essential git libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev cmake make wget xz-utils git build-essential libssl-dev openssl -y

# CERALIVE/srt fork (up-to-date fork with BELABOX patches)
# https://github.com/CERALIVE/srt
# blazarhq/srt fork (up-to-date fork with BELABOX patches)
# https://github.com/blazarhq/srt
RUN mkdir -p /build; \
git clone https://github.com/CERALIVE/srt.git /build/srt; \
git clone https://github.com/blazarhq/srt.git /build/srt; \
cd /build/srt; \
mkdir build && cd build; \
cmake -DCMAKE_INSTALL_PREFIX=/usr ..; \
make -j$(nproc); \
make install;

WORKDIR /ceracoder
WORKDIR /blazarcoder
COPY . .

RUN mkdir -p /cera-out/usr/bin/
RUN mkdir -p /blazar-out/usr/bin/
RUN make
RUN cp ./ceracoder /cera-out/usr/bin/
RUN cp ./blazarcoder /blazar-out/usr/bin/

FROM scratch AS export
COPY --from=build /cera-out /
COPY --from=build /blazar-out /
Loading