An open API service indexing awesome lists of open source software.

https://github.com/brucewind/softcodec

πŸ“€ Encoding YUV into H.246 & transmit it to rtmp server.
https://github.com/brucewind/softcodec

android android-codec android-h264 android-openh264 codec h264-encoder librtmp libyuv mediastreamrecorder openh264 rtmp x264 yuv

Last synced: 9 months ago
JSON representation

πŸ“€ Encoding YUV into H.246 & transmit it to rtmp server.

Awesome Lists containing this project

README

          

# SoftCodec

[![Build](https://github.com/BruceWind/SoftCodec/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/BruceWind/SoftCodec/actions/workflows/build.yml)

[δΈ­ζ–‡](https://github.com/BruceWind/SoftCodec/blob/master/README_zh_cn.md)
- [x] 1. encode with x264.
- [x] 2. push into RTMP server.
- [x] 3. encode with openh264.
- [ ] 4. echo cancellation in software. Maybe need libspeex.

## What It Does:

click to expand.

``` javascrpt
phone
+-----------------------+
| |
| |
| +-----------+ |
| | | | +----------------+ +----------------+
| | Camera |-------->| YUV format A | -----> | YUV format B |
| | | | +----------------+ +----------------+
| +-----------+ | |
| | |
| | |
| | v
| | +------------+ +---------------+
| | | | | |
| | | YUV(NALs) |<------ | Codec |
| | | | | |
| | +------------+ +---------------+
| | |
| | |
| | |
| | |
| | v
| +-------------+ | +-------------+
| | | | | |
| | WIFI |<-------- | RTMP & FLV |
| | | | | |
| +-------------+ | +-------------+
| | |
+-----------|-----------+
|
| RTMP server
| +-----------+
| | |
| | _____ |
| | |_____| |
+------------------->| ___ |
| |___| |
| |
| |
| |
+-----------+
```

## Building & Testing

click to expand.

**1. building**

It depend on NDK 16, but you don't need to download manually.
By the time you executed `./gradlew assembleDebug`, gradle will download it automatically in case
your computer has no NDK 16.

**2. Testing with a RTMP server:**

You must have a RTMP server which receives stream app pushed. The RTMP server can also transfer data to video players.

I had written a blog to teach someone else how to establish it.
You can look into the [blog](https://github.com/BruceWind/BruceWind.github.io/blob/master/md/establish-RTMP-server-with-docker.md).

**3. Pushing stream.**

modify this code line below in `MainActivity` to point to your rtmp server:
``` java
private String mRtmpPushUrl = "rtmp://192.168.50.14/live/live";
```


---------------

In addition, `master` branch has all of stable codes, If you want to look code in development, checkout
other branches.


Take look at [CodecLibsBuildSH](https://github.com/BruceWind/CodecLibsBuildSH) in case you want to upgrade version of Codec.