nixpkgs/pkgs/applications/video/video-trimmer/default.nix
Jan Tojnar 2a3e3c7a99 video-trimmer: add missing codecs
Otherwise it will complain when trying to trim screencasts produced by GNOME Shell:

	(video-trimmer:3229521): GStreamer-Play-WARNING **: 22:37:13.327: GstPlay: scaletempo element not available. Audio pitch will not be preserved during trick modes

	(video-trimmer:3229521): VideoTrimmer-WARNING **: 22:37:13.357: src/video_preview.rs:142: Error in MediaFile: Error from element /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0: Your GStreamer installation is missing a plug-in.
	Your GStreamer installation is missing a plug-in.
	../gst/playback/gsturidecodebin.c(1027): no_more_pads_full (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0:
	no suitable plugins found:
	../gst/playback/gstdecodebin2.c(4701): gst_decode_bin_expose (): /GstPlayBin:playbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0:
	no suitable plugins found:
	Missing decoder: WebM (video/webm)
2022-10-21 22:57:17 +02:00

76 lines
1.6 KiB
Nix

{ stdenv
, lib
, fetchFromGitLab
, rustPlatform
, pkg-config
, meson
, wrapGAppsHook4
, desktop-file-utils
, blueprint-compiler
, ninja
, gtk4
, libadwaita
, gst_all_1
, ffmpeg-full
}:
stdenv.mkDerivation rec {
pname = "video-trimmer";
version = "0.8.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "YaLTeR";
repo = pname;
rev = "v${version}";
hash = "sha256-0zhQoxzU1GikYP5OwqMl34RsnefJtdZox5EuTqOFnas=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}";
hash = "sha256-kH9AfEskh7TTXF+PZwOZNWVJmnEeMJrSEEuDGyP5A5o=";
};
nativeBuildInputs = [
pkg-config
meson
wrapGAppsHook4
desktop-file-utils
blueprint-compiler
ninja
# Present here in addition to buildInputs, because meson runs
# `gtk4-update-icon-cache` during installPhase, thanks to:
# https://gitlab.gnome.org/YaLTeR/video-trimmer/-/merge_requests/12
gtk4
] ++ (with rustPlatform; [
cargoSetupHook
rust.cargo
rust.rustc
]);
buildInputs = [
gtk4
libadwaita
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good # for scaletempo and webm
gst_all_1.gst-plugins-bad
];
doCheck = true;
preFixup = ''
gappsWrapperArgs+=(
--prefix PATH : "${lib.makeBinPath [ ffmpeg-full ]}"
)
'';
meta = with lib; {
homepage = "https://gitlab.gnome.org/YaLTeR/video-trimmer";
description = "Trim videos quickly";
maintainers = with maintainers; [ doronbehar ];
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}