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

Videos: Fix installation of Intel Quick Sync drivers for hardware transcoding #2700

Closed
CDeLeon94 opened this issue Sep 13, 2022 · 11 comments
Closed
Assignees
Labels
bug Something isn't working released Available in the stable release video Video Formats, Transcoding, FFmpeg, Streaming & Co

Comments

@CDeLeon94
Copy link

CDeLeon94 commented Sep 13, 2022

1. What is not working as documented?

When attempting to playback videos, hardware accelerated transcoding is not utilized

2. How can we reproduce it?

Play a video above the transcode threshold bitrate

3. What behavior do you expect?

Video will playback quickly, utilizing the hardware acceleration, no massive CPU spike (and associated heat and fans)

4. What could be the cause of your problem?

The lack of the libmfxgen1 library seems to be the issue: blakeblackshear/frigate#3170

5. Can you provide us with example files for testing, error logs, or screenshots?

Trace level logging Error initializing an internal MFX session: unsupported (-3) brought me to the above issue.

6. Which software versions do you use?

(a) PhotoPrism Architecture & Build Number: AMD64 Build 220902-62aba3200

(b) Database Type & Version: MariaDB

(c) Operating System Types & Versions: Linux (Unraid Docker)

7. On what kind of device is PhotoPrism installed?

This is especially important if you are reporting a performance, import, or indexing issue. You can skip this if you're reporting a problem you found in our public demo, or if it's a completely unrelated issue, such as incorrect page layout.

(a) Device / Processor Type: Intel 12th Generation i3-12100

Potential Fix

In the docker containers I ran apt install libmfx-gen-dev and after I got a successful

time="2022-09-13T17:19:16-05:00" level=trace msg="/bin/ffmpeg -qsv_device /dev/dri/renderD128 -i /photoprism/originals/2021/07/20210727_205222_3F593A37.mp4 -c:a aac -vf format=rgb32 -c:v h264_qsv -vsync vfr -r 30 -b:v 75M -bitrate 75M -f mp4 -y /photoprism/storage/sidecar/2021/07/20210727_205222_3F593A37.mp4.avc"
time="2022-09-13T17:19:24-05:00" level=info msg="h264_qsv: created 20210727_205222_3F593A37.mp4.avc [7.982165846s]"

Further reading, I stumbled across other docker containers that incorporate quicksync and support for the latest intel CPUs:
https://github.com/jellyfin/jellyfin-ffmpeg/blob/jellyfin/docker-build.sh#L230-L262

https://bugs.launchpad.net/ubuntu/+source/ffmpeg/+bug/1970637

@CDeLeon94 CDeLeon94 added the bug Something isn't working label Sep 13, 2022
@graciousgrey graciousgrey added enhancement Refactoring, improvement or maintenance task and removed bug Something isn't working labels Sep 17, 2022
@lastzero
Copy link
Member

lastzero commented Nov 5, 2022

Do I understand correctly that we only need to install one additional package to make it work for you? Have you tested it with our latest release, which is now based on Ubuntu 22.04 LTS? See Release Notes and Transcoding Documentation.

@lastzero lastzero self-assigned this Nov 5, 2022
@lastzero lastzero added the waiting Impediment / blocked / waiting label Nov 5, 2022
@CDeLeon94
Copy link
Author

CDeLeon94 commented Nov 5, 2022

Do I understand correctly that we only need to install one additional package to make it work for you? Have you tested it with our latest release, which is now based on Ubuntu 22.04 LTS? See Release Notes and Transcoding Documentation.

I did this in the 220902-62aba3200 preview-ubuntu release

Edit: So install 1 additional package, and I had to map the /dev/dri/ device into the docker container

@lastzero
Copy link
Member

lastzero commented Nov 5, 2022

Is it still necessary in the latest release? I would appreciate if you can test it for us as we have limited resources and need to delay the requested changes until next year otherwise.

@CDeLeon94
Copy link
Author

Confirmed that adding libmfx-gen-dev was necessary to get h264_qsv transcode on 221105-jammy Build 221105-7a295cab4

@lastzero
Copy link
Member

lastzero commented Nov 6, 2022

Thanks! I'll add it then, unless the package size is unexpectedly huge.

@lastzero lastzero added video Video Formats, Transcoding, FFmpeg, Streaming & Co and removed waiting Impediment / blocked / waiting labels Nov 6, 2022
@lastzero
Copy link
Member

So the installed size unfortunately is 27,346.0 kB, which is too large to ship it to everyone by default. In that case, we could install it if you set PHOTOPRISM_INIT="gpu".

lastzero added a commit that referenced this issue Nov 16, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero changed the title Video: Alderlake QuickSync Transcode Support - Proposed Solution Videos: Fix installation of Intel Quick Sync drivers for hardware transcoding Nov 16, 2022
@lastzero
Copy link
Member

An updated preview build will be available for testing soon:

Make sure to also read these docs, which have been updated as well:

We hope you have a few minutes to let us know if it works so we can release this in our next update!

@lastzero lastzero added please-test Ready for acceptance test help wanted Well suited for external contributors! bug Something isn't working and removed enhancement Refactoring, improvement or maintenance task labels Nov 16, 2022
@lastzero
Copy link
Member

@CDeLeon94 Happy testing! 🎁

lastzero added a commit that referenced this issue Nov 17, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Member

We have just added a separate section about Intel Quick Sync to our documentation:

If you are not able to test our preview, we will release the changes so you can test them in production. However, I can't tell you when we will release the next update if you need changes.

@lastzero lastzero removed the help wanted Well suited for external contributors! label Nov 17, 2022
@lastzero
Copy link
Member

Released. Please read the documentation and let us know if it works as described. Thank you!

@lastzero lastzero added released Available in the stable release and removed please-test Ready for acceptance test labels Nov 17, 2022
@CDeLeon94
Copy link
Author

Yes, using your implementation via the intel target for PHOTOPRISM_INIT works as expected.

Thanks so much :-)

chain710 pushed a commit to chain710/photoprism that referenced this issue Nov 28, 2022
* merge-221118: (66 commits)
  Frontend: Update deps in package-lock.json
  Frontend: Update translations.json
  UI: Add Electra theme photoprism#2916
  MariaDB: Make version check compatible with 10.10 photoprism#2913
  Weblate: Update backend translations
  Weblate: Update frontend translations
  Backend: Upgrade golang.org/x/crypto in go.mod and go.sum
  Develop: Upgrade base image from 221116-jammy to 221117-jammy
  CI: Update "docker-develop-latest" target in Makefile
  CI: Update deploy-develop.sh script
  MariaDB: Upgrade pre-installed client from v10.6 to v10.9
  Videos: Add "intel" init target to force driver installation photoprism#2700
  Metadata: Improve data parsing and sanitization photoprism#2897
  Frontend: Update translations.json and package-lock.json
  Weblate: Update frontend translations
  Develop: Upgrade base image from 221102-jammy to 221116-jammy
  Frontend: Update translations.json
  Frontend: update options.js
  Weblate: Update frontend translations
  Weblate: Update backend translations
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Available in the stable release video Video Formats, Transcoding, FFmpeg, Streaming & Co
Projects
Status: Release 🌈
Development

No branches or pull requests

3 participants