FFmpeg
Cut part of the video without re-encoding
Cut by start time & duration
ffmpeg -ss START -t DURATION -c copy -i in.mp4 out.mp4
where:
START: start time, e.g. 00:01:15.000 or 00:01:15 or 75 (in seconds);
DURATION: duration time, e.g. 00:01:15.000 or 75 (in seconds).
Specifying -ss before -i may be faster but not frame-accurate on older FFMPEG.
Cut by start & end time
ffmpeg -ss START -to END -c copy -i in.mp4 out.mp4
Convert audio to MP3 while leaving video intact
ffmpeg -i in.avi -acodec mp3 -vcodec copy out.avi
or re-encode all audio tracks
ffmpeg -i in.mkv -map 0 -c:a mp3 out.mkv
or (?)
ffmpeg -i in.mkv -c:v copy -c:a mp3 out.mkv
Convert video to MPEG4, audio to MP3 and ditch subtitles (for use in older hardware players)
ffmpeg -i in.mkv -acodec mp3 -sn -vcodec mpeg4 -q:v 3 out.mkv
Container conversions
Convert avi to mkv (note the -fflags +genpts to generate internal timestamps that avi is missing)
ffmpeg -fflags +genpts -i in.avi -c:v copy -c:a copy out.mkv
Edit video metadata
ffmpeg -i in.avi -metadata title="" -metadata author="" -metadata copyright="" -metadata comment="" -metadata encoder="" -acodec copy -vcodec copy out.avi
Video recording
ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0+1366 -c:v libx264 -crf 0 -preset ultrafast output.mkv
and optionally re-encode later:
ffmpeg -i input.mkv -c:v libx264 -crf 0 -preset veryslow output-smaller.mkv
Convert flac to mp3 and keep tags
ffmpeg -i input.flac -ab 320k -map_metadata 0 -id3v2_version 3 -c:v copy output.mp3
References
Capture Desktop with FFmpeg
x11grab documentation