{"id":28175498,"url":"https://github.com/deep-neural/libmediadevice","last_synced_at":"2025-05-15T23:15:12.609Z","repository":{"id":285667765,"uuid":"958921448","full_name":"deep-neural/libmediadevice","owner":"deep-neural","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-02T02:20:24.000Z","size":91,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T03:18:56.293Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/deep-neural.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":"2025-04-02T01:30:15.000Z","updated_at":"2025-04-02T02:20:27.000Z","dependencies_parsed_at":"2025-04-02T03:29:06.909Z","dependency_job_id":null,"html_url":"https://github.com/deep-neural/libmediadevice","commit_stats":null,"previous_names":["deep-neural/libmediadevice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-neural%2Flibmediadevice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-neural%2Flibmediadevice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-neural%2Flibmediadevice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deep-neural%2Flibmediadevice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deep-neural","download_url":"https://codeload.github.com/deep-neural/libmediadevice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436909,"owners_count":22070949,"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":"2025-05-15T23:14:21.620Z","updated_at":"2025-05-15T23:15:12.600Z","avatar_url":"https://github.com/deep-neural.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/deep-neural/libmediadevice\"\u003e\u003cimg src=\"./.github/logo.jpg\" alt=\"libMediaDevice\" height=\"150px\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  libMediaDevice\n  \u003cbr\u003e\n\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003eA modern C/C++ library for interfacing with low-level media devices across multiple platforms\u003c/h4\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/deep-neural/libmediadevice\"\u003e\u003cimg src=\"https://img.shields.io/badge/libMediaDevice-C/C++-blue.svg?longCache=true\" alt=\"libMediaDevice\" /\u003e\u003c/a\u003e\n    \u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-MIT-5865F2.svg\" alt=\"License: MIT\" /\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://github.com/deep-neural/libmediadevice\"\u003e\u003cimg src=\"https://img.shields.io/static/v1?label=Build\u0026message=Documentation\u0026color=brightgreen\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cbr\u003e\n\n### New Release\n\nlibMediaDevice v1.0.0 has been released! See the [release notes](https://github.com/deep-neural/libmediadevice/wiki/Release-libMediaDevice@v1.0.0) to learn about new features, enhancements, and breaking changes.\n\nIf you aren't ready to upgrade yet, check the [tags](https://github.com/deep-neural/libmediadevice/tags) for previous stable releases.\n\nWe appreciate your feedback! Feel free to open GitHub issues or submit changes to stay updated in development and connect with the maintainers.\n\n-----\n\n### Usage\n\nlibMediaDevice is distributed as a pure C/C++ library. To integrate it into your project, ensure you have a compatible C/C++ compiler and the necessary build tools. Clone the repository and link against the library in your build system.\n\n## Simple API\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e Video Device \u003c/th\u003e\n\u003cth\u003e Audio Device \u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```cpp\n#include \u003cmediadevice.h\u003e\n\n// NVIDIA Device\nmedia::VideoDeviceConfig config;\nconfig.type = media::VideoDeviceType::NVFBC;\nconfig.capture_cursor = true;\nconfig.display_id = \":0\";\n\nauto video_device = media::VideoDevice::Create(config);\nif (!video_device) {\n    std::cerr \u003c\u003c \"Failed to create NVFBC video device!\" \u003c\u003c std::endl;\n    std::cerr \u003c\u003c \"Note: NVFBC requires NVIDIA GPU and drivers\" \u003c\u003c std::endl;\n    return 1;\n}\n    \nstd::cout \u003c\u003c \"Successfully created NVFBC video device\" \u003c\u003c std::endl;\nstd::cout \u003c\u003c \"Display resolution: \" \u003c\u003c video_device-\u003eGetWidth() \u003c\u003c \"x\" \u003c\u003c video_device-\u003eGetHeight() \u003c\u003c std::endl;\n\nstd::vector\u003cuint8_t\u003e nv12_buffer;\n\nbool nv12_success = false;\n\n// NV12 format\nnv12_success = video_device-\u003eGetFrameNV12(\u0026nv12_buffer);\nif (nv12_success) {\n    std::cout \u003c\u003c \"Successfully captured NV12 frame \" \u003c\u003c (i + 1)\n                \u003c\u003c \" (\" \u003c\u003c nv12_buffer.size() \u003c\u003c \" bytes)\" \u003c\u003c std::endl;\n}\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n```cpp\n#include \u003cmediadevice.h\u003e\n\nmedia::AudioDeviceConfig config;\nconfig.type = media::AudioDeviceType::PULSE;\nconfig.sample_rate = 44100;\nconfig.channels = 2;\nconfig.buffer_ms = 100;\nconfig.device_id = \"\";  // Use default audio device\n    \n// Create the audio device\nauto audio_device = media::AudioDevice::Create(config);\nif (!audio_device) {\n    std::cerr \u003c\u003c \"Failed to create PulseAudio device!\" \u003c\u003c std::endl;\n    return 1;\n}\n\nint bytes_per_frame = actual_config.channels * 2;\nint expected_bytes = (actual_config.sample_rate * bytes_per_frame * actual_config.buffer_ms) / 1000;\n\n// audio frames\nstd::vector\u003cuint8_t\u003e audio_buffer;\n\nif (audio_device-\u003eGetFrameS16LE(\u0026audio_buffer)) {\n    std::cout \u003c\u003c \"Successfully captured audio frame \" \u003c\u003c (i + 1) \n                \u003c\u003c \" (\" \u003c\u003c audio_buffer.size() \u003c\u003c \" bytes)\" \u003c\u003c std::endl;\n}\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n**[Example Applications](examples/README.md)** contain code samples demonstrating common use cases with libMediaDevice.\n\n**[API Documentation](https://github.com/deep-neural/libmediadevice/docs)** provides a comprehensive reference of our Public APIs.\n\nNow go build something amazing! Here are some ideas to spark your creativity:\n* Create cross-platform media stream applications with consistent APIs.\n* Develop GPU hardware-accelerated media streaming solutions.\n* Implement digital signage solutions with direct hardware access.\n\n## Building\n\nSee [BUILDING.md](https://github.com/deep-neural/libmediadevice/blob/master/BUILDING.md) for building instructions.\n\n### Features\n\n#### Cross-Platform Device Access\n* Uniform API for cameras, microphones, displays, and audio outputs across platforms.\n* Direct hardware access with modern abstraction layers for Windows, macOS, Linux, and more.\n\n#### Modern Interface Design\n* Simplified, consistent API that hides platform-specific complexity.\n* Event-driven architecture with callbacks for device state changes.\n\n#### Performance Focused\n* Zero-copy operations where supported by hardware.\n* Minimal overhead for maximum throughput and reduced latency.\n\n#### Device Control\n* Comprehensive device parameter control (exposure, gain, color settings, etc.).\n* Hardware capability discovery and feature negotiation.\n\n#### Pure C/C++\n* Written entirely in C/C++ with minimal dependencies for maximum performance.\n* Wide platform support: Windows, macOS, Linux, FreeBSD, Android, and more.\n\n### Contributing\n\nCheck out the [contributing guide](https://github.com/deep-neural/libmediadevice/wiki/Contributing) to join the team of dedicated contributors making this project possible.\n\n### License\n\nMIT License - see [LICENSE](LICENSE) for full text\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep-neural%2Flibmediadevice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeep-neural%2Flibmediadevice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeep-neural%2Flibmediadevice/lists"}