summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/video
diff options
context:
space:
mode:
authorErik Arvstedt <erik.arvstedt@gmail.com>2018-02-27 21:09:36 +0100
committerErik Arvstedt <erik.arvstedt@gmail.com>2018-03-01 20:30:48 +0100
commitf9f360883bd8e9c7f716f9a5fad9c8ae333f78aa (patch)
tree496883e10ea7a57b47ba538af99abda0c8e2ad44 /pkgs/tools/video
parent6a5cc4f8cc34ff3cf455a8c4814e6433391bcc98 (diff)
untrunc: init at 2018.01.13
Diffstat (limited to 'pkgs/tools/video')
-rw-r--r--pkgs/tools/video/untrunc/default.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/tools/video/untrunc/default.nix b/pkgs/tools/video/untrunc/default.nix
new file mode 100644
index 000000000000..c51c23d62f02
--- /dev/null
+++ b/pkgs/tools/video/untrunc/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, gcc, libav_12, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+ name = "untrunc-${version}";
+ version = "2018.01.13";
+
+ src = fetchFromGitHub {
+ owner = "ponchio";
+ repo = "untrunc";
+ rev = "3a2e6d0718faf06589f7b9d95c8f966348e537f7";
+ sha256 = "03ka4lr69k7mikfpcpd95smzdj62v851ididnjyps5a0j06f8087";
+ };
+
+ buildInputs = [ gcc libav_12 ];
+
+ # Untrunc uses the internal libav headers 'h264dec.h' and 'config.h'.
+ # The latter must be created through 'configure'.
+ libavConfiguredSrc = libav_12.overrideAttrs (oldAttrs: {
+ name = "libav-configured-src";
+ outputs = [ "out" ];
+ phases = [ "unpackPhase" "patchPhase" "configurePhase" "installPhase" ];
+ installPhase = "cp -r . $out";
+ });
+
+ buildCommand = ''
+ mkdir -p $out/bin
+ g++ -o $out/bin/untrunc \
+ -Wno-deprecated-declarations \
+ $src/file.cpp $src/main.cpp $src/track.cpp $src/atom.cpp $src/mp4.cpp \
+ -I$libavConfiguredSrc -lavformat -lavcodec -lavutil
+ '';
+
+ meta = with stdenv.lib; {
+ description = "Restore a damaged (truncated) mp4, m4v, mov, 3gp video from a similar, undamaged video";
+ license = licenses.gpl2;
+ homepage = https://github.com/ponchio/untrunc;
+ maintainers = [ maintainers.earvstedt ];
+ };
+}