Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Expose FFmpeg Hardware Acceleration via User-Friendly API #2394

Open
zeeshanghazanfar97 opened this issue Mar 9, 2025 · 0 comments
Labels
feature-request Request for a new feature or additional functionality.

Comments

@zeeshanghazanfar97
Copy link

Description

I’d like to propose adding a user-friendly API to expose FFmpeg’s hardware acceleration options (e.g., NVENC, VAAPI, AMF) for video encoding. Currently, the FFMPEG_VideoWriter class internally allows passing extra FFmpeg parameters via ffmpeg_params, but this is not easily accessible to users.

🔹 Proposed Changes

  • Expose hardware acceleration options in a user-friendly way, rather than requiring users to manually pass ffmpeg_params.
  • Add a use_gpu flag in write_videofile(), which automatically configures hardware acceleration if supported.
clip.write_videofile("output.mp4", use_gpu=True, gpu_backend="cuda", codec="h264_nvenc")
  • Improve documentation to guide users on available GPU-accelerated codecs.

🛠 Implementation Plan

I’ve found that FFMPEG_VideoWriter already supports passing extra FFmpeg parameters:

if ffmpeg_params is not None:
    cmd.extend(ffmpeg_params)

However, this is not well-documented or easy to use. I’d be happy to work on exposing this feature properly if the maintainers are open to it. Let me know if this aligns with MoviePy’s roadmap! 🚀

📌 References

Would love to hear your thoughts! 😊

@zeeshanghazanfar97 zeeshanghazanfar97 added the feature-request Request for a new feature or additional functionality. label Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a new feature or additional functionality.
Projects
None yet
Development

No branches or pull requests

1 participant