aboutsummaryrefslogtreecommitdiffstats
path: root/examples/split/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'examples/split/Makefile')
-rw-r--r--examples/split/Makefile39
1 files changed, 39 insertions, 0 deletions
diff --git a/examples/split/Makefile b/examples/split/Makefile
new file mode 100644
index 0000000..9e434b1
--- /dev/null
+++ b/examples/split/Makefile
@@ -0,0 +1,39 @@
+INPUT_VIDEO = '<please select a video file as INPUT_VIDEO>'
+
+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.
+
+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
+
+FRAME_1 = 10
+FRAME_2 = 20
+FRAME_3 = 30
+FRAME_4 = 40
+FRAME_5 = end
+
+1.mkv 2.mkv 3.mkv 4.mkv 5.mkv: $(TEMPFILE)
+ 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)
+
+clean:
+ -rm 1.mkv 2.mkv 3.mkv 4.mkv 5.mkv $(TEMPFILE)
+
+.PHONY: clean