{"id":15668042,"url":"https://github.com/naps62/instacam","last_synced_at":"2025-05-05T21:16:59.185Z","repository":{"id":103683103,"uuid":"267955653","full_name":"naps62/instacam","owner":"naps62","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-22T10:52:22.000Z","size":3778,"stargazers_count":70,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-05T21:16:54.196Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naps62.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-05-29T21:10:16.000Z","updated_at":"2024-07-19T03:33:42.000Z","dependencies_parsed_at":"2023-07-07T00:01:00.816Z","dependency_job_id":null,"html_url":"https://github.com/naps62/instacam","commit_stats":{"total_commits":42,"total_committers":1,"mean_commits":42.0,"dds":0.0,"last_synced_commit":"dbe7a3b551ac2a0a194777a6db91bbe0f202ec07"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naps62%2Finstacam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naps62%2Finstacam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naps62%2Finstacam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naps62%2Finstacam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naps62","download_url":"https://codeload.github.com/naps62/instacam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252577027,"owners_count":21770721,"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":[],"created_at":"2024-10-03T14:06:17.029Z","updated_at":"2025-05-05T21:16:59.169Z","avatar_url":"https://github.com/naps62.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Instacam\n\n**Filters for your webcam**\n\nThis is a pet project motivated mostly by my desire to learn both [Rust](https://www.rust-lang.org/) and [FFmpeg](https://ffmpeg.org/)\n\nIt grabs an input video feed (most likely your original webcam, but any video\nsource should work, in theory), and outputs a transformed video feed.\n\n\n## Prerequisites\n\nYou need to create a virtual camera device on your system. Currently, I only\nknow how to do this on Linux (instructions below).\n\nIf an equivalent tool exists for other systems, there should be no other major blockers to getting this to work\n(both FFmpeg and Rust are widely available in most systems).\n\n### Linux\n\nSetup [v4l2loopback](https://github.com/umlaeute/v4l2loopback), and create\na virtual webcam, such as:\n\n```sh\nsudo modprobe v4l2loopback devices=1 video_nr=2 card_label=\"Instacam\" exclusive_caps=1\n```\n\nOn my machine, this creates a `/dev/video2` device. Depending on how many you\nalready have, yours might be named differently.\n\n## Setup\n\n1. Clone the repo\n\n```sh\n# clone the repo\ngit clone https://github.com/naps62/instacam.git\ncd instacam\n```\n\n2. Create a configuration file under `~/.config/instacam/config.json` (changing\n   each value acording to your system):\n\n```\n{\n  \"input\": \"/dev/video0\",\n  \"output\": \"/dev/video2\",\n  \"width\": 1280,\n  \"height\": 720,\n  \"fps\": 30,\n  \"pipeline\": [\n    {\n      \"name\": \"preview\"\n    }\n  ]\n}\n```\n\n3. Start the program:\n\n```sh\ncargo run\n```\n\n## Using filters\n\nAfter the initial setup, filters are configured mostly through the `pipeline` of\nthe config file. You can compose the multiple existing filters, and the final\nimage will be output to your `output` device.\n\nFor instance, the following pipeline:\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"pixelate\",\n    \"k\": 64\n  },\n  {\n    \"name\": \"sharpen\"\n  },\n  {\n    \"name\": \"preview\"\n  }\n]\n```\n\n![Sample](./samples/sample.png)\n\n\n### Available filters\n\n#### Preview\n\nDoes not alter the image, but renders the current frame in\na window, allow you to see the result in different stages of the pipeline.\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"preview\",\n  }\n]\n```\n\n![Preview](./samples/preview.png)\n\n#### Blur\n\nBlurs the image by a given factor\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"blur\",\n    \"k\": 32\n  }\n]\n```\n\n![Blur](./samples/blur.png)\n\n#### Pixelate\n\nPixelates the image. `k` here is maximum desired number of pixels per\nline.\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"pixelate\",\n    \"k\": 128\n  }\n]\n```\n\n![Pixelate](./samples/pixelate.png)\n\n#### Sepia\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"sepia\"\n  }\n]\n```\n\n![Sepia](./samples/sepia.png)\n\n#### Sharpen\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"sharpen\"\n  }\n]\n```\n\n![Sharpen](./samples/sharpen.png)\n\n#### Edge Detection\n\nMostly an experimental filter I was playing with, while learning more about the\nOpenCV API\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"edges\",\n    \"t1\": 100,\n    \"t2\": 200\n  }\n]\n```\n\n![Edges](./samples/edges.png)\n\n#### Background Subtraction\n\nAlso an experimental filter, with a background subtractor algorithm. This sample\nimage is hurt by my low-quality webcam, as well as the lack of a more prominent\nforeground in this picture.\n\n```\n\"pipeline\": [\n  {\n    \"name\": \"bgsub\"\n  }\n]\n```\n\n![BgSub](./samples/bgsub.png)\n\n# About\n\nInstacam was authored by [Miguel Palhas](http://naps62.com).\n\nThe project is fully open-source. Use it as you wish.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaps62%2Finstacam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaps62%2Finstacam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaps62%2Finstacam/lists"}