diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-19 21:21:23 -0700 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-02-19 21:21:23 -0700 |
commit | 1b6ea8eab1530b092d4d55bd9209a0eee5300133 (patch) | |
tree | 56615c69c4bfa90dc96dda4c6911ad450e21b3bd | |
parent | 0010869cbd08e40dd1e39af7656d707ad42a3f25 (diff) |
tidy scripts
-rw-r--r-- | libmkv/.gitignore | 11 | ||||
-rw-r--r-- | libmkv/Archive.zip | bin | 0 -> 2211849 bytes | |||
-rw-r--r-- | libmkv/Makefile | 36 | ||||
-rwxr-xr-x | libmkv/changing-resolution-gen.sh | 19 | ||||
-rw-r--r-- | libmkv/nut-generate.c (renamed from libmkv/nut-3.c) | 0 |
5 files changed, 60 insertions, 6 deletions
diff --git a/libmkv/.gitignore b/libmkv/.gitignore index bc7a3df..e64455c 100644 --- a/libmkv/.gitignore +++ b/libmkv/.gitignore @@ -1,3 +1,10 @@ -/nut-3 /nut-crc32 -*.nut + +/nut-generate +/nut-generate.nut + +/changing-resolution-cam.webm +/changing-resolution-cam.nut + +/changing-resolution-gen.* +!/changing-resolution-gen.sh diff --git a/libmkv/Archive.zip b/libmkv/Archive.zip Binary files differnew file mode 100644 index 0000000..b4415b6 --- /dev/null +++ b/libmkv/Archive.zip diff --git a/libmkv/Makefile b/libmkv/Makefile index 37b6944..a772f09 100644 --- a/libmkv/Makefile +++ b/libmkv/Makefile @@ -1,6 +1,34 @@ CFLAGS = -Wall -Werror -Wextra -all: $(patsubst %.c,%,$(wildcard *.c)) -clean: - rm -f -- $(patsubst %.c,%,$(wildcard *.c)) - rm -f -- *.avi *.mkv +all: +.PHONY: all + +.NOTINTERMEDIATE: +.DELETE_ON_ERROR: + +################################################################################ + +all: nut-crc32 + +################################################################################ + +all: nut-generate.nut +nut-generate.nut: %.nut: % + ./$< >$@ + +################################################################################ + +all: changing-resolution-cam.nut +changing-resolution-cam.nut: %.nut: %.webm + ffmpeg -y -i $< -c:v copy -an $@ +changing-resolution-cam.webm: Archive.zip + bsdtar xfO $< changing-resolution.webm >$@ +# Archive.zip is from https://github.com/OpenShot/libopenshot/issues/382 + +################################################################################ + +all: changing-resolution-gen.nut +changing-resolution-gen.nut: %.nut: %.mkv + ffmpeg -y -i $< -c:v copy $@ +changing-resolution-gen.mkv: %.mkv: %.sh + ./$< diff --git a/libmkv/changing-resolution-gen.sh b/libmkv/changing-resolution-gen.sh new file mode 100755 index 0000000..cbe637d --- /dev/null +++ b/libmkv/changing-resolution-gen.sh @@ -0,0 +1,19 @@ +name=${0##*/} +name=${name%.sh} + +rm -f -- "${name}.part1.mkv" "${name}.part2.mkv" "${name}.concat.txt" "${name}.mkv" + +# Create a 320x240 clip +ffmpeg -f lavfi -t 2 -i testsrc=r=30:s=320x240 -c:v vp8 -level 3 -pix_fmt yuv420p "${name}.part1.mkv" + +# Create a 640x480 clip +ffmpeg -f lavfi -t 2 -i testsrc=r=30:s=640x480 -c:v vp8 -level 3 -pix_fmt yuv420p "${name}.part2.mkv" + +# Create a text file with the list of files +{ + echo "file '${name}.part1.mkv'" + echo "file '${name}.part2.mkv'" +} > "${name}.concat.txt" + +# Concatenate the clips +ffmpeg -f concat -safe 0 -i "${name}.concat.txt" -c:v copy "${name}.mkv" diff --git a/libmkv/nut-3.c b/libmkv/nut-generate.c index a1270c6..a1270c6 100644 --- a/libmkv/nut-3.c +++ b/libmkv/nut-generate.c |