From 4d3324bb702c186487a361bdefd173084d352531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Caetano?= Date: Tue, 5 Nov 2019 17:26:42 -0300 Subject: [PATCH] feat(Watermark): add watermark to gifs --- README.md | 1 + bin/ios-simulator-gif | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 633ee35..e3300fd 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ $ ios-simulator-gif [options] {out_file} {-- [ffmpeg options]} | -r, --rate | Framerate of the output | `6` | | -f, --format | Output format | `gif` | | -vf, --video-filter | Video filter for `ffmpeg` | `scale=320:-1` | +| --no-watermark | Remove watermark from gif | N/A | | -h, --help | Prints helper message | N/A | | -v, --version | Prints current version | N/A | diff --git a/bin/ios-simulator-gif b/bin/ios-simulator-gif index b6d647f..d9f26e5 100755 --- a/bin/ios-simulator-gif +++ b/bin/ios-simulator-gif @@ -80,7 +80,8 @@ record() { ####################### convert_gif() { echo -e "Converting and saving to ${FILE_NAME}\n" - ffmpeg -i /tmp/simulator.mov -vf $VIDEOFILTER -r $RATE -f $FORMAT -y $FILE_NAME $EXTRA &> /tmp/ffmpeg.log + WATERMARK_CMD="drawtext=text='ios-simulator-gif':x=10:y=H-th-10:fontsize=40:fontcolor=white:shadowcolor=black:shadowx=5:shadowy=5" + ffmpeg -i /tmp/simulator.mov -vf "${HIDE_WATERMARK-$WATERMARK_CMD,}${VIDEOFILTER}" -r $RATE -f $FORMAT -y $FILE_NAME $EXTRA &> /tmp/ffmpeg.log if [[ $? -eq 0 ]]; then echo -e "${GREEN}Gif saved to ${FILE_NAME}${CLEAR}" @@ -120,6 +121,10 @@ parse_args() { echo "${PKG_VERSION}" exit 0 ;; + --no-watermark) + HIDE_WATERMARK='' + shift 1 + ;; --) EXTRA="${@:2}" shift @@ -152,6 +157,7 @@ display_help() { echo " -r, --rate Framerate of the output (default: 6)" echo " -f, --format Output format (default: gif)" echo " -vf, --video-filter Video filter for ffmpeg (default: scale=320:-1)" + echo " --no-watermark Remove watermark from gif" echo " -h, --help Outputs this help message" echo " -v, --version Outputs the version number" echo