summaryrefslogtreecommitdiff
path: root/stylize_video.sh
diff options
context:
space:
mode:
authorcam <cameron@ideum.com>2016-10-10 19:41:23 -0600
committercam <cameron@ideum.com>2016-10-10 19:41:23 -0600
commit378cd99cd795e770b9d46ea5b8f1c1545825af54 (patch)
treec43845b292454080f9349d5fa880c27d40531574 /stylize_video.sh
parent5b3a4172bfe78eb3a93e99bc63eed33894175677 (diff)
parentab3fd036f9d781c8f8238cfc3135fd2210ca0017 (diff)
Fixed conflict in README
Diffstat (limited to 'stylize_video.sh')
-rw-r--r--stylize_video.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/stylize_video.sh b/stylize_video.sh
index 14cbd8e..5f39f89 100644
--- a/stylize_video.sh
+++ b/stylize_video.sh
@@ -45,6 +45,9 @@ style_image="$2"
style_dir=$(dirname "$style_image")
style_filename=$(basename "$style_image")
+if [ ! -d "./video_input" ]; then
+ mkdir -p ./video_input
+fi
temp_dir="./video_input/${content_filename}"
# Create output folder
@@ -56,9 +59,9 @@ eval $(ffprobe -v error -of flat=s=_ -select_streams v:0 -show_entries stream=wi
width="${streams_stream_0_width}"
height="${streams_stream_0_height}"
if [ "$width" -gt "$height" ]; then
- max_size="$width"
+ max_size="$width"
else
- max_size="$height"
+ max_size="$height"
fi
num_frames=$(find "$temp_dir" -iname "*.ppm" | wc -l)
@@ -81,4 +84,6 @@ echo "Converting image sequence to video. This should be quick..."
$FFMPEG -v quiet -i ./video_output/frame_%04d.ppm ./video_output/${content_filename}-stylized.$extension
# Clean up garbage
-rm -rf "${temp_dir}" \ No newline at end of file
+if [ -d "${temp_dir}" ]; then
+ rm -rf "${temp_dir}"
+fi