-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (37 loc) · 963 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
all: pdf midi mp4
pdf: $(addsuffix .pdf, $(basename $(wildcard *.ly)))
midi: $(addsuffix .midi, $(basename $(wildcard *.ly)))
avi: $(addsuffix .avi, $(basename $(wildcard *.ly)))
mp3: $(addsuffix .mp3, $(basename $(wildcard *.ly)))
mp4: $(addsuffix .mp4, $(basename $(wildcard *.ly)))
%.pdf %.midi: %.ly
lilypond $<
%.avi: %.ly
ly2video \
--input $< \
--output $@ \
--fps 60 \
--quality 1
%.mp3:
youtube-dl \
--output '$(basename $@).%(ext)s' \
--extract-audio \
--audio-format mp3 \
--audio-quality 0 \
$(shell awk '/$(basename $@)/{print $$3}' videos.txt)
%.mp4: %.avi %.mp3
ffmpeg \
-y \
-itsoffset $(shell awk '/$(basename $@)/{print $$2}' videos.txt) \
-i $< \
-i $(basename $<).mp3 \
$(shell awk '/$(basename $@)/{print $$4 ? "-t "$$4" -ss "$$2 : ""}' videos.txt) \
-r 60 \
-c:v h264 \
-c:a mp3 \
-map 0:v:0 \
-map 1:a:0 \
-max_muxing_queue_size 2048 \
$@
clean:
rm -f *.pdf *.midi *.avi *.mp3 *.mp4