Skip to content

build: upgrade FFmpeg to 8.1 and optimize encoding performance#26

Merged
maulik-mk merged 1 commit intodevfrom
feat/ffmpeg-8.1-performance-and-hdr
Apr 13, 2026
Merged

build: upgrade FFmpeg to 8.1 and optimize encoding performance#26
maulik-mk merged 1 commit intodevfrom
feat/ffmpeg-8.1-performance-and-hdr

Conversation

@maulik-mk
Copy link
Copy Markdown
Owner

This pull request introduces significant updates to the video processing worker, focusing on upgrading FFmpeg to version 8.1, improving encoding and threading performance, clarifying and expanding domain interfaces and error handling, and enhancing the Docker build and environment configuration for better maintainability and cross-platform support.

Major upgrades and performance improvements:

  • Upgraded FFmpeg from version 7.1 to 8.1, enabling new features and better thread management. Added --enable-pthreads, --enable-swscale, and optimized build flags for improved performance. Removed the yasm dependency. [1] [2] [3] [4] [5] [6] [7]

  • Updated environment variables to fine-tune x265/x264 threading and lookahead parameters, and exposed new FFmpeg 8.1 queue sizing options (THREAD_QUEUE_SIZE, MAX_MUXING_QUEUE_SIZE). Removed X265_POOL_SIZE in favor of more granular controls. [1] [2]

Domain model and interface clarifications:

  • Expanded and documented all core domain interfaces in job.interface.ts, including JobData, AudioStreamInfo, ProbeResult, VideoRendition, TranscodeResult, VideoRepository, StorageProvider, TranscodeProvider, and ProcessVideoUseCase. Improved type safety and clarified the data flow across the pipeline. [1] [2] [3] [4] [5] [6]

  • Improved and documented custom error classes in errors.ts for better traceability and retry logic, including SourceNotFoundError, ValidationError, TranscodeError, and UploadError. [1] [2]

Codebase clarity and documentation:

  • Added or revised JSDoc comments throughout the application, especially in video.process.ts, db.ts, and adapter.ts, to clarify the purpose and flow of each class and method. [1] [2] [3] [4] [5]

Build and environment improvements:

  • Added platform-specific Docker build scripts for ARM64 and AMD64 in package.json to improve local development and cross-platform compatibility.

  • Updated environment variable validation and documentation for clarity, including support for Azure Managed Identity. [1] [2]

If you have any questions about the new FFmpeg threading parameters or the updated domain interfaces, let me know!

- build(docker): upgrade FFmpeg from 7.1 to 8.1. Optimize build with -O3 -march=x86-64-v3 CFLAGS and enable pthreads/swscale.
- perf(ffmpeg): refine x264 and x265 encoding parameters. Replace pools with lookahead threading (X265_LOOKAHEAD_THREADS, X265_RC_LOOKAHEAD), add AQ modes, and update filter scaling from lanczos to spline.
- feat(config): introduce granular environment variables for queue sizing (THREAD_QUEUE_SIZE, MAX_MUXING_QUEUE_SIZE) to prevent thread blocking during high-bitrate encodes.
- fix(hls): configure better base input args (hide banners, define threads) and correct HDR video range (PQ/HLG) / Dolby Vision detection in the master playlist.
- fix(audio): refine Atmos source detection to require 6 or more channels for compatible codecs (truehd, eac3).
- fix(runner): increase the maximum stderr logging buffer from 50kb to 100kb to handle longer running encodes securely.
- feat(azure): add support for explicit AZURE_MANAGED_IDENTITY_CLIENT_ID via configuration for Azure Storage credentials.
- chore(package): add explicit arm64 and amd64 local docker build scripts. Update tests to explicitly verify libx265 presence.
@maulik-mk maulik-mk merged commit a224fae into dev Apr 13, 2026
1 check passed
@maulik-mk maulik-mk deleted the feat/ffmpeg-8.1-performance-and-hdr branch April 13, 2026 16:39
maulik-mk added a commit that referenced this pull request Apr 13, 2026
For more details PR : #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant