Created
December 7, 2019 13:36
-
-
Save max-berman/32363328103b11bb35162254345b35fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias brewery='brew update && brew upgrade && brew cleanup' | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | |
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | |
alias python=python3 | |
alias pip="python3 -m pip" | |
alias naknick="cd $HOME/Dev/naknick.com && sudo php -S local.naknick.com:80 router.php" | |
alias playchap="cd $HOME/Dev/playchap-poc && npm run develop" | |
alias dev="cd $HOME/Dev/" | |
#https://gist.github.com/revolunet/57a84ae4353615561b0a | |
# | |
convert2instaBulk() { | |
for file in *.mp4 | |
do | |
ffmpeg -i $file -vf scale=720:720:force_original_aspect_ratio=decrease,pad=720:720:(ow-iw)/2:(oh-ih)/2:black ${file%_instagram}.mp4 | |
$file is converted | |
done | |
} | |
convert2insta(){ | |
bgcolor=${2:-black} | |
ffmpeg -i $1 -vf "scale=720:720:force_original_aspect_ratio=decrease,pad=720:720:(ow-iw)/2:(oh-ih)/2:$bgcolor" ${1}_instagram.mp4 | |
echo $1 "is converted" | |
} | |
overlayText() { # overlay videoFile TEXT 30 40 color | |
bgcolor=${5:-black} | |
x=${3:-(main_w-overlay_w)/2} | |
y=${4:-(main_h-overlay_h)/2} | |
ffmpeg -i $1 -vf "scale=720:720:force_original_aspect_ratio=decrease,pad=720:720:(ow-iw)/2:(oh-ih)/2:$bgcolor" ${1}_instagram.mp4 | |
ffmpeg -i ${1}_blurred.mp4 -i logo.png -filter_complex "overlay=$x:$y" ${1}_with_overlay.mp4 | |
} | |
blurredBg() { # overlay FILE logo-FILE 30 | |
ffmpeg -i $1 -filter_complex "[0:v]scale=720:720,boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[0:v]scale=720:720:force_original_aspect_ratio=decrease[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2[outv]" -map [outv] -map 0:a? ${1}_blurred.mp4 | |
} | |
overlay() { # overlay FILE logo-FILE 30 | |
#x=${2:-(main_w-overlay_w)/2} | |
y=${3:-(main_h-overlay_h)/2} | |
ffmpeg -i ${1} -i $2 -filter_complex "overlay=(main_w-overlay_w)/2:$y" ${1}_with_overlay.mp4 | |
} | |
video2x() { | |
ffmpeg -i $1 -vcodec h264 -an -vf "fps=60, setpts=0.50*PTS" ${1}_double-speed.mp4 | |
} | |
mov2gif() { | |
ffmpeg -i $1 -vf "fps=10,scale=320:-2:flags=lanczos,palettegen" ${1}_palette.png | |
ffmpeg -i $1 -i ${1}_palette.png -filter_complex "fps=10,scale=320:-2:lanczos[video];[video][1:v]paletteuse" ${1}.gif | |
} | |
extract() { #extract FILE 00:00:00 00:01:00 | |
from=${2:-(00:00:00} | |
to=${3:-(00:00:00} | |
ffmpeg -i $1 -ss ${from} -to ${to} ${1}_short.mp4 | |
} | |
#crop | |
#ffmpeg -i output5.mp4 -filter:v "crop=width:height:start_x:start_y" output6.mp4 | |
export ANDROID_SDK_ROOT="$HOME/Library/Android/sdk" | |
#export PATH=$PATH:$ANDROID_SDK_ROOT/emulator | |
#export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools | |
#export PATH=$PATH:$ANDROID_SDK_ROOT/tools | |
# export ANDROID_AVD_HOME="$HOME/.android/avd" | |
# export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin | |
export PATH=${PATH}:$ANDROID_SDK_ROOT/emulator:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/tools | |
#alias androidemulator="emulator -avd Nexus_5X_API_28" | |
alias reload="source $HOME/.bash_profile && source ~/.zshrc" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment