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.
- Host: GitHub
- URL: https://github.com/brucewind/softcodec
- Owner: BruceWind
- License: gpl-3.0
- Created: 2016-11-23T13:51:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-22T01:54:20.000Z (about 2 years ago)
- Last Synced: 2025-04-15T05:07:28.113Z (9 months ago)
- Topics: android, android-codec, android-h264, android-openh264, codec, h264-encoder, librtmp, libyuv, mediastreamrecorder, openh264, rtmp, x264, yuv
- Language: C
- Homepage:
- Size: 8.14 MB
- Stars: 10
- Watchers: 0
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SoftCodec
[](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.