Skip to content

Instantly share code, notes, and snippets.

@BrianPugh
Last active February 3, 2018 00:47
Show Gist options
  • Save BrianPugh/c310b5eee406cdf87c8b76bff7d11771 to your computer and use it in GitHub Desktop.
Save BrianPugh/c310b5eee406cdf87c8b76bff7d11771 to your computer and use it in GitHub Desktop.
# Recursively copy all the avi videos in some file structure to a flat folder
# Source: https://stackoverflow.com/a/1936214
find . -iname '*.avi' -exec cp \{\} ../videos/ \;
# ffmpeg convert avi to mp4
ffmpeg -i infile.avi youroutput.mp4
# Convert all avi's in a folder to mp4 with ffmpeg
# Source: https://stackoverflow.com/a/33766147
for i in *.avi; do ffmpeg -i "$i" -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "${i%.*}.mp4"; done
# Convert all avis within the structure to a mp4 at the same location
find . -iname '*.avi' -exec ffmpeg -i "{}" -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" "{}.mp4" \;
# Delete all mp4s
find . -iname '*.mp4' -exec rm -rf "{}" \;
# Give everyone access to a folder
# Source: https://www.linux.com/learn/how-manage-file-and-folder-permissions-linux
sudo chmod -R ugo+rw /DATA/SHARE
# Figure out whats taking up space limited to just your filesystem
ncdu -x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment