{"id":51010925,"url":"https://github.com/velitasali/viewfinder","last_synced_at":"2026-06-21T02:30:54.113Z","repository":{"id":351304843,"uuid":"1209804609","full_name":"velitasali/viewfinder","owner":"velitasali","description":"Lightweight Windows capture card viewer — camera preview + GPU colour conversion + audio passthrough, ~135 KB, no runtime dependencies","archived":false,"fork":false,"pushed_at":"2026-04-14T12:12:18.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-14T14:17:26.240Z","etag":null,"topics":["capture-card","cpp","direct2d","directx","media-foundation","win32","windows"],"latest_commit_sha":null,"homepage":null,"language":"C++","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/velitasali.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-13T19:52:28.000Z","updated_at":"2026-04-14T12:12:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/velitasali/viewfinder","commit_stats":null,"previous_names":["velitasali/viewfinder"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/velitasali/viewfinder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/velitasali%2Fviewfinder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/velitasali%2Fviewfinder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/velitasali%2Fviewfinder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/velitasali%2Fviewfinder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/velitasali","download_url":"https://codeload.github.com/velitasali/viewfinder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/velitasali%2Fviewfinder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34592050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"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":["capture-card","cpp","direct2d","directx","media-foundation","win32","windows"],"created_at":"2026-06-21T02:30:53.556Z","updated_at":"2026-06-21T02:30:54.109Z","avatar_url":"https://github.com/velitasali.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Viewfinder\n\nA lightweight Windows capture card viewer. Displays camera output and passes microphone audio through to your speakers with minimal latency.\n\nBuilt with native Windows APIs — no Electron, no runtime dependencies. Binary is ~135 KB.\n\n## Features\n\n- Live camera preview with correct aspect ratio\n- Microphone audio passthrough (mic → speakers) with automatic format conversion\n- Right-click context menu to switch cameras and microphones\n- Full screen mode\n- Mute toggle\n- Aspect-ratio-locked window resizing\n- Reset window to the camera's native resolution\n\n## Controls\n\n| Input | Action |\n|---|---|\n| Right-click | Open context menu |\n| Double-click | Toggle full screen |\n| F11 | Toggle full screen |\n| Escape | Exit full screen / Quit |\n\n## Building\n\n### Prerequisites\n\n- **Visual Studio 2022** (or later) with the **Desktop development with C++** workload\n  — this includes the MSVC compiler and Windows SDK.\n- **Inno Setup 6** *(optional)* — only needed to produce the installer `.exe`.\n  Download from [jrsoftware.org/isdl.php](https://jrsoftware.org/isdl.php).\n\n### Quick build\n\nDouble-click `build.bat`, or run it from any command prompt:\n\n```bat\ncd C:\\path\\to\\viewfinder\nbuild.bat\n```\n\nThe script:\n1. Generates `viewfinder.ico` from `generate_icon.ps1`\n2. Compiles `resources.rc` (embeds the icon into the executable)\n3. Compiles `main.cpp` → `viewfinder.exe`\n4. If Inno Setup 6 is installed, builds `dist\\viewfinder-setup.exe`\n\n\u003e **Note:** `build.bat` has the MSVC and Windows SDK paths hard-coded for the\n\u003e machine it was developed on. If the build fails with *cl.exe not found*, open\n\u003e the file and update `MSVC_VER` and `SDK_VER` to match your installation, or\n\u003e use the CMake path below instead.\n\n### CMake build (alternative)\n\nIf you have CMake installed:\n\n```bat\ncmake -B build -G \"Visual Studio 17 2022\"\ncmake --build build --config Release\n```\n\nThe resulting executable is at `build\\Release\\viewfinder.exe`.\n\n## Tech stack\n\n| Layer | API |\n|---|---|\n| Video capture | Windows Media Foundation (`IMFSourceReader`) |\n| Colour conversion | Direct3D 11 Video Processor (`ID3D11VideoProcessor`) |\n| Rendering | Direct2D 1.1 (`ID2D1DeviceContext`, `ID2D1Bitmap1`) |\n| Audio passthrough | WASAPI (`IAudioCaptureClient` → `IAudioRenderClient`) |\n| Window / UI | Win32 |\n| Installer | Inno Setup 6 |\n\n## Rendering pipeline\n\n```\nCapture card (NV12 / YUY2)\n    │  Windows Media Foundation — software decode\n    ▼\nCPU buffer (YUV bytes)\n    │  UpdateSubresource → D3D11 input texture\n    ▼\nID3D11VideoProcessor  ←  colour space: BT.601 limited→full\n    │  VideoProcessorBlt → BGRA output texture\n    ▼\nID2D1Bitmap1 (DXGI surface)\n    │  DrawBitmap\n    ▼\nIDXGISwapChain1  →  screen\n```\n\nMedia Foundation reads frames from the capture card in the card's native YUV format (NV12 or YUY2) when available, falling back to RGB32. If a YUV format is chosen, a `ID3D11VideoProcessor` converts it to BGRA entirely on the GPU before handing it to Direct2D, keeping CPU usage low. The final blit is hardware-accelerated through the DXGI swap chain.\n\nHardware-accelerated decode through the MF DXVA pipeline (`MF_SOURCE_READER_D3D_MANAGER`) was evaluated but found to be unreliable for uncompressed capture-card sources: the driver returns `ERROR_EXCEPTION_IN_SERVICE` on the second `ReadSample` call, causing the preview to stall. Software decode with GPU colour conversion is the practical optimum for this class of device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvelitasali%2Fviewfinder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvelitasali%2Fviewfinder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvelitasali%2Fviewfinder/lists"}