- Replaced the previous imageFormats set with a new containerFormats set to optimize ffprobe usage.
- Updated the isCudaSupportedCodec function to only probe container formats that can contain video streams, improving performance and clarity in codec detection.
These changes enhance the efficiency of the codec detection process for CUDA hardware acceleration.
- Added a new section for NVIDIA GPU hardware acceleration, including a sample docker-compose configuration.
- Clarified requirements and notes for using NVIDIA drivers and runtime.
- Improved formatting for better readability and user guidance.
These updates aim to assist users in optimizing performance with NVIDIA GPUs.
- Added detailed instructions for enabling NVIDIA GPU hardware acceleration in the deployment section.
- Updated environment variable documentation to clarify usage and options for hardware acceleration.
- Improved overall formatting and structure for better readability.
These changes enhance the clarity of the README, making it easier for users to configure and deploy the application effectively.
- Adjusted formatting of callback responses in the ffmpeg test file for better readability.
- Ensured consistent indentation and line breaks for JSON strings in mock responses.
This enhances code clarity and maintainability in the test suite.
- Check both preferHardware AND gpuAvailable before using NVENC codecs (h264_nvenc, hevc_nvenc)
- Check gpuAvailable before adding CUDA hwaccel flag for input decoding
- Fix test assertion to check correct call index for CUDA hwaccel verification
This prevents hardware acceleration attempts when GPU is unavailable, addressing code review feedback.
- Add `checkNvidiaGpuAvailable()` function using nvidia-smi to detect GPU presence
- Add comprehensive logging for hardware acceleration decisions:
- GPU detection status
- Hardware vs software encoding/decoding choices
- CUDA codec support detection
- Encoder selection decisions
- Cache GPU availability results to avoid repeated checks
- Add `resetNvidiaGpuCache()` for testing
- Update tests to handle GPU availability mocking
This provides visibility into hardware acceleration decisions and ensures CUDA is only attempted when NVIDIA GPU hardware is actually available.
- Detect video codec using ffprobe instead of file extensions
- Auto-enable CUDA hwaccel for supported codecs when FFMPEG_PREFER_HARDWARE=true
- Skip probing for image formats to optimize performance
- Add comprehensive tests for hardware acceleration logic
Add FFMPEG_PREFER_HARDWARE env var to enable hardware acceleration
Use h264_nvenc and hevc_nvenc encoders when hardware preferred
Fall back to software encoders (libx264/libx265) when disabled
Add comprehensive tests for hardware/software encoding modes
Update README with new environment variable documentation
This enables GPU-accelerated video encoding for better performance on systems with NVIDIA GPUs.