{"id":18821630,"url":"https://github.com/octu0/go-xeve","last_synced_at":"2026-01-18T09:30:18.113Z","repository":{"id":61624358,"uuid":"538499338","full_name":"octu0/go-xeve","owner":"octu0","description":"Go bindings for mpeg5/xeve","archived":false,"fork":false,"pushed_at":"2022-09-20T14:10:19.000Z","size":3037,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-12-30T03:43:18.445Z","etag":null,"topics":["binding","evc","golang","video-codec"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/octu0/go-xeve","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","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-09-19T12:49:17.000Z","updated_at":"2023-03-07T07:18:54.000Z","dependencies_parsed_at":"2022-10-20T10:00:45.596Z","dependency_job_id":null,"html_url":"https://github.com/octu0/go-xeve","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-xeve","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xeve/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xeve/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octu0%2Fgo-xeve/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octu0","download_url":"https://codeload.github.com/octu0/go-xeve/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","evc","golang","video-codec"],"created_at":"2024-11-08T00:44:57.686Z","updated_at":"2026-01-18T09:30:18.081Z","avatar_url":"https://github.com/octu0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `go-xeve`\n\n[![License](https://img.shields.io/github/license/octu0/go-xeve)](https://github.com/octu0/go-xeve/blob/master/LICENSE)\n[![GoDoc](https://godoc.org/github.com/octu0/go-xeve?status.svg)](https://godoc.org/github.com/octu0/go-xeve)\n[![Go Report Card](https://goreportcard.com/badge/github.com/octu0/go-xeve)](https://goreportcard.com/report/github.com/octu0/go-xeve)\n[![Releases](https://img.shields.io/github/v/release/octu0/go-xeve)](https://github.com/octu0/go-xeve/releases)\n\nGo bindings for [mpeg5/xeve](https://github.com/mpeg5/xeve)  \nMPEG-5 EVC encoder.\n\n## Requirements\n\nrequires xeve [install](https://github.com/mpeg5/xeve#how-to-build) on your system\n\n```\n$ git clone https://github.com/mpeg5/xeve.git\n$ cd xeve\n$ mkdir build\n$ cd build\n$ cmake .. -DSET_PROF=BASE\n$ make\n$ make install\n```\n\n## Usage\n\n### Encode\n\n```go\nimport \"github.com/octu0/go-xeve\"\n\nfunc main() {\n\tparam := createParam(width, height)\n\tdefer param.Close()\n\n\tencoder, err := xeve.CreateBaselineEncoder(param)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer encoder.Close()\n\n\tout := newBitstreamWriter()\n\tfor {\n\t\timg, err := loadExampleData()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tnal, err := encoder.Encode(\n\t\t\timg.Y,                    // Y plane\n\t\t\timg.Cb,                   // U plane\n\t\t\timg.Cr,                   // V plane\n\t\t\timg.YStride,              // Y stride\n\t\t\timg.CStride,              // U stride\n\t\t\timg.CStride,              // V stride\n\t\t\txeve.ColorFormatYCbCr420, // YUV 420\n\t\t\txeve.BitDepth8,           // 8bit\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tdefer nal.Close()\n\n\t\tif nal.HasData() != true {\n\t\t\tcontinue\n\t\t}\n\n\t\tout.Write(nal.Data) // write bitstream\n\n\t\tfmt.Printf(\"Frame:%s Slice:%s Data:%v(%d)\\n\", nal.NALUnit, nal.Slice, nal.Data[0:10], len(nal.Data))\n\t\t// =\u003e Frame:IDR Slice:I Data:[0 0 0 21 50 0 128 0 0 0](1234567)\n\n\t\tfor idx, nal := range nal.SplitNAL() {\n\t\t\tfmt.Printf(\"  [%d] type=%s (%d)\\n\", idx, nal.NALType, len(nal.Data))\n\t\t}\n\t\t// =\u003e  [0] type=SPS (21)\n\t\t// =\u003e  [1] type=PPS (4)\n\t\t// =\u003e  [2] type=SEI (1234)\n\t\t// =\u003e  [3] type=IDR (1233308)\n\t}\n\n\tnal, err := encoder.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer nal.Close()\n\n\tif nal.HasData() {\n\t\tout.Write(nal.Data)\n\t\tfmt.Printf(\"[flush] Frame:%s Slice:%s Data:%v(%d)\\n\", nal.NALUnit, nal.Slice, nal.Data[0:10], len(nal.Data))\n\t\t// =\u003e [flush] Frame:NonIDR Slice:P Data:[0 0 0 18 3 0 164 172 64 0](22)\n\t}\n}\n\nfunc createParam(width, height int) *xeve.BaselineParam {\n\tparam, err := xeve.CreateDefaultBaselineParam()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tparam.SetPresetTune(xeve.PresetFast, xeve.TuneNone)\n\tparam.SetInputSize(width, height)\n\tparam.SetFramerate(30, 60)\n\tparam.SetBitrate(2000)\n\tparam.SetGOP(xeve.GOPClosed)\n\tparam.SetRateControl(xeve.RateControlABR)\n\tparam.SetBFrames(0)\n\treturn param\n}\n\nfunc loadExampleData() (*image.YCbCr, error) {\n\t// load YCbCr420 image ...\n}\n\nfunc newBitstreamWriter() io.Writer {\n\t// bitstream writer ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Fgo-xeve","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctu0%2Fgo-xeve","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctu0%2Fgo-xeve/lists"}