Skip to content

FFmpeg

Usage

Recording

Record video from screen and audio from microphone

ffmpeg -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0+0,0 -f alsa -ac 2 -i pulse -pix_fmt yuv420p {out}

With -i :0.0+0,0 you can specify the X11 session (0.0) and the position of the top left corner (0,0).

Merging

Concatenate and convert files

ffmpeg -i "concat:1.ogg|2.ogg" out.mp3

Cropping

ffmpeg -ss 30 -t 70 -i inputfile.mp3 outputfile.mp3
  • -ss refers to the starting time.
  • -t is the duration after the starting time to consider.

Misc

List available formats

ffmpeg -formats

Convert a file to the default settings

ffmpeg -i [input file] [output file]

Compress a video to a given size

ffmpeg -i [input] -fs [size in MB]M [output]

Tips

Video compatibility

For compatibility with common media players, use -pix_fmt yuv420p and MP4 format.