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

ffmpeg: add new external libs added in 7.1 #348798

Merged
merged 5 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions pkgs/by-name/lc/lcevcdec/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
cmake,
copyPkgconfigItems,
fetchFromGitHub,
fmt,
git,
gitUpdater,
gtest,
lib,
makePkgconfigItem,
pkg-config,
python3,
range-v3,
rapidjson,
stdenv,
testers,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "lcevcdec";
version = "3.2.1";

outputs = [
"out"
"lib"
"dev"
];

src = fetchFromGitHub {
owner = "v-novaltd";
repo = "LCEVCdec";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-Nf0YntB1A3AH0MTXlfUHhxYbzZqeB0EH9Fe9Xrqdsts=";
};

postPatch = ''
substituteInPlace cmake/tools/version_files.py \
--replace-fail "args.git_version" '"${finalAttrs.version}"' \
--replace-fail "args.git_hash" '"${finalAttrs.src.rev}"' \
--replace-fail "args.git_date" '"1970-01-01"'
'';

env = {
includedir = "${placeholder "dev"}/include";
libdir = "${placeholder "out"}/lib";
};

pkgconfigItems = [
(makePkgconfigItem rec {
name = "lcevc_dec";
inherit (finalAttrs) version;
libs = [
"-L${variables.libdir}"
"-llcevc_dec_api"
];
libsPrivate = [
"-lpthread"
"-llcevc_dec_core"
];
cflags = [
"-I${variables.includedir}"
];
variables = {
prefix = "@dev@";
includedir = "@includedir@";
libdir = "@libdir@";
};
})
];

nativeBuildInputs = [
cmake
python3
git
pkg-config
copyPkgconfigItems
];

buildInputs = [
rapidjson
fmt
range-v3
];

cmakeFlags = [
(lib.cmakeFeature "VN_SDK_FFMPEG_LIBS_PACKAGE" "")
(lib.cmakeBool "VN_SDK_UNIT_TESTS" false)
(lib.cmakeBool "VN_SDK_SAMPLE_SOURCE" false)
];

passthru = {
updateScript = gitUpdater { };
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};

meta = {
homepage = "https://github.com/v-novaltd/LCEVCdec";
description = "MPEG-5 LCEVC Decoder";
license = lib.licenses.bsd3Clear;
pkgConfigModules = [ "lcevc_dec" ];
maintainers = with lib.maintainers; [ jopejoe1 ];
platforms = lib.platforms.all;
};
})
48 changes: 48 additions & 0 deletions pkgs/by-name/vv/vvenc/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
lib,
fetchFromGitHub,
stdenv,
gitUpdater,
testers,
cmake,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "vvenc";
version = "1.12.0";

outputs = [
"out"
"lib"
"dev"
];

src = fetchFromGitHub {
owner = "fraunhoferhhi";
repo = "vvenc";
rev = "v${finalAttrs.version}";
hash = "sha256-C7ApayhubunkXBqJ/EqntaFPn6zk8rZ9fUqg7kbhvAk=";
};

nativeBuildInputs = [ cmake ];

cmakeFlags = [
(lib.cmakeBool "VVENC_INSTALL_FULLFEATURE_APP" true)
(lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
];

passthru = {
updateScript = gitUpdater { rev-prefix = "v"; };
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};

meta = {
homepage = "https://github.com/fraunhoferhhi/vvenc";
description = "Fraunhofer Versatile Video Encoder";
license = lib.licenses.bsd3Clear;
mainProgram = "vvencapp";
pkgConfigModules = [ "libvvenc" ];
maintainers = with lib.maintainers; [ jopejoe1 ];
platforms = lib.platforms.all;
};
})
15 changes: 15 additions & 0 deletions pkgs/development/libraries/ffmpeg/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
, withJack ? withFullDeps && !stdenv.hostPlatform.isDarwin # Jack audio
, withJxl ? withFullDeps && lib.versionAtLeast version "5" # JPEG XL de/encoding
, withLadspa ? withFullDeps # LADSPA audio filtering
, withLc3 ? withFullDeps && lib.versionAtLeast version "7.1" # LC3 de/encoding
, withLcevcdec ? withFullDeps && lib.versionAtLeast version "7.1" # LCEVC decoding
, withLcms2 ? withFullDeps # ICC profile support via lcms2
, withLzma ? withHeadlessDeps # xz-utils
, withMetal ? false # Unfree and requires manual downloading of files
Expand Down Expand Up @@ -127,6 +129,7 @@
, withVpl ? false # Hardware acceleration via intel libvpl
, withVpx ? withHeadlessDeps && stdenv.buildPlatform == stdenv.hostPlatform # VP8 & VP9 de/encoding
, withVulkan ? withSmallDeps && !stdenv.hostPlatform.isDarwin
, withVvenc ? withFullDeps && lib.versionAtLeast version "7.1" # H.266/VVC encoding
, withWebp ? withHeadlessDeps # WebP encoder
, withX264 ? withHeadlessDeps && withGPL # H.264/AVC encoder
, withX265 ? withHeadlessDeps && withGPL # H.265/HEVC encoder
Expand Down Expand Up @@ -245,6 +248,7 @@
, intel-media-sdk
, ladspaH
, lame
, lcevcdec
, lcms2
, libaom
, libaribcaption
Expand All @@ -262,6 +266,7 @@
, libilbc
, libjack2
, libjxl
, liblc3
, libmodplug
, libmysofa
, libopenmpt
Expand Down Expand Up @@ -315,6 +320,7 @@
, vo-amrwbenc
, vulkan-headers
, vulkan-loader
, vvenc
, x264
, x265
, xavs
Expand Down Expand Up @@ -601,6 +607,9 @@ stdenv.mkDerivation (finalAttrs: {
(enableFeature withJxl "libjxl")
] ++ [
(enableFeature withLadspa "ladspa")
] ++ optionals (versionAtLeast version "7.1") [
(enableFeature withLc3 "liblc3")
(enableFeature withLcevcdec "liblcevc-dec")
] ++ optionals (versionAtLeast version "5.1") [
(enableFeature withLcms2 "lcms2")
] ++ [
Expand Down Expand Up @@ -665,6 +674,9 @@ stdenv.mkDerivation (finalAttrs: {
(enableFeature withVorbis "libvorbis")
(enableFeature withVpx "libvpx")
(enableFeature withVulkan "vulkan")
] ++ optionals (versionAtLeast version "7.1") [
(enableFeature withVvenc "libvvenc")
] ++ [
(enableFeature withWebp "libwebp")
(enableFeature withX264 "libx264")
(enableFeature withX265 "libx265")
Expand Down Expand Up @@ -761,6 +773,8 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals withJack [ libjack2 ]
++ optionals withJxl [ libjxl ]
++ optionals withLadspa [ ladspaH ]
++ optionals withLc3 [ liblc3 ]
++ optionals withLcevcdec [ lcevcdec ]
++ optionals withLcms2 [ lcms2 ]
++ optionals withLzma [ xz ]
++ optionals withMfx [ intel-media-sdk ]
Expand Down Expand Up @@ -808,6 +822,7 @@ stdenv.mkDerivation (finalAttrs: {
++ optionals withVpl [ libvpl ]
++ optionals withVpx [ libvpx ]
++ optionals withVulkan [ vulkan-headers vulkan-loader ]
++ optionals withVvenc [ vvenc ]
++ optionals withWebp [ libwebp ]
++ optionals withX264 [ x264 ]
++ optionals withX265 [ x265 ]
Expand Down