Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonzi committed Sep 12, 2018
0 parents commit fc61e7f
Show file tree
Hide file tree
Showing 24 changed files with 1,954 additions and 0 deletions.
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
DIR_SRC = ./src
DIR_OBJ = ./obj
DIR_BIN = ./bin

SRC = $(wildcard ${DIR_SRC}/*.c)
OBJ = $(patsubst %.c,${DIR_OBJ}/%.o,$(notdir ${SRC}))

CC = clang
CFLAGS = -g -pipe -O2 -Wall -Wextra -std=c99 -Wcomment -I${DIR_SRC}

TARGET = v2w

BIN_TARGET = ${DIR_BIN}/${TARGET}

${BIN_TARGET}:${OBJ}
$(CC) $(CFLAGS) $(OBJ) -o $@ -lprofiler

${DIR_OBJ}/%.o:${DIR_SRC}/%.c ${DIR_OBJ}
$(CC) $(CFLAGS) -c $< -o $@

${DIR_OBJ}:
@mkdir -p $@

${DIR_BIN}:
@mkdir -p $@

prof.txt:
@pprof --text ./bin/v2w ./test.prof > ./prof.txt

out.mp4:
@echo "Compose Video."
@ffmpeg -loglevel 0 -stats -r 24 -i ./tmp/frames_proc/v-%05d.bmp -c:v libx264 -vf fps=24 -pix_fmt yuv420p ./out_tmp.mp4
@echo "Integrate Audio."
@ffmpeg -loglevel 0 -stats -i ./out_tmp.mp4 -i ./tmp/Sample.aac -acodec copy -vcodec copy out.mp4
rm out_tmp.mp4

.PHONY:clean run

clean:
rm -f ${DIR_OBJ}/*.o
rm -rf ./tmp
rm -f out.mp4
rm -f ./tmp/Sample.aac
rm -f ${DIR_BIN}/${TARGET}

run:
@time ${BIN_TARGET}
14 changes: 14 additions & 0 deletions arch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Arch

0. Getting fps and length by calling the ffmpeg program
1. Transform video to BMP frame files by calling the ffmpeg program
2. Read one BMP file to image struct
3. Thresholding
4. Edge Detection by convolution and transform to absolute value
5. Thresholding
6. Select starting point (random for the first, and nearest for privies frame)
7. Get Route Array by doing graph traversal using depth first search
8. Adjust Route Array to fixed length using cubic Hermite interpolator
9. Loop from 2 to 8 to generate all Route Arrays for every frame
10. Merge Route Arrays to one Array
11. transform Route Array to wav file
Loading

0 comments on commit fc61e7f

Please sign in to comment.