{"id":22050284,"url":"https://github.com/nowrep/libenc","last_synced_at":"2025-06-10T18:12:59.778Z","repository":{"id":263276691,"uuid":"861948479","full_name":"nowrep/libenc","owner":"nowrep","description":"VAAPI encode library","archived":false,"fork":false,"pushed_at":"2025-04-24T12:11:14.000Z","size":286,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-24T13:25:23.781Z","etag":null,"topics":["vaapi"],"latest_commit_sha":null,"homepage":"","language":"C++","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/nowrep.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-23T19:06:55.000Z","updated_at":"2025-04-24T12:11:17.000Z","dependencies_parsed_at":"2024-11-17T14:35:54.765Z","dependency_job_id":"03375513-a7b0-4f71-9f3a-735049babf2b","html_url":"https://github.com/nowrep/libenc","commit_stats":null,"previous_names":["nowrep/libenc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowrep%2Flibenc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowrep%2Flibenc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowrep%2Flibenc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowrep%2Flibenc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowrep","download_url":"https://codeload.github.com/nowrep/libenc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowrep%2Flibenc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259123921,"owners_count":22808876,"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":["vaapi"],"created_at":"2024-11-30T14:20:12.019Z","updated_at":"2025-06-10T18:12:59.757Z","avatar_url":"https://github.com/nowrep.png","language":"C++","readme":"# libenc\n\nVideo encode library using VAAPI.\n\n## Features\n\nMain focus of the library is low latency encoding, so features like B-frames are not supported.\n\n* H264/HEVC/AV1\n* Full control of references (eg. can use hierarchical P coding)\n* Reference frame invalidation\n* Intra refresh\n* Dynamic rate control change\n* Format and color conversion\n* SVC Temporal with rate control layers\n* Multiple slices\n\nTested with Mesa and Intel drivers. Mesa requires \u003e= 24.3, older versions may not work.\n\n## Building\n\n```sh\nmeson setup build\ncd build\nninja\n```\n\n## Sample\n\n```c\nstruct enc_dev *dev = enc_dev_create((struct enc_dev_params){\n   .device_path = \"/dev/dri/renderD128\"\n});\n\nstruct enc_rate_control_params rc_params = {\n   .frame_rate = 60,\n};\n\nstruct enc_encoder *enc = enc_encoder_create((struct enc_encoder_params){\n   .dev = dev,\n   .codec = ENC_CODEC_H264,\n   .width = 1280,\n   .height = 720,\n   .gop_size = 30,\n   .rc_mode = ENC_RATE_CONTROL_MODE_CQP,\n   .num_rc_layers = 1,\n   .rc_params = \u0026rc_params,\n});\n\nstruct enc_surface *surf = enc_surface_create((struct enc_surface_params){\n   .dev = dev,\n   .format = ENC_FORMAT_NV12,\n   .width = 1280,\n   .height = 720,\n});\n\nstruct enc_task *task = enc_encoder_encode_frame(enc, (struct enc_frame_params){\n   .surface = surf,\n   .qp = 20,\n});\n\nenc_task_wait(task, UINT64_MAX);\n\nuint32_t size = 0;\nuint8_t *data = NULL;\nwhile (enc_task_get_bitstream(task, \u0026size, \u0026data))\n   fwrite(data, size, 1, file);\n```\n\nMore complex example can be found in `app` directory.\n\n## TODO\n\n* Quality setting\n* Query capabilities\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowrep%2Flibenc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowrep%2Flibenc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowrep%2Flibenc/lists"}