about summary refs log tree commit diff
path: root/pkgs/applications/video
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/applications/video
parentac8008779d2de87caee7c1fa8975731d371cb734 (diff)
downloadnixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar
nixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.gz
nixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.bz2
nixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.lz
nixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.xz
nixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.tar.zst
nixlib-3c1a4376acbdbd4cfc268d1ef623a1ecc4ac0f2a.zip
mpvScripts.vr-reversal: init at 1.1
Diffstat (limited to 'pkgs/applications/video')
-rw-r--r--pkgs/applications/video/mpv/scripts/vr-reversal.nix35
1 files changed, 35 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 000000000000..4c4aacef31dc
--- /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 ];
+  };
+}