16 April 2017

Understanding FFMPEG's Group of Pictures (GOP) Options

Disclaimer: Most of following was originally written by thljcl and is available unedited at ffmpeg-archive.org. The following is a heavily edited version of that post.

Video Theory:

By definition, a video is a series of still images which, when shown on screen, creates the illusion of moving images. Frame rate is the frequency at which an imaging device produces unique consecutive images called frames. Frame rates may be constant (CFR) or variable (VFR).

A series of images in a sequence can be encoded into a single video file with lossless encoding (huffyuv, lagarith, x264 w/crf=0). It is possible to decode that video file back to an image sequence for editing purposes and get back the original frames. We can edit “video” frame by frame as an image sequence in image manipulation programs (Adobe Photoshop, mspaint, GIMP, ImageMagick, waifu2x), or in video editing software (Adobe Premiere, AviSynth, Sony Vegas). Editing can include modifying, adding, removing, duplicating frames and treating them as “video clips.”