aboutsummaryrefslogtreecommitdiffstats
path: root/examples/split/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2017-01-14 09:08:56 +0100
committerMattias Andrée <maandree@kth.se>2017-01-14 09:08:56 +0100
commit31660ca5df7e1a906defdab36823aa8791025a61 (patch)
treedb027c279be3e73f6f7eb6e395bff778bb2aeac2 /examples/split/Makefile
parentFix blind-split and add example (diff)
downloadblind-31660ca5df7e1a906defdab36823aa8791025a61.tar.gz
blind-31660ca5df7e1a906defdab36823aa8791025a61.tar.bz2
blind-31660ca5df7e1a906defdab36823aa8791025a61.tar.xz
blind-from-video and blind-split: add -L
This, combined with blind-to-video, allows the user to split a video file by frames (rather than time as with ffmpeg) into multiple files without ever storing the video in a raw format. This is feature is important because ever short video can take a 100 GB in raw format.
Diffstat (limited to 'examples/split/Makefile')
-rw-r--r--examples/split/Makefile31
1 files changed, 17 insertions, 14 deletions
diff --git a/examples/split/Makefile b/examples/split/Makefile
index 9e434b1..2575dd6 100644
--- a/examples/split/Makefile
+++ b/examples/split/Makefile
@@ -4,15 +4,21 @@ SHELL = bash
# We need Bash's process substitution operator >()
# because we want to convert the files back to a
# cooked format, because raw takes a serious amount
-# of space.
+# of space. It is of course also possible to use
+# FIFO:s.
DRAFT = -d
# Useful for better performance when not working
# with colours or not caring about colours.
FFMPEG_ARGS = -c:v libx264 -preset veryslow -crf 0 -pix_fmt yuv444p
-
-TEMPFILE = temp.uivf
+# ↑~~~~~~~~~~~ ↑~~~~~~~~~~~~~~~ ↑~~~~~~~~~~~~~~~~~~~~~~
+# │ │ │
+# │ │ └──── Lossless
+# │ │
+# │ └──── High compression
+# │
+# └──── H.264, a lossless-capable codec
FRAME_1 = 10
FRAME_2 = 20
@@ -20,20 +26,17 @@ FRAME_3 = 30
FRAME_4 = 40
FRAME_5 = end
-1.mkv 2.mkv 3.mkv 4.mkv 5.mkv: $(TEMPFILE)
+1.mkv 2.mkv 3.mkv 4.mkv 5.mkv: $(INPUT_VIDEO)
framerate=$$(ffprobe -v quiet -show_streams -select_streams v - < "$(INPUT_VIDEO)" | \
grep '^r_frame_rate=' | cut -d = -f 2) && \
- ../../blind-split >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 1.mkv) $(FRAME_1) \
- >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 2.mkv) $(FRAME_2) \
- >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 3.mkv) $(FRAME_3) \
- >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 4.mkv) $(FRAME_4) \
- >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 5.mkv) $(FRAME_5) \
- < $(TEMPFILE)
-
-$(TEMPFILE): $(INPUT_VIDEO)
- ../../blind-from-video $(DRAFT) $(INPUT_VIDEO) $(TEMPFILE)
+ ../../blind-from-video -L $(DRAFT) "$(INPUT_VIDEO)" - | \
+ ../../blind-split -L >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 1.mkv) $(FRAME_1) \
+ >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 2.mkv) $(FRAME_2) \
+ >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 3.mkv) $(FRAME_3) \
+ >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 4.mkv) $(FRAME_4) \
+ >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 5.mkv) $(FRAME_5)
clean:
- -rm 1.mkv 2.mkv 3.mkv 4.mkv 5.mkv $(TEMPFILE)
+ -rm 1.mkv 2.mkv 3.mkv 4.mkv 5.mkv
.PHONY: clean