Code Monkey home page Code Monkey logo

webrtc's Introduction

WebRTC

A java wrapper for WebRTC by JNI based on WebRTC M70, you could use this java lib to communicate with any other WebRTC client(eg: chrome browser, android, ios...), stream from other client to java side isn't supported yet, if anyone would like to finish this part, your PR will been very expected.

You could use this lib to transport video stream(include audio) to other WebRTC clients.

This project may not be designed very well, but you can use it as a reference to know how to use webrtc native lib. You can take it as a start point to build your project.

Blog about this lib

ZhiHu

My site

Concept

  • libwebrtc: Chromium WebRTC c++ lib
  • rtc4j native lib: WebRTC java wrapper jni lib
  • rtc4j: WebRTC java wrapper

Dependencies of building native

  1. build libwebrtc by libwebrtc-m70
  2. install libwebrtc
  3. install libyuv
  4. install libjpegturbo
  5. install ffmpeg

Feature

  1. Build connection with other webrtc client
  2. Use data channel to communicate with other client
  3. Send video frame from java to other client(include audio)
  4. Use ffmpeg's h264 encoder
  5. Use NVIDIA device to accelerate encode, if you do have a NVIDIA device installed
  6. Limit java side webrtc communicate port
  7. Set java side socket ip white list
  8. Change webrtc video transport bandwidth
  9. Change video resolution in runtime, this lib will automatically send a new key frame to change the stream resolution

How to run it

# Step 1: Build ./native by cmake
# These are some build scripts in ./native/scripts
# and if you are in MacOS, the native lib already built and located in ./rtc4j/src/main/resources/jni

# Step 2: maven install rtc4j
cd ./rtc4j
mvn install

# Step 3: maven run spring demo
cd ./demo/spring
mvn spring-boot:run

# Step 4: maven run front vue demo
cd ./demo/vue
npm install
npm run serve
# open http://localhost:8080/ 

How to develop based on it

  1. As described in Dependencies, you should build your own webrtc native lib, it's free to upgrade webrtc native lib if necessary
  2. Add new feature in both /cpp(JNI) side and rtc4j(Java) side(If you upgrade webrtc native lib, it is very likely you need to upgrade existed JNI code too)

webrtc's People

Contributors

beikejiedeliulangmao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

webrtc's Issues

自己的WebRTC库

下午好! 正如我从描述中理解的那样,该项目不是与任何其他Webrtc客户端的通信功能的现成实现。 在这方面,问题是:在不深入研究用C++编写的项目的代码的情况下,实现一个仅限于Java知识的项目会有多困难。 第二个问题是:专有的Webrtc库是什么意思? 我尝试使用开源librtc库(https:github。 commycrllibrtc)。 但我不确定这是否是该项目所需的库。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.