Skip to content

Commit

Permalink
chore: better gif and convert script
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin committed Jul 15, 2024
1 parent bafc147 commit e9fd647
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Decentralized. Poker planning. In terminal.

<!-- 765px = 3/8 of 2040 (width of the original gif) for better rendering -->
<p align="left">
<img width="765" src="docs/demo.gif">
<img width="750" src="docs/demo.gif">
</p>

[//]: # (Fancy a web version? -> https://six78.github.io/2-story-points )
Expand Down
Binary file modified docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions scripts/convert_demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ROOT_DIR="$(git rev-parse --show-toplevel)"
cd "$ROOT_DIR/docs" || { echo "Failed to navigate to repository root"; exit 1; }
rm demo.gif 2> /dev/null

# Convert script taken from: https://github.com/friedrith/productivity/blob/master/convert-video-to-gif.sh
set -e
videoFilename=$(pwd)/demo.mov
filename="${videoFilename%.*}"
tmpFilename="$filename.tmp.gif"
gifFilename="$filename.gif"

# cf https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality

filters="fps=10,scale=1000:-1:flags=lanczos,split[s0][s1];[s0]palettegen=max_colors=128[p];[s1][p]paletteuse=dither=bayer"

ffmpeg -i "$videoFilename" -vf "$filters" -c:v pam -f image2pipe - | convert -delay 10 - -loop 0 -layers optimize "$gifFilename"

osascript -e "display notification \"GIF $gifFilename generated \""

echo $gifFilename

0 comments on commit e9fd647

Please sign in to comment.