From e2a199667bacc8ae7718f401486a873aed9269d9 Mon Sep 17 00:00:00 2001 From: MAULIK MK <214461757+maulik-mk@users.noreply.github.com> Date: Mon, 6 Apr 2026 12:36:38 +0530 Subject: [PATCH 1/3] fix: restrict film tune flag to libx264 to prevent encoding errors with x265 --- src/infrastructure/ffmpeg/encoding/flags.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/infrastructure/ffmpeg/encoding/flags.ts b/src/infrastructure/ffmpeg/encoding/flags.ts index eab7150..c43db5c 100644 --- a/src/infrastructure/ffmpeg/encoding/flags.ts +++ b/src/infrastructure/ffmpeg/encoding/flags.ts @@ -125,8 +125,7 @@ export function videoEncoderFlags(variant: VideoVariantMeta, sourceFrameRate?: n isHevc ? 'hvc1' : variant.videoCodecTag.substring(0, 4), '-preset', variant.preset, - '-tune', - 'film', + ...(codec === 'libx264' ? ['-tune', 'film'] : []), // hotfix/20-remove-x265-film-tune #20 ...(fpsInfo ? ['-r', fpsInfo.ffmpegFraction, '-fps_mode', 'cfr'] : []), ...(variant.profile ? ['-profile:v', variant.profile] : []), ...(variant.level ? ['-level', variant.level] : []), From c9322aad9f1ae5da48d297d42aa74681bdfc935b Mon Sep 17 00:00:00 2001 From: MAULIK MK <214461757+maulik-mk@users.noreply.github.com> Date: Mon, 6 Apr 2026 12:47:30 +0530 Subject: [PATCH 2/3] feat(ci): add minor version tagging and remove conditional build checks in CI workflow --- .github/workflows/ci.yml | 56 ++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc92793..5277fc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,18 +24,19 @@ jobs: - name: Checkout Code uses: actions/checkout@v4 - # 2. Extract Dockerfile VERSION + # 2. Extract Dockerfile VERSION and create Floating Minor Version - name: Read Dockerfile VERSION id: docker_version run: | + # Extract the exact version (e.g., "0.3.1") VERSION=$(grep -E '^ARG VERSION=' Dockerfile | cut -d '=' -f2 | tr -d '"') echo "VERSION=$VERSION" >> $GITHUB_ENV echo "Found Dockerfile VERSION=$VERSION" - if [[ "$VERSION" =~ \.0$ ]]; then - echo "IS_MAJOR_MINOR=true" >> $GITHUB_ENV - else - echo "IS_MAJOR_MINOR=false" >> $GITHUB_ENV - fi + + # Extract the minor floating version (e.g., "0.3" from "0.3.1") + MINOR_VERSION=$(echo $VERSION | cut -d. -f1,2) + echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV + echo "Floating Minor Version=$MINOR_VERSION" # 3. Set Build Date - name: Set Build Date @@ -50,35 +51,19 @@ jobs: id: docker_labels run: | echo "Extracting labels from Dockerfile..." - # Remove leading LABEL and combine into single line (multi-line support) LABELS=$(grep '^LABEL ' Dockerfile | sed 's/^LABEL //' | tr '\n' ' ') - # Replace ARG placeholders with ENV values LABELS="${LABELS//\${VERSION}/${{ env.VERSION }}}" LABELS="${LABELS//\${BUILD_DATE}/${{ env.BUILD_DATE }}}" echo "DOCKER_LABELS=$LABELS" >> $GITHUB_ENV echo "Extracted labels: $LABELS" - # 5. Check if Docker image VERSION exists in GHCR - - name: Check if Docker image VERSION exists - if: github.ref == 'refs/heads/main' && env.IS_MAJOR_MINOR == 'true' - id: check_version - run: | - EXISTING_TAG=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ - "https://ghcr.io/v2/${{ github.repository }}/tags/list" | jq -r '.tags[]?' | grep "^${{ env.VERSION }}$" || true) - echo "EXISTING_TAG=$EXISTING_TAG" >> $GITHUB_ENV - if [ "$EXISTING_TAG" = "${{ env.VERSION }}" ]; then - echo "Docker image VERSION=${{ env.VERSION }} already exists. Skipping build/push." - else - echo "Docker image VERSION=${{ env.VERSION }} is new. Will build/push." - fi - - # 6. Set up Docker Buildx + # 5. Set up Docker Buildx - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - # 7. Build Docker image (only if new VERSION) + # 6. Build Docker image - name: Build and Load Docker Image - if: github.ref == 'refs/heads/main' && env.EXISTING_TAG == '' && env.IS_MAJOR_MINOR == 'true' + if: github.ref == 'refs/heads/main' uses: docker/build-push-action@v5 with: context: . @@ -89,41 +74,44 @@ jobs: labels: ${{ env.DOCKER_LABELS }} tags: | worker-ffmpeg:${{ env.VERSION }} + worker-ffmpeg:${{ env.MINOR_VERSION }} worker-ffmpeg:latest cache-from: type=gha cache-to: type=gha,mode=max - # 8. Log in to GHCR + # 7. Log in to GHCR - name: Log in to GitHub Container Registry - if: github.ref == 'refs/heads/main' && env.EXISTING_TAG == '' && env.IS_MAJOR_MINOR == 'true' + if: github.ref == 'refs/heads/main' uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - # 9. Download Test Asset + # 8. Download Test Asset - name: Download Test Asset run: .github/scripts/download_test_video.sh - # 10. Run Test Suite + # 9. Run Test Suite - name: Run Test Suite run: .github/scripts/run_tests.sh - # 11. Push Docker image to GHCR (only if new VERSION) + # 10. Push Docker image to GHCR with all tags - name: Push to GHCR - if: github.ref == 'refs/heads/main' && env.EXISTING_TAG == '' && env.IS_MAJOR_MINOR == 'true' + if: github.ref == 'refs/heads/main' run: | IMAGE_ID=ghcr.io/${{ github.repository }} IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') - # Tag images + # Apply the exact patch tag, the floating minor tag, and the latest/sha tags docker tag worker-ffmpeg:${{ env.VERSION }} $IMAGE_ID:${{ env.VERSION }} + docker tag worker-ffmpeg:${{ env.MINOR_VERSION }} $IMAGE_ID:${{ env.MINOR_VERSION }} docker tag worker-ffmpeg:latest $IMAGE_ID:latest docker tag worker-ffmpeg:latest $IMAGE_ID:${{ github.sha }} - # Push images - echo "Pushing $IMAGE_ID:${{ env.VERSION }}" + # Push all tags to the registry + echo "Pushing $IMAGE_ID tags to GHCR..." docker push $IMAGE_ID:${{ env.VERSION }} + docker push $IMAGE_ID:${{ env.MINOR_VERSION }} docker push $IMAGE_ID:latest docker push $IMAGE_ID:${{ github.sha }} \ No newline at end of file From bfaafc65206429d8eddc7ea602276df74f4335e1 Mon Sep 17 00:00:00 2001 From: MAULIK MK <214461757+maulik-mk@users.noreply.github.com> Date: Mon, 6 Apr 2026 12:51:16 +0530 Subject: [PATCH 3/3] chore: bump version to 0.3.1 --- Dockerfile | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index abb7665..0085c53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -170,7 +170,7 @@ ENV DEBIAN_FRONTEND=noninteractive # ----------------------------------------------------------------------------- # Metadata & OCI Labels # ----------------------------------------------------------------------------- -ARG VERSION=0.3.0 +ARG VERSION=0.3.1 ARG BUILD_DATE=unknown LABEL org.opencontainers.image.title="ffmpeg-queue-worker-node" \ diff --git a/package.json b/package.json index fcc036b..56b9349 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "worker", - "version": "0.3.0", + "version": "0.3.1", "description": "FFmpeg Worker Service (TypeScript)", "repository": { "type": "git",