{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/codecs/video/ffv1",
  "collection": "docs",
  "title": "FFV1",
  "description": "FFV1 is a lossless video codec specified in RFC 9043 and widely used for archival masters, usually in Matroska.",
  "canonicalUrl": "https://encode.wiki/codecs/video/ffv1/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/codecs/video/ffv1.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/codecs/video/ffv1.md",
  "status": "current",
  "tags": [
    "migrated",
    "video"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "RFC 9043: FFV1 Video Coding Format Versions 0, 1, and 3",
      "url": "https://www.rfc-editor.org/rfc/rfc9043.html",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "FFV1 version 4 draft (expired)",
      "url": "https://datatracker.ietf.org/doc/draft-ietf-cellar-ffv1-v4/",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "FFmpeg ffv1 encoder source (n9.0.2)",
      "url": "https://github.com/FFmpeg/FFmpeg/blob/n9.0.2/libavcodec/ffv1enc.c",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "FFmpeg codecs documentation: ffv1",
      "url": "https://ffmpeg.org/ffmpeg-codecs.html#ffv1",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/video/FFV1.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/video/FFV1.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "Archival encode",
      "anchor": "archival-encode"
    },
    {
      "depth": 2,
      "text": "Check the encode is lossless",
      "anchor": "check-the-encode-is-lossless"
    },
    {
      "depth": 2,
      "text": "Versions and playback",
      "anchor": "versions-and-playback"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/codecs/video/ffv1/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/_preamble.md",
      "checksum": "e36acb4c14e74ff688c86d378bc2b65000b5efd413db83b1fb13991e310cdbf2",
      "bytes": 584
    },
    {
      "id": "archival-encode",
      "title": "Archival encode",
      "depth": 2,
      "anchor": "archival-encode",
      "canonicalUrl": "https://encode.wiki/codecs/video/ffv1/#archival-encode",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/archival-encode.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/archival-encode.md",
      "checksum": "d3ac2f5d951f4afc45c2683f8c1ee0be2e6864a5bbe23dba005f19ec2efbf98e",
      "bytes": 1838
    },
    {
      "id": "check-the-encode-is-lossless",
      "title": "Check the encode is lossless",
      "depth": 2,
      "anchor": "check-the-encode-is-lossless",
      "canonicalUrl": "https://encode.wiki/codecs/video/ffv1/#check-the-encode-is-lossless",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/check-the-encode-is-lossless.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/check-the-encode-is-lossless.md",
      "checksum": "c851a871911d6487cdf4c41a53d2481ad57e9263bd4a2cf36ad221f6786acb9f",
      "bytes": 384
    },
    {
      "id": "versions-and-playback",
      "title": "Versions and playback",
      "depth": 2,
      "anchor": "versions-and-playback",
      "canonicalUrl": "https://encode.wiki/codecs/video/ffv1/#versions-and-playback",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/versions-and-playback.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/video/ffv1/versions-and-playback.md",
      "checksum": "01dc116d6190ddf9c66824365ce1aeea79b1b64d9a9c8fd7e16cde7e23443a1e",
      "bytes": 460
    }
  ],
  "outboundReferences": [
    "/codecs/video/utvideo/",
    "/reference/video-codec-support/",
    "https://www.rfc-editor.org/rfc/rfc9043.html"
  ],
  "checksum": "d909df13f68d5f160e4b4c197a679342e17a16ce0ee3b9c29b5f76c39cb17f97",
  "contentFormat": "markdown",
  "markdown": "FFV1 is a lossless video codec designed by Michael Niedermayer and developed in FFmpeg. Versions 0, 1 and 3 are specified in IETF [RFC 9043](https://www.rfc-editor.org/rfc/rfc9043.html), and it is one of the standard preservation formats in film and video archives, usually in Matroska. It compresses much better than fast lossless codecs such as [Ut Video](/codecs/video/utvideo/), at the cost of speed.\n\nIt handles YCbCr (4:2:0, 4:2:2, 4:4:4 and others), RGB, grayscale and alpha at 8 to 16 bits per sample, interlaced material, and in version 3 per-slice CRCs for error detection.\n\n## Archival encode\n\n```sh\nffmpeg -i input.mov -c:v ffv1 -level 3 -g 1 -coder 1 -slicecrc 1 -c:a copy output.mkv\n```\n\n| Option | Why |\n| --- | --- |\n| `-level 3` | FFV1 version 3: slices, multithreaded decoding and CRCs. FFmpeg 8.0 and later default to it; older builds could pick version 0 or 1 for SD sources, so archival recipes pin it. Version 4 is experimental in FFmpeg and its IETF draft has expired. |\n| `-g 1` | Every frame is a keyframe. See below. |\n| `-coder 1` | Range coder instead of the default Golomb-Rice coder; noticeably smaller files for 8-bit sources. Above 8 bits FFmpeg switches to it automatically. `-coder 2` selects the same mode. |\n| `-slicecrc 1` | A CRC in every slice so damage can be detected and located. Already the default in version 3; set it to make the intent explicit on older builds. |\n| `-slices N` | Number of slices per frame, which sets how many threads can decode it. FFmpeg picks a count from the frame size (20 at 1080p); many archives set 16 or 24. The count has little effect on file size. FFmpeg rejects counts it cannot lay out for the frame size. |\n| `-context 1` | Larger context model. The size difference is small and can go either way depending on content. |\n\nFFV1 keeps its entropy-coder state from frame to frame until the next keyframe resets it, so with a GOP larger than one, damage in one frame can spoil every frame up to the next keyframe. `-g 1` makes FFV1 truly intra-only: the file gets slightly bigger, and a damaged frame stays a single lost frame.\n\nFFmpeg maps only one video and one audio stream by default. Add `-map 0` to keep every track. Matroska cannot hold a MOV timecode track, so also add `-dn` for such sources; the start timecode is still kept as a tag.\n\nFFV1 stores the pixel format you give it. Do not convert RGB to YUV or reduce bit depth on the way in.\n\n## Check the encode is lossless\n\nCompare per-frame hashes of the source and the FFV1 file:\n\n```sh\nffmpeg -i input.mov -f framemd5 input.framemd5\nffmpeg -i output.mkv -f framemd5 output.framemd5\ndiff input.framemd5 output.framemd5\n```\n\nFFmpeg decodes 8-bit RGB FFV1 as `bgr0`. For a `gbrp` source, add `-pix_fmt gbrp` to the second command so both sides are hashed in the same format.\n\n## Versions and playback\n\n- Version 0 was marked stable in 2006, version 1 (more bit depths) in 2009 and version 3 (slices, CRCs) in 2013. Version 2 only ever existed in experimental form.\n- FFmpeg also has a Vulkan encoder, `ffv1_vulkan`, for GPU encoding.\n- Browsers and dedicated hardware decoders do not play FFV1. Keep it as the preservation master and make an AVC, VP9 or AV1 copy for viewing; see [video codec support](/reference/video-codec-support/).\n"
}
