{"id":21690683,"url":"https://github.com/reiver/go-fourcc","last_synced_at":"2025-07-14T05:36:33.422Z","repository":{"id":57531645,"uuid":"143675664","full_name":"reiver/go-fourcc","owner":"reiver","description":"Go implementation of FOURCC (four character code) (4CC) identifiers for a video codecs, compression formats, colors and pixel format used in media files.","archived":false,"fork":false,"pushed_at":"2018-08-06T08:18:47.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T09:46:30.438Z","etag":null,"topics":["fourcc"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/reiver/go-fourcc","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reiver.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-06T04:16:48.000Z","updated_at":"2023-06-21T08:02:36.000Z","dependencies_parsed_at":"2022-09-06T23:11:47.857Z","dependency_job_id":null,"html_url":"https://github.com/reiver/go-fourcc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reiver/go-fourcc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-fourcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-fourcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-fourcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-fourcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reiver","download_url":"https://codeload.github.com/reiver/go-fourcc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-fourcc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265246176,"owners_count":23734109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fourcc"],"created_at":"2024-11-25T17:33:05.284Z","updated_at":"2025-07-14T05:36:31.266Z","avatar_url":"https://github.com/reiver.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-fourcc\n\nPackage **fourcc** is a Go implementation of **FOURCC** (**four character code**) (**4CC**) identifiers for a video codecs, compression formats, colors, and pixel format used in media files.\n\n\n## Documention\n\nOnline documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-fourcc\n\n[![GoDoc](https://godoc.org/github.com/reiver/go-fourcc?status.svg)](https://godoc.org/github.com/reiver/go-fourcc)\n\n\n## Introduction\n\nFOURCC, also sometimes written as **FourCC** and **4CC**, are all short for “four character code”.\n\n**FOURCC**, is a sequence of _4 8-bit bytes_ packed into an _unsigned 32-bit integer_ which, **uniquely identifies** a data format.\n\n(A character in this context is a 1 byte (i.e., 8 bit) value. Thus a FOURCC always takes up exatly 32 bits (i.e., 4 bytes).)\n\nThese _data formats_ tend to be video codecs, compression formats, colors, and pixel format used in media files.\n\n\n## Samples\n\nHere are some sample FOURCC.\n\n| Label | Hexadecimal (unsigned integer) |\n|-------|--------------------------------|\n| PAL8  | 0x384C4150                     |\n| VP80  | 0x30385056                     |\n| H264  | 0x34363248                     |\n| MJPG  | 0x47504A4D                     |\n\nThe way you can understand how these _labels_ get turned in _unsigned integers_ is, if we consider the FOURCC “PAL8”, then:\n```\nASCII ‘P’ = hexadecimal 0x50\nASCII ‘A’ = hexadecimal 0x41\nASCII ‘L’ = hexadecimal 0x4C\nASCII ‘8’ = hexadecimal 0x38\n```\nAnd then these 8-bit bytes as packed into an unsigned integer in reverse order.\n\nI.e.,:\n```go\nvar value uint32 = (uint32('P') | (uint32('A') \u003c\u003c 8) | (uint32('L') \u003c\u003c 16) | (uint32('8') \u003c\u003c 24))\n```\n\n\n## Examples\n\nHere is an example usage:\n\n```go\nvar colorspace fourcc.Type = fourcc.FOURCC('P','A','L','8')\n\n```\n\nHere is a constant:\n```go\nconst (\n\tVP8 = fourcc.Const(\"VP80\")\n)\n```\n\nA fourcc.Const needs to be turned into a fourcc.Type before using it. So:\n```go\nvar datum fourcc.Type\nvar err error\n\ndatum, err = VP8.FOURCC()\n```\n\nSome uses of Scan:\n```go\nvar colorspace fourcc.Type\n\nerr := colorspace.Scan(\"PAL8\")\n```\n\nAnd:\n```go\nvar p [4]byte = [4]byte{'P','A','L','8'}\n\nvar colorspace fourcc.Type\n\nerr := colorspace.Scan(p)\n```\n\nAnd:\n```go\nvar p []byte = []byte{'P','A','L','8'}\n\nvar colorspace fourcc.Type\n\nerr := colorspace.Scan(p)\n```\n\n\n## See Also\n\n* [FOURCC.org](https://www.fourcc.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freiver%2Fgo-fourcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freiver%2Fgo-fourcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freiver%2Fgo-fourcc/lists"}