FFProbe (bundled with ffmpeg)

ffprobe somefile.avi // Find duration and frame rate
ffprobe -show_streams [input_file] | grep "^nb_frames" | cut -d '=' -f 2 // Grab the total number of frames


Find the total number of frames in a video - does this work properly?
ffmpeg -i somefile.avi -vcodec copy -f rawvideo -y /dev/null 2>&1 | tr "^M" '\n' | grep '^frame=' | perl -pe 's/^frame=\s*([0-9]+)\s.*$/\1/' | tail -n 1

ffmpeg -i source.WebM -vcodec copy -f rawvideo -y /dev/null 2>&1 | tr "^M" '\n' | grep '^frame=' | perl -pe 's/^frame=\s*([0-9]+)\s.*$/\1/' | tail -n 1

Convert the video to series of snapshot images (change n\100 to number of frames / 30)
ffmpeg -i source.WebM -filter:v "select=not(mod(n\,100)),setpts=N/((24/1)*TB)" output%03d.png

Create an image from a frame at a set time in the video
ffmpeg -i input.flv -ss 00:00:14.435 -vframes 1 out.png

Create video from images
ffmpeg -framerate 2 -i output%03d.png -c:v libx264 -r 30 -pix_fmt yuv420p output.mp4

Convert mp4 to webm
ffmpeg -i input.mp4 -c:v libvpx-vp9 -b:v 1M -c:a libvorbis output.webm

Convert mov to mp4
ffmpeg -i input.mov -c:v libx264 -c:a aac -profile:v high -level:v 3.0 -r 25 -keyint_min 250 -strict experimental -b:a 96k -movflags frag_keyframe+empty_moov -vf scale=320:-1 output.mp4

Convert to fragmented mp4
ffmpeg -i non_fragmented.mp4 -movflags frag_keyframe+empty_moov fragmented.mp4

Convert folder of video to smaller version
ffmpeg -i input.mp4 -filter:v scale=960:-1 -c:a copy output.mp4


video/mp4; codecs="avc1.64001e, mp4a.40.2"
0x64 = Profile
0x00 = Profile compatibility
0x28 = Level

Obtain profile:
mp4file --dump output.mp4 | grep AVCProfileIndication

Obtain profile compatibility:
mp4file --dump output.mp4 | grep profile_compatibility

Obtain level:
mp4file --dump output.mp4 | grep AVCLevelIndication


MP4Box -add subtitle_source.srt:lang=eng destination_file.mp4 -out new_file.mp4
MP4Box -info file.mp4 // presents film info


Jpegqran entire directory:
find /the/image/path -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \;

For example:
find /path/to/images -name "*.jpg" -type f -exec jpegtran -copy none -optimize -outfile {} {} \;


Resize entire directory:
find /Users/almccann/Desktop/images -name "*.jpg" -type f -exec convert -resize 60% -quality 80 {} {} \;

Resize with set and proportional widths and height:
-resize 100x200 // width = 100, height = 200
-resize 300x// width = 300, height = proportional
-resize x300 //width = proportional, height = 300
find /Users/almccann/Desktop/images -name "*.jpg" -type f -exec convert -resize 900x -quality 100 {} {} \;