Skip to content

[staging-next] ffmpeg-5: fix Vulkan builds#218281

Merged
K900 merged 1 commit intoNixOS:staging-nextfrom
K900:ffmpeg5-vulkan-fix
Feb 25, 2023
Merged

[staging-next] ffmpeg-5: fix Vulkan builds#218281
K900 merged 1 commit intoNixOS:staging-nextfrom
K900:ffmpeg5-vulkan-fix

Conversation

@K900
Copy link
Copy Markdown
Contributor

@K900 K900 commented Feb 25, 2023

  • add vulkan-headers as a dependency
  • hack around ffmpeg using unstable VK_EXT names for extensions
  • drive-by cleanup: remove unused inherit
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

- add vulkan-headers as a dependency
- hack around ffmpeg using unstable VK_EXT names for extensions
- drive-by cleanup: remove unused inherit
@ofborg ofborg bot requested a review from Atemu February 25, 2023 16:51
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Feb 25, 2023
@K900
Copy link
Copy Markdown
Contributor Author

K900 commented Feb 25, 2023

Result of nixpkgs-review pr 218281 run on x86_64-linux 1

1 package marked as broken and skipped:
  • obs-studio-plugins.obs-hyperion
4 packages failed to build:
  • liquidsoap
  • python310Packages.dm-sonnet
  • python310Packages.tensorflow-datasets
  • python311Packages.pytmx
49 packages built:
  • MIDIVisualizer
  • arcanPackages.all-wrapped
  • arcanPackages.arcan
  • arcanPackages.arcan-wrapped
  • arcanPackages.cat9-wrapped
  • arcanPackages.durden-wrapped
  • ffmpeg-full (arcanPackages.ffmpeg ,ffmpeg_4-full)
  • arcanPackages.pipeworld-wrapped
  • arcanPackages.prio-wrapped
  • arcanPackages.xarcan
  • corrscope
  • ffmpeg_5-full
  • handbrake
  • haruna
  • imagination
  • jellyfin
  • jellyfin-ffmpeg
  • libsForQt5.kdenlive (plasma5Packages.kdenlive)
  • soundkonverter (libsForQt5.soundkonverter)
  • manim
  • media-downloader
  • megasync
  • obs-studio
  • obs-studio-plugins.droidcam-obs
  • obs-studio-plugins.input-overlay
  • obs-studio-plugins.looking-glass-obs
  • obs-studio-plugins.obs-gstreamer
  • obs-studio-plugins.obs-livesplit-one
  • obs-studio-plugins.obs-move-transition
  • obs-studio-plugins.obs-multi-rtmp
  • obs-studio-plugins.obs-nvfbc
  • obs-studio-plugins.obs-pipewire-audio-capture
  • obs-studio-plugins.obs-source-record
  • obs-studio-plugins.obs-vaapi
  • obs-studio-plugins.obs-vkcapture
  • obs-studio-plugins.wlrobs
  • olive-editor
  • printrun
  • python310Packages.moderngl-window
  • python310Packages.pydub
  • python310Packages.pyglet
  • python310Packages.pytmx
  • python311Packages.moderngl-window
  • python311Packages.pydub
  • python311Packages.pyglet
  • restream
  • sunshine
  • video-trimmer
  • webcamoid

@K900
Copy link
Copy Markdown
Contributor Author

K900 commented Feb 25, 2023

Python failures seem unrelated.

Comment on lines +345 to +348
'' + lib.optionalString withVulkan ''
# FIXME: horrible hack, remove for next release
substituteInPlace libavutil/hwcontext_vulkan.c \
--replace VK_EXT_VIDEO_DECODE VK_KHR_VIDEO_DECODE
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a patch we could backport instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not directly, there's FFmpeg/FFmpeg@eb0455d, but it doesn't apply cleanly.

@Atemu
Copy link
Copy Markdown
Member

Atemu commented Feb 25, 2023

How can I test this?

@K900
Copy link
Copy Markdown
Contributor Author

K900 commented Feb 25, 2023

Well, it didn't build before and it does now.

Copy link
Copy Markdown
Member

@fabianhjr fabianhjr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, build and ran a ffmpeg concat command.

ffmpeg -f concat -safe 0 -i [videos].txt -c copy video.mp4

ffmpeg -version          Sat 25 Feb 2023 12:45:57 PM CST
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12.2.0 (GCC)

@fabianhjr
Copy link
Copy Markdown
Member

Unrelated to this merge request but is there a blocker on switching ffmpeg from ffmpeg_4 to ffmpeg_5?

@K900 K900 merged commit 7f8086c into NixOS:staging-next Feb 25, 2023
@Atemu
Copy link
Copy Markdown
Member

Atemu commented Feb 25, 2023

@fabianhjr lots of packages that aren't compatible I imagine. Some packages even depend on features that are already deprecated in ffmpeg_4.

We'd probably need a hydra jobset and then put all newly failing packages back to ffmpeg_4.

If you're motivated to do that, go ahead!

@fabianhjr
Copy link
Copy Markdown
Member

Doing so, thanks for the context @Atemu! :3

#218309

@K900 K900 deleted the ffmpeg5-vulkan-fix branch July 27, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants