Skip to content

Instantly share code, notes, and snippets.

View saurabheights's full-sized avatar

Saurabh Khanduja saurabheights

View GitHub Profile
# Convert gif to video. The best/right way to serve GIF in today's date.
ffmpeg -f gif -i input.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -preset veryslow output.mp4
# Create a video from slideshow with framerate 1 frame per 2 seconds.
ffmpeg -framerate 1/2 -i %d_1x1.jpeg -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" output.mp4
# Encode with same video but different audio
ffmpeg -i input.mp4 -vcodec copy -acodec {mp2,mp3,aac,ac3} output-vcodec_h264-acodec_mp2.mp4
# Encode with video as h264 and audio as aac with crf

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@saurabheights
saurabheights / pre-push.sh
Created March 15, 2017 12:22 — forked from pixelhandler/pre-push.sh
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@saurabheights
saurabheights / .gitignore
Created January 28, 2017 05:35 — forked from adamgit/.gitignore
.gitignore file for Xcode4 / OS X Source projects
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.6
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#