summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorschnusch <schnusch@users.noreply.github.com>2022-02-20 14:58:02 +0100
committerProfpatsch <mail@profpatsch.de>2022-03-16 00:18:03 +0100
commit3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a (patch)
tree7ec7e2215cb21ef39cc4c9453a32e0e3bf475e1a /pkgs
parentac8008779d2de87caee7c1fa8975731d371cb734 (diff)
downloadnixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar
nixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.gz
nixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.bz2
nixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.lz
nixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.xz
nixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.zst
nixpkgs-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.zip
mpvScripts.vr-reversal: init at 1.1
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/video/mpv/scripts/vr-reversal.nix35
-rw-r--r--pkgs/top-level/all-packages.nix1
2 files changed, 36 insertions, 0 deletions
diff --git a/pkgs/applications/video/mpv/scripts/vr-reversal.nix b/pkgs/applications/video/mpv/scripts/vr-reversal.nix
new file mode 100644
index 00000000000..4c4aacef31d
--- /dev/null
+++ b/pkgs/applications/video/mpv/scripts/vr-reversal.nix
@@ -0,0 +1,35 @@
+{ lib, stdenvNoCC, fetchFromGitHub, ffmpeg }:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "vr-reversal";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "dfaker";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1wn2ngcvn7wcsl3kmj782x5q9130qw951lj6ilrkafp6q6zscpqr";
+  };
+
+  dontBuild = true;
+
+  # reset_rot is only available in ffmpeg 5.0, see 5bcc61ce87922ecccaaa0bd303a7e195929859a8
+  postPatch = lib.optionalString (lib.versionOlder ffmpeg.version "5.0") ''
+    substituteInPlace 360plugin.lua --replace ":reset_rot=1:" ":"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/mpv/scripts
+    cp -r 360plugin.lua $out/share/mpv/scripts/
+  '';
+
+  passthru.scriptName = "360plugin.lua";
+
+  meta = with lib; {
+    description = "Script for mpv to play VR video with optional saving of head tracking data.";
+    homepage = "https://github.com/dfaker/VR-reversal";
+    license = licenses.unlicense;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ schnusch ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 09c1ba6d9b3..68f51ad97c0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -27704,6 +27704,7 @@ with pkgs;
     simple-mpv-webui = callPackage ../applications/video/mpv/scripts/simple-mpv-webui.nix {};
     sponsorblock = callPackage ../applications/video/mpv/scripts/sponsorblock.nix {};
     thumbnail = callPackage ../applications/video/mpv/scripts/thumbnail.nix { };
+    vr-reversal = callPackage ../applications/video/mpv/scripts/vr-reversal.nix {};
     youtube-quality = callPackage ../applications/video/mpv/scripts/youtube-quality.nix { };
     cutter = callPackage ../applications/video/mpv/scripts/cutter.nix { };
   };