1INPUT_VIDEO = <please select a video file as INPUT_VIDEO>
2
3SHELL = bash
4# We need Bash's process substitution operator >()
5# because we want to convert the files back to a
6# cooked format, because raw takes a serious amount
7# of space. It is of course also possible to use
8# FIFO:s (if you know what you are doing).
9
10DRAFT = -d
11# Useful for better performance when not working
12# with colours or not caring about colours.
13
14FFMPEG_ARGS = -c:v libx264 -preset veryslow -crf 0 -pix_fmt yuv444p
15#             ↑~~~~~~~~~~~ ↑~~~~~~~~~~~~~~~ ↑~~~~~~~~~~~~~~~~~~~~~~
16#             │            │                │
17#             │            │                └──── Lossless
18#             │            │
19#             │            └──── High compression
20#             │
21#             └──── H.264, a lossless-capable codec
22
23FRAME_1 = 10
24FRAME_2 = 20
25FRAME_3 = 30
26FRAME_4 = 40
27FRAME_5 = end
28
291.mkv 2.mkv 3.mkv 4.mkv 5.mkv: $(INPUT_VIDEO)
30	framerate=$$(ffprobe -v quiet -show_streams -select_streams v - < "$(INPUT_VIDEO)" | \
31	             grep '^r_frame_rate=' | cut -d = -f 2) && \
32	../../blind-from-video -L $(DRAFT) "$(INPUT_VIDEO)" - | \
33	../../blind-split -L >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 1.mkv) $(FRAME_1) \
34	                     >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 2.mkv) $(FRAME_2) \
35	                     >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 3.mkv) $(FRAME_3) \
36	                     >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 4.mkv) $(FRAME_4) \
37	                     >(../../blind-to-video $(DRAFT) $${framerate} $(FFMPEG_ARGS) 5.mkv) $(FRAME_5)
38
39clean:
40	-rm 1.mkv 2.mkv 3.mkv 4.mkv 5.mkv
41
42.PHONY: clean
43