Skip to content

FFmpeg: Fix Intel Quick Sync Video (QSV) hardware transcoding#4382

Closed
hicasper wants to merge 1 commit into
photoprism:developfrom
hicasper:develop
Closed

FFmpeg: Fix Intel Quick Sync Video (QSV) hardware transcoding#4382
hicasper wants to merge 1 commit into
photoprism:developfrom
hicasper:develop

Conversation

@hicasper
Copy link
Copy Markdown

@hicasper hicasper commented Jul 8, 2024

When using ffmpeg 7 and intel_qsv to transcode videos, it will shows

[AVHWDeviceContext @ 0x5fd57abc2f80] No VA display found for device /dev/dri/renderD128.
Device creation failed: -22.
Failed to set value '/dev/dri/renderD128' for option 'qsv_device': Invalid argument
Error parsing global options: Invalid argument

So I remove qsv_device arg, as #1337 (comment) mentioned, let ffmpeg to decide which device to use, it works well on both ffmpeg 6 and 7


Acceptance Criteria:

  • Features and enhancements must be fully implemented so that they can be released at any time without additional work
  • Automated unit and/or acceptance tests are mandatory to ensure the changes work as expected and to reduce repetitive manual work
  • Frontend components must be responsive to work and look properly on phones, tablets, and desktop computers; you must have tested them on all major browsers and different devices
  • Documentation and translation updates should be provided if needed
  • In case you submit database-related changes, they must be tested and compatible with SQLite 3 and MariaDB 10.5.12+

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 8, 2024

CLA assistant check
All committers have signed the CLA.

@lastzero
Copy link
Copy Markdown
Member

@hicasper Thanks a lot for submitting this fix! I'm very sorry that I only noticed it now. I'll test and apply your changes once I have a test environment set up to verify that they (still) work with the current release. 🎬

@lastzero lastzero self-assigned this Mar 27, 2025
@lastzero lastzero added bug video Video Formats, Transcoding, FFmpeg, Streaming & Co labels Mar 27, 2025
@lastzero lastzero moved this to Development 🐝 in Roadmap πŸš€βœ¨ Mar 27, 2025
@lastzero lastzero changed the title FFmpeg: remove incompatible args FFmpeg: Fix Intel Quick Sync Video (QSV) hardware transcoding Mar 27, 2025
lastzero added a commit that referenced this pull request Mar 28, 2025
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Copy Markdown
Member

I've just verified that it works. However, I was only able to transcode videos on my Linux Mint host (and not in our Docker development environment), which still has ffmpeg 6.1.1 installed (the version of ffmpeg 7.0.2 I have does not support hardware transcoding).

The above commit therefore changes the ffmpeg command flags for Intel QSV as suggested, and also adds hardware transcoding tests for Intel and Nvidia.

Note that the FFmpeg docs should also be updated, as the problematic command flag is still mentioned there:

@lastzero lastzero added the resolved Implemented or no longer wanted/required label Mar 28, 2025
@lastzero
Copy link
Copy Markdown
Member

Since the changes were applied manually due to conflicts, I'm going to close this PR (instead of merging it) and then set the status to preview. Thanks again! This was very helpful.

@lastzero lastzero closed this Mar 28, 2025
@lastzero lastzero moved this from Development 🐝 to Preview 🐳 in Roadmap πŸš€βœ¨ Mar 28, 2025
@graciousgrey graciousgrey moved this from Preview 🐳 to Release 🌈 in Roadmap πŸš€βœ¨ Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

resolved Implemented or no longer wanted/required video Video Formats, Transcoding, FFmpeg, Streaming & Co

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants