From 4a0bec23f06a4e119531fb8a62c07d346116c709 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 14 Jan 2017 08:41:44 +0100 Subject: Fix blind-split and add example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- examples/.gitignore | 5 +++++ examples/split/Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 examples/.gitignore create mode 100644 examples/split/Makefile (limited to 'examples') diff --git a/examples/.gitignore b/examples/.gitignore new file mode 100644 index 0000000..9ad46d0 --- /dev/null +++ b/examples/.gitignore @@ -0,0 +1,5 @@ +*.uivf +*.mp4 +*.mkv +*.avi +*.webm 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 = '' + +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 -- cgit v1.2.3-70-g09d2