Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

System FFmpeg should be preferred over bundled ffmpeg-static on Linux for GPU hardware acceleration

Đang mở Phù hợp với người mới
#757 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@LangerSword đang làm issue này rồi.

Từ ngày 5/10/2026.

  • #1102 của @LangerSword — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
70/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
electron, typescript
Lĩnh vực
desktop-dev, performance

Hướng nghiên cứu

Cả hai hàm đều nằm trong electron/ipc/ffmpeg/binary.ts: getFfmpegBinaryPath() trả về ffmpeg-static đi kèm trước tiên, và resolveSystemFfmpegBinaryPath() chứa danh sách tìm kiếm hardcoded /opt/homebrew, /usr/local, /usr/bin. Hãy đọc tệp đó trước và lần theo những caller nào trong lớp IPC ffmpeg phụ thuộc vào đường dẫn được trả về. Triển khai Option A: trên Linux trả về binary hệ thống từ $PATH khi tìm thấy một cái, giữ bundled-first trên Windows và macOS, và mở rộng các đường dẫn tìm kiếm. Hoàn thành nghĩa là một lần chạy trên Linux phân giải FFmpeg hệ thống trong khi các bài kiểm thử phân giải binary hiện có vẫn pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem Description

On Linux (specifically Arch Linux installed via AUR recordly-bin), Recordly always uses the bundled ffmpeg-static for video encoding/rendering, ignoring the system-installed FFmpeg. This means GPU hardware encoders (VAAPI, NVENC, CUDA) are never utilized even when available on the system.

Impact: Video export is significantly slower than it should be. On my Arch Linux system with an NVIDIA GPU, exports only use software encoding (libx264), taking 3-4x longer than expected. The GPU sits idle while the CPU is pegged at 100%.


Root Cause

In electron/ipc/ffmpeg/binary.ts, getFfmpegBinaryPath() has this priority:

  1. Bundled ffmpeg-static (first priority)
  2. System FFmpeg from $PATH (fallback only)

The bundled ffmpeg-static is compiled without GPU codec support (no --enable-vaapi, --enable-nvenc, --enable-cuda-llvm, etc.). This is expected for a portable static build — but on Linux desktops with GPUs, the system FFmpeg package (e.g., extra/ffmpeg on Arch) is typically compiled with full hardware acceleration support.

Additional Concern

The resolveSystemFfmpegBinaryPath() fallback also has a hardcoded Linux search order that may miss custom installs:

const commonPaths = [
    "/opt/homebrew/bin/ffmpeg",  // macOS path
    "/usr/local/bin/ffmpeg",
    "/usr/bin/ffmpeg",
];

Suggested Fixes

Option A — Platform-aware priority (recommended):
On Linux, if a system FFmpeg is found on $PATH, prefer it over the bundled one. Windows/macOS can keep the current behavior (bundled first), since their system FFmpeg is less commonly GPU-enabled.

Option B — Encoder capability detection:
Before falling back to libx264, query the bundled FFmpeg's available encoders. If it lacks hardware encoders (h264_vaapi, h264_nvenc, hevc_vaapi, hevc_nvenc, etc.) and the system FFmpeg has them, transparently switch to system FFmpeg.

Option C — Configuration setting:
Add a user-facing setting (e.g., environment variable RECORDLY_FFMPEG_PATH or a preference toggle Prefer system FFmpeg) to allow users to force using system FFmpeg.


Environment
  • Distro: Arch Linux (via AUR: recordly-bin)
  • GPU: NVIDIA GeForce (driver 570.133.08)
  • System FFmpeg: ffmpeg 7.1 (from extra/ffmpeg, compiled with --enable-cuda-llvm, --enable-nvenc, --enable-vaapi)
  • Recordly version: latest
Ngôn ngữ chính
TypeScript
Star
32.4k
Fork
2.6k
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
21

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của webadderallorg/Recordly

Tất cả issue của webadderallorg/Recordly

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.