diff options
author | pdp8 <pdp8@pdp8.info> | 2024-02-14 14:47:10 +0100 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2024-02-14 14:47:10 +0100 |
commit | a781fe5046c4b33cd1c860d284bd799b4ca38f2e (patch) | |
tree | db607bffafb43e650c165026834d06a1e7371c3d /Makefile | |
parent | 5df93a11a4447f31f275801c333bb2865a779377 (diff) |
picture import
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..19477c0 --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +media_dir = /srv/media + +music_dir = $(media_dir)/music +flac = $(wildcard $(music_dir)/*/*.flac) +mp3 := $(subst flac,mp3,$(flac)) + +img_dir = $(media_dir)/pictures +src_dir = $(img_dir)/src +thumb_dir = $(img_dir)/thumb +www_dir = $(img_dir)/www +img = $(wildcard $(src_dir)/*.jpeg) +img_thumb := $(subst $(src_dir), $(thumb_dir), $(subst jpeg,webp, $(img))) +img_www := $(subst $(src_dir), $(www_dir), $(subst jpeg,webp, $(img))) + +video_dir = /srv/media/videos +video_webm = $(wildcard $(video_dir)/*/*.webm) +video_mp4 := $(subst webm,mp4, $(video_webm)) +video_webp := $(subst webm,webp, $(video_webm)) +video_png := $(subst webm,png, $(video_webm)) + +climbing_dir = /srv/media/climbing +climbing_webm = $(wildcard $(climbing_dir)/*.webm) +climbing_mp4 := $(subst webm,mp4, $(climbing_webm)) +climbing_webp := $(subst webm,webp, $(climbing_webm)) + +all: music pictures videos climbing + +music: $(mp3) + +pictures: $(img_www) $(img_thumb) + +videos: $(video_mp4) $(video_webp) + +climbing: $(climbing_mp4) $(climbing_webp) + +%.mp3: %.flac + ffmpeg -i $< -ab 256k -map_metadata 0 -id3v2_version 3 $@ + +%.webp: %.webm + ffmpeg -i $< -hide_banner -loglevel error -vf thumbnail -frames:v 1 -c:v png -f image2pipe - | convert - $@ + +$(www_dir)/%.webp: $(src_dir)/%.jpeg + convert $< -resize 1536x1024 -quality 85 $@ + +$(thumb_dir)/%.webp: $(src_dir)/%.jpeg + convert $< -resize 150x100 -quality 85 $@ + +%.mp4: %.webm + ffmpeg -i $< -vf scale=1280:-2 -c:v h264 -c:a aac -b:a 128k -strict -2 -movflags faststart $@ |