Images
- Remove EXIF with ImageMagick; rewrites file.
convert file_input.jpg -strip -sampling-factor 4:2:0 -adaptive-resize 30% -quality 85 file_output.jpg
Dealing with gifs
# Speed up video 4x
ffmpeg -i video.mp4 -vf "setpts=0.03125*PTS" video-4x.mp4
# Create GIF
# https://superuser.com/a/556031
ffmpeg -ss 0 -t 10 -i video-4x.mp4 -vf "fps=24,scale=480:-1:flags=fast_bilinear,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
# Or use a more modern format, .webm (does not work on iOS Safari)
ffmpeg -i video.mp4 -b:v 500k -crf 40 -auto-alt-ref 0 output.webm
# Convert gif to mp4
# https://unix.stackexchange.com/a/294892
ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4
Downloading from YouTube
# Downloading videos as .mp4
youtube-dl --format mp4 "https://youtube.com/..."
# Extract audio
youtube-dl -x "https://youtube.com/..."