{"name":"libwebrtc: C++ Wrapper for WebRTC Desktop and Embedded Systems","description":"libwebrtc is a C++ wrapper designed for WebRTC binary releases, primarily supporting Flutter-WebRTC desktop applications. It simplifies the integration of WebRTC functionalities across Windows, Linux, and various embedded systems, offering pre-compiled binaries and a clear compilation guide.","github":"https://github.com/webrtc-sdk/libwebrtc","url":"https://osrepos.com/repo/webrtc-sdk-libwebrtc","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/webrtc-sdk-libwebrtc","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/webrtc-sdk-libwebrtc.md","json":"https://osrepos.com/repo/webrtc-sdk-libwebrtc.json","topics":["dll","so","webrtc","C++","WebRTC","Desktop","Embedded","Flutter"],"keywords":["dll","so","webrtc","C++","WebRTC","Desktop","Embedded","Flutter"],"stars":null,"summary":"libwebrtc is a C++ wrapper designed for WebRTC binary releases, primarily supporting Flutter-WebRTC desktop applications. It simplifies the integration of WebRTC functionalities across Windows, Linux, and various embedded systems, offering pre-compiled binaries and a clear compilation guide.","content":"## Introduction\n\n`libwebrtc` is a robust C++ wrapper built to facilitate the use of WebRTC binary releases. With a focus on desktop and embedded environments, it serves as a crucial component for projects like `flutter-webrtc`, enabling WebRTC capabilities on Windows, Linux, and ARM-based embedded systems. This repository provides the necessary tools and instructions to compile and integrate WebRTC into your C++ applications, abstracting away much of the complexity of the underlying WebRTC library.\n\nThis project is written in C++, is licensed under MIT, and is actively maintained by the `webrtc-sdk` organization. It has garnered significant community interest, boasting over 610 stars and 119 forks.\n\n## Installation and Compilation Guide\n\nGetting `libwebrtc` set up involves synchronizing the WebRTC source code and then compiling the wrapper. The following steps outline the process for both Windows and Linux environments.\n\n### 1. Create Checkout Directory\n\nbash\nmkdir libwebrtc_build\ncd libwebrtc_build\n\n\n### 2. Create `.gclient` Configuration\n\nConfigure `gclient` to fetch the correct WebRTC branch (`m137_release`).\n\nbash\nsolutions = [\n  {\n    \"name\"        : 'src',\n    \"url\"         : 'https://github.com/webrtc-sdk/webrtc.git@m137_release',\n    \"deps_file\"   : 'DEPS',\n    \"managed\"     : False,\n    \"custom_deps\" : {\n    },\n    \"custom_vars\": {},\n  },\n]\ntarget_os  = ['win'] # Change to ['linux'] for Linux compilation\n\n\n### 3. Synchronize Source Code\n\nbash\ngclient sync\n\n\n### 4. Clone `libwebrtc` and Apply Patch\n\nNavigate into the `src` directory, clone `libwebrtc`, and apply the necessary audio source patch.\n\nbash\ncd src\ngit clone https://github.com/webrtc-sdk/libwebrtc\ngit apply libwebrtc/patchs/custom_audio_source_m137.patch\n\n\n### 5. Modify `BUILD.gn`\n\nAdd `libwebrtc` to the `group(\"default\")` in `src/BUILD.gn`:\n\npatch\ndiff --git a/BUILD.gn b/BUILD.gn\nindex e60d7dd0bd..b9b6acab8b 100644\n--- a/BUILD.gn\n+++ b/BUILD.gn\n@@ -29,7 +29,7 @@ if (!build_with_chromium) {\n   # 'ninja default' and then 'ninja all', the second build should do no work.\n   group(\"default\") {\n     testonly = true\n-    deps = [ \":webrtc\" ]\n+    deps = [ \":webrtc\",\"//libwebrtc\", ]\n     if (rtc_build_examples) {\n       deps += [ \"examples\" ]\n     }\n\n\n### 6. Compile for Windows\n\nRequires Visual Studio Community 2022. Set up environment variables and generate GN files, then compile.\n\nbash\nset DEPOT_TOOLS_WIN_TOOLCHAIN=0\nset GYP_MSVS_VERSION=2022\nset GYP_GENERATORS=ninja,msvs-ninja\nset GYP_MSVS_OVERRIDE_PATH=C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\Community\ncd src\ngn gen out-debug/Windows-x64 --args=\"target_os=\\\"win\\\" target_cpu=\\\"x64\\\" is_component_build=false is_clang=true is_debug=true rtc_use_h264=true ffmpeg_branding=\\\"Chrome\\\" rtc_include_tests=false rtc_build_examples=false libwebrtc_desktop_capture=true\" --ide=vs2022\nninja -C out-debug/Windows-x64 libwebrtc\n\n\n### 7. Compile for Linux\n\nEnsure `target_os = ['linux']` in your `.gclient` file and re-run `gclient sync`. Then, generate GN files and compile.\n\nbash\nexport ARCH=x64 # x86, x64, arm, arm64\ncd src\ngn gen out-debug/Linux-$ARCH --args=\"target_os=\\\"linux\\\" target_cpu=\\\"$ARCH\\\" is_debug=true rtc_include_tests=false rtc_use_h264=true ffmpeg_branding=\\\"Chrome\\\" is_component_build=false use_rtti=true use_custom_libcxx=false rtc_enable_protobuf=false\"\nninja -C out-debug/Linux-x64 libwebrtc\n\n\n## Why Use libwebrtc?\n\n`libwebrtc` offers several compelling advantages for developers working with WebRTC:\n\n*   **Simplified Integration**: It acts as a C++ wrapper, abstracting the complexities of the raw WebRTC library, making it easier to integrate into your projects.\n*   **Cross-Platform Support**: Provides binaries and compilation guides for major desktop operating systems, including Windows (x86, x64) and Linux (x86, x64, armv7, arm64), as well as embedded Linux.\n*   **Flutter-WebRTC Compatibility**: Specifically designed to support `flutter-webrtc` desktop versions, bridging the gap between Flutter applications and native WebRTC functionalities.\n*   **Optimized for Binary Releases**: Focuses on providing a wrapper for binary releases, streamlining the deployment process for applications that need WebRTC capabilities.\n\n## Links\n\n*   **GitHub Repository**: [https://github.com/webrtc-sdk/libwebrtc](https://github.com/webrtc-sdk/libwebrtc){:target=\"_blank\"}","metrics":{"detailViews":10,"githubClicks":10},"dates":{"published":null,"modified":"2026-04-06T12:02:18.000Z"}}