This project uses Android lastest MediaCodec API for video/audio encoding and popular C ibrary librtmp (source code included) for rtmp streaming, in addionion, provides ability to implement real-time effect filters after camera capturing phase and before encoding phase. Some features are:
Support Android 4.3 and higher (Android 6.0/7.0-preview tested)
Filters support soft mode (CPU processing) and hard mode (GPU/OpenGLES rendering)
Soft mode filter can be implemented by processing NV21 image array captured from camera
Hard mode filter can be implemented by rendering image texture captured from camera
Compatible with GPUImage,use GPUImageFilter without change one line
Support pixel rotation and flip
Support encoding paramaters like resolution, bitrate,fps etc
Fast front/rear camera swaping without interrupt rtmp streaming
Support draw android View into video
Soft Filter Mode
Color format is NV21
Create your own filter by extending BaseSoftVideoFilter
Filter effect can be manipulated via java, ndk or renderscript
Adjust your filter properties between acquireSoftVideoFilter and releaseSoftVideoFilter, call releaseSoftVideoFilter as soon as operation finished (after acquireSoftVideoFilter), interval better be less than 3ms
Hard Filter Mode
Create your own filter by extending either BaseHardVideoFilter or OriginalHardVideoFilter
OriginalHardVideoFilter is more simple to use, just need to proivde custmom shader to get various effects
BaseHardVideoFilter is more powerful and flexible and need write openGLES code by yourself. You can theoretically achieve any effects you want via BaseHardVideoFilter.
Adjust your filter properties between acquireHardVideoFilter and releaseHardVideoFilter, call releaseHardVideoFilter as soon as operation finished (after acquireHardVideoFilter), interval better be less than 3ms