{"id":18821636,"url":"https://github.com/octu0/go-xvc","last_synced_at":"2026-01-18T09:30:17.397Z","repository":{"id":57655724,"uuid":"454792913","full_name":"octu0/go-xvc","owner":"octu0","description":"Go bindings for divideon/xvc","archived":false,"fork":false,"pushed_at":"2022-02-07T11:06:53.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-30T03:43:19.929Z","etag":null,"topics":["binding","golang","video-codec","xvc"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/octu0.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":"2022-02-02T13:50:13.000Z","updated_at":"2022-02-07T11:06:49.000Z","dependencies_parsed_at":"2022-08-25T06:10:42.035Z","dependency_job_id":null,"html_url":"https://github.com/octu0/go-xvc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octu0","download_url":"https://codeload.github.com/octu0/go-xvc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758900,"owners_count":19692041,"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":["binding","golang","video-codec","xvc"],"created_at":"2024-11-08T00:44:59.070Z","updated_at":"2025-02-20T01:14:32.952Z","avatar_url":"https://github.com/octu0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `go-xvc`\n\n[![MIT License](https://img.shields.io/github/license/octu0/go-xvc)](https://github.com/octu0/go-xvc/blob/master/LICENSE)\n[![GoDoc](https://godoc.org/github.com/octu0/go-xvc?status.svg)](https://godoc.org/github.com/octu0/go-xvc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/octu0/go-xvc)](https://goreportcard.com/report/github.com/octu0/go-xvc)\n[![Releases](https://img.shields.io/github/v/release/octu0/go-xvc)](https://github.com/octu0/go-xvc/releases)\n\nGo bindings for [divideon/xvc](https://github.com/divideon/xvc)  \nAvailable for encode/decode of xvc video codec.\n\n## Requirements\n\nrequires xvc [install](https://github.com/divideon/xvc#linux-build-steps) on your system\n\n```\n$ git clone https://github.com/divideon/xvc.git\n$ cd xvc\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make\n$ make install\n```\n\n## Usage\n\n### Encode\n\n```go\nimport \"github.com/octu0/go-xvc\"\n\nfunc encode(out io.Writer) {\n\tencoder, err := xvc.CreateEncoder(\n\t\txvc.EncoderParameterWidth(width),\n\t\txvc.EncoderParameterHeight(height),\n\t\txvc.EncoderParameterFramerate(30.0),\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer xvc.DestroyEncoder(encoder)\n\n\tvar userData int64\n\tnals, err := encoder.Encode(\n\t\timg.Y,       // y plane\n\t\timg.Cb,      // u plane\n\t\timg.Cr,      // v plane\n\t\timg.YStride, // y stride\n\t\timg.CStride, // u stride\n\t\timg.CStride, // v stride\n\t\tuserData,    // int64 user_data\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif remainingNals, ok := encoder.Flush(); ok {\n\t\tnals = append(nals, remainingNals...)\n\t}\n\n\tfor _, nal := range nals {\n\t\tdefer nal.Close()\n\n\t\tif _, err := out.Write(nal.Bytes()); err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n}\n```\n\n### Decode\n\n```go\nimport \"github.com/octu0/go-xvc\"\n\nfunc decode(in io.Reader) {\n\tdecoder, err := xvc.CreateDecoder(\n\t\txvc.DecoderParameterMaxFramerate(30.0),\n\t)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer xvc.DestroyEncoder(decoder)\n\n\tdata, err := io.ReadAll(in)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif err := decoder.Decode(data); err != nil {\n\t\tpanic(err)\n\t}\n\n\tif decoder.Flush(); != true {\n\t\tpanic(\"failed to flush\")\n\t}\n\n\tfor {\n\t\tpic, err := decoder.DecodedPicture()\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\tdefer pic.Close()\n\n\t\tfmt.Printf(\n\t\t\t\"type=%s color_matrix=%d img=%T\\n\", \n\t\t\tpic.Type(), pic.ColorMatrix(), pic.Image(),\n\t\t) // =\u003e type=intra_access_picture color_matrix=3 img=*image.YCbCr\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Fgo-xvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctu0%2Fgo-xvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Fgo-xvc/lists"}