- OS X
- Git 2.9+
- ffmpeg
Install ffmpeg with Homebrew.
brew install ffmpegIf you don't have Homebrew, follow the official instructions of FFMPEG.
Check your git version:
git --versionIn case you don't have git or your version is outdated, either use brew install git or download the latest version from the official site.
Check if you already have any global git hooks:
git config --global core.hooksPathIf output is not empty, run
ls $(git config --global core.hooksPath)and check if there is already a file post-commit. Then follow corresponding guide below.
If you already have git hooks folder configured, skip this step. otherwise, run it:
# Create and set git hooks folder
mkdir ~/.git_hooks
git config --global core.hooksPath ~/.git_hooksThen clone the repository anywhere you want and copy the files.
git clone [email protected]:oshibka404/git-selfie-mac.git
cp git-selfie-mac/hook/* $(git config --global core.hooksPath)git clone [email protected]:oshibka404/git-selfie-mac.git
cp git-selfie-mac/hook/webcam.sh $(git config --global core.hooksPath)then open file post-commit with your favorite text editor and add this line there:
$(git config --global core.hooksPath)/webcam.shMake sure that webcam.sh and post-commit can be executed:
chmod u+x ~/.git_hooks/webcam.sh ~/.git_hooks/post-commitjust git commit ... in any repo! and see photos in ~/Pictures/Commits
ffmpeg -f concat \
-safe 0 \
-i <(for f in ~/Pictures/Commits/*.jpg; do echo "file '$f'"; done) \
-vsync vfr \
-pix_fmt yuv420p \
output.mp4ffmpeg -f concat \
-safe 0 \
-i <(for f in ~/Pictures/Commits/*.jpg; do echo "file '$f'"; done) \
-vsync vfr \
-pix_fmt bgr8 \
output.gif