{"id":16839559,"url":"https://github.com/sigmasd/camera","last_synced_at":"2026-04-18T02:31:13.375Z","repository":{"id":231764433,"uuid":"782661142","full_name":"sigmaSd/Camera","owner":"sigmaSd","description":"A cross platform video capture library with a focus on machine vision. (Deno ffi bindings to openpnp-capture)","archived":false,"fork":false,"pushed_at":"2024-04-07T06:12:46.000Z","size":61,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T04:31:21.662Z","etag":null,"topics":["camera","deno","javascript","openpnp"],"latest_commit_sha":null,"homepage":"https://jsr.io/@sigma/camera","language":"TypeScript","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/sigmaSd.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-04-05T18:49:12.000Z","updated_at":"2024-04-13T08:46:50.000Z","dependencies_parsed_at":"2024-04-05T20:24:17.378Z","dependency_job_id":"417a1d04-84fa-47a2-8a57-7b555151a577","html_url":"https://github.com/sigmaSd/Camera","commit_stats":null,"previous_names":["sigmasd/openpnp-deno","sigmasd/camera"],"tags_count":0,"template":false,"template_full_name":"sigmaSd/deno-ffi-template","purl":"pkg:github/sigmaSd/Camera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FCamera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FCamera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FCamera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FCamera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sigmaSd","download_url":"https://codeload.github.com/sigmaSd/Camera/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sigmaSd%2FCamera/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31953757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["camera","deno","javascript","openpnp"],"created_at":"2024-10-13T12:32:51.244Z","updated_at":"2026-04-18T02:31:13.356Z","avatar_url":"https://github.com/sigmaSd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Camera\n\nA cross platform video capture library with a focus on machine vision. (Deno ffi\nbindings to openpnp-capture)\n\n## Usage\n\n```ts\nimport { Camera } from \"jsr:@sigma/camera\";\n\nif (import.meta.main) {\n  console.log(\"OpenPnp Camera Test Program\");\n  console.log(\"Using openpnp version:\", Camera.getLibraryVersion());\n  //Camera.setLogLevel(7);\n  using cam = new Camera();\n\n  const device = cam.devices().at(0);\n  if (!device) throw new Error(\"no device found\");\n\n  console.log(\"Device name:\", device.name());\n  console.log(\"Device formats:\", device.formats());\n\n  // choose the format with the highest resolution\n  const formatInfo = device.formats().sort((a, b) =\u003e b.width - a.width).at(0);\n  if (!formatInfo) throw new Error(\"no format found\");\n\n  using stream = device.stream(formatInfo);\n  if (!stream) throw new Error(\"no stream found\");\n\n  let frameNum = 0;\n  for await (const frame of stream.next({ delay: 100 })) {\n    if (frameNum === 5) break;\n    writeBufferAsPPM(++frameNum, formatInfo.width, formatInfo.height, frame);\n    console.log(`Written frame to frame_${frameNum}.ppm`);\n  }\n}\n\nfunction writeBufferAsPPM(\n  frameNum: number,\n  width: number,\n  height: number,\n  buffer: Uint8Array,\n): boolean {\n  const ENCODER = new TextEncoder();\n  const fname = `frame_${frameNum}.ppm`;\n  const fout = Deno.createSync(fname);\n  fout.writeSync(ENCODER.encode(`P6 ${width} ${height} 255\\n`));\n  fout.writeSync(buffer);\n  fout.close();\n  return true;\n}\n```\n\nThis library exports 3 levels of abstractions:\n\n- ffi: raw deno bindings to openpnp\n- openpnp: thin javascript wrapper over the raw bidings\n- default export: high level javascript api\n\nThe default export is the recommended to use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmasd%2Fcamera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsigmasd%2Fcamera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsigmasd%2Fcamera/lists"}