Commit graph

12 commits

Author SHA1 Message Date
rob_otman
947be70540 refactor: improve formatting of mock callbacks in ffmpeg tests
- 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.
2025-12-19 15:02:02 +00:00
rob_otman
00931098c1 fix: ensure GPU availability is checked before using hardware acceleration
- 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.
2025-12-17 16:05:25 -07:00
rob_otman
db3acff4f7 feat: add NVIDIA GPU availability checking and hardware acceleration logging
- 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.
2025-12-17 15:07:21 -07:00
rob_otman
f2504519f0 feat: add CUDA hardware acceleration with ffprobe codec detection
- 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
2025-12-17 14:53:20 -07:00
rob_otman
6cca431a76 feat: add NVENC hardware encoding support for FFmpeg
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.
2025-12-17 14:12:13 -07:00
Emrik Östling
df3330fdc2
fix: add FFMPEG_OUTPUT_ARGS (#470) 2025-12-14 14:12:21 +01:00
Emrik Östling
12a5580694
fix: ffmpeg args (#469) 2025-12-14 13:43:20 +01:00
Jörg Krzeslak
d994c38219 test: fix imports after eslint config changes 2025-08-11 15:09:20 +02:00
Jörg Krzeslak
9c24cf4aba test: add test case to ffmpeg.test.ts 2025-08-11 13:16:11 +02:00
Jörg Krzeslak
af68498494 test: change order of parameters in ExecFileFn type 2025-08-11 13:16:05 +02:00
Jörg Krzeslak
08a833f1cf test: add parameter options to usage of type ExecFileFn 2025-08-11 13:15:39 +02:00
Jörg Krzeslak
72b484a480 test: add unit test for ffmpeg.ts 2025-08-11 13:14:14 +02:00