Skip to content

Instantly share code, notes, and snippets.

#!/bin/zsh
index=0
for f in *(DN);
do
d=`date +%Y%d%m-%H%M%S`
echo "Converting $f to $d.mp4"
ffmpeg -i $f -vcodec h264 -acodec aac -strict -2 $d.mp4
((++index))
done
@outsidecontext
outsidecontext / crunch.sh
Created January 23, 2020 10:01
Convert all videos in the working directory to h264 mp4s
#!/bin/bash
files=./*
index=0
for f in $files
do
d=`date +%Y%d%m-%H%M%S`
echo "Converting $f to $d.mp4"
ffmpeg -i $f -vcodec h264 -acodec aac -strict -2 $d.mp4
((++index))
done
@outsidecontext
outsidecontext / crunch.ps1
Last active January 23, 2020 10:01
Convert all videos in the working directory to h264 mp4s
$path = $PSScriptRoot
Write-Output "In directory: "$path
$files = Get-ChildItem -Filter *.mp4
foreach ($file in $files)
{
$fileNameIn = $file.Name
$date = get-date -format "yyyy-MM-dd-HHmmss"
$fileNameOut = $date + ".mp4"
Write-Output "Converting $fileNameIn to $fileNameOut"
ffmpeg -i $fileNameIn -vcodec h264 -acodec aac -strict -2 $fileNameOut".mp4"
@outsidecontext
outsidecontext / DirectionToRotMatrix
Last active December 16, 2024 14:23
HLSL Maths Utils
float4x4 GetRotationDir(float3 direction, float3 up = float3(0, 1, 0))
{
float4x4 result;
float3 xaxis = normalize(cross(up, direction));
float3 yaxis = normalize(cross(direction, xaxis));
result._11 = xaxis.x;
result._12 = yaxis.x;
result._13 = direction.x;
result._14 = 0;
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch %1' \
--prune-empty --tag-name-filter cat -- --all
git filter-branch -f --prune-empty --tree-filter '
if [ -f .gitattributes ]; then
git rm -f .gitattributes
fi
find * -type f | while read FILE; do
while head -2 "$FILE" | grep -q "^oid sha256"; do
ref=$(cat "$FILE")
echo -n "$ref" | git lfs smudge > "$FILE"
git add "$FILE"
done
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
# Visual Studio 2015 cache directory
/.vs/
# 3D models
*.3dm filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.c4d filter=lfs diff=lfs merge=lfs -text
*.collada filter=lfs diff=lfs merge=lfs -text
*.dae filter=lfs diff=lfs merge=lfs -text
*.dxf filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.jas filter=lfs diff=lfs merge=lfs -text
#!/bin/bash
# mounts a volume over afp and syncs from local to mount
# reads in computer, username and password as args
# change {SYNC_FROM} and {SYNC_TO}
while echo $1 | grep -q ^-; do
eval $( echo $1 | sed 's/^-//' )=$2
shift
shift
@outsidecontext
outsidecontext / ffmpeg
Created December 15, 2015 15:45
Useful ffmpeg commands
# convert mov to mp4
ffmpeg -i input.mov -vcodec h264 -acodec aac -strict -2 output.mp4
# convert and resize height (width will auto scale to match input dimensions)
ffmpeg -i input.mov -vf scale=-1:height -vcodec h264 output.mp4