build: upgrade FFmpeg to 8.1 and optimize encoding performance#26
Merged
build: upgrade FFmpeg to 8.1 and optimize encoding performance#26
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theyasmdependency. [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). RemovedX265_POOL_SIZEin favor of more granular controls. [1] [2]Domain model and interface clarifications:
Expanded and documented all core domain interfaces in
job.interface.ts, includingJobData,AudioStreamInfo,ProbeResult,VideoRendition,TranscodeResult,VideoRepository,StorageProvider,TranscodeProvider, andProcessVideoUseCase. 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.tsfor better traceability and retry logic, includingSourceNotFoundError,ValidationError,TranscodeError, andUploadError. [1] [2]Codebase clarity and documentation:
video.process.ts,db.ts, andadapter.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.jsonto 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!