- 授权协议: GPLv2
- 开发语言: Java
- 操作系统: Android
- 软件首页: https://gitee.com/lrlmy/HardwareVideoCodec
- 软件文档: https://gitee.com/lrlmy/HardwareVideoCodec/blob/master/README.md
软件介绍
HardwareVideoCodec是一个高效的Android音视频编码库,支持软编和硬编。使用它你可以很容易的实现任何分辨率的视频编码,无需关心摄像头预览大小。一切都如此简单。目前已迭代多个稳定版本,欢迎查阅学习和使用,如有BUG或建议,欢迎提Issue。
一、简介
HardwareVideoCodec是个高性能、易用的Android音视频编码开源库,支持多款滤镜,支持RTMP直播推流,以及软编和硬编。硬编性能较好,在高通630的中端机子上实测1080p、30fps毫无问题。软编性能差一点,同样的机子,软编只能达到720p、24fps。硬编性能较好,软编兼容性较好,这个需要根据的业务需求进行选择。
HardwareVideoCodec目前已经迭代到了1.6.3版本,更新了新的美颜滤镜,美颜更出色,更有40+滤镜库。支持RTMP推流,实测1080p、30fps局域网推流毫无性能压力。以下是主要的特性:
支持
高性能的RTMP直播推流。支持在不重启Camera的基础上,
热切换画面分辨率。支持包括
美颜滤镜在内的20多款滤镜。支持视频
软编和硬编。支持
录制视频保存成mp4。使用
OpenGL进行画面渲染,更少的CPU和内存占用,高通630的中端机子硬编并开启RTMP推流实测仅12%的CPU占用。
运行截图
二、使用
1.把以下代码加入到Project的build.gradle。
buildscript {
ext.kotlin_version = '1.2.30'//Latest kotlin version
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}2.导入依赖,把以下代码加入到Module的build.gradle。
dependencies {
implementation 'com.lmy.codec:hardwarevideocodec:1.6.3'
implementation 'com.lmy.codec:rtmp:1.6.3'//如果需要使用RTMP推流功能
}3.在Activity中使用HardwareVideoCodec。
class MainActivity : AppCompatActivity() {
private lateinit var mRecorder: VideoRecorderImpl
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val mTextureView = TextureView(this)
setContentView(mTextureView)
mRecorder = VideoRecorderImpl(this).apply {
reset()
setOutputUri("${Environment.getExternalStorageDirectory().absolutePath}/test.mp4")
//setOutputUri("rtmp://192.168.16.125:1935/live/livestream")//如果需要使用RTMP推流,把路径改为RTMP推流地址即可
setOutputSize(720, 1280)//Default 720x1280
setFilter(NormalFilter::class.java)//Default NormalFilter
setPreviewDisplay(mTextureView)
}
mRecorder.prepare()
//For recording control
mTextureView.setOnTouchListener { v, event ->
when (event.action) {
MotionEvent.ACTION_DOWN -> {
if (mRecorder.prepared())
mRecorder.start()
}
MotionEvent.ACTION_UP -> {
if (mRecorder.started())
mRecorder.pause()
}
}
true
}
}
override fun onDestroy() {
super.onDestroy()
mRecorder.release()
}
}运行并授予必要权限,不出意外的话,你已经可以看到摄像头画面了。如果有什么问题,欢迎在评论区留言或者ISSUE,我会及时解答。
三、开源协议
HardwareVideoCodec is GPL 2.0.
Iterative Methods for Sparse Linear Systems, Second Edition
Yousef Saad / Society for Industrial and Applied Mathematics / 2003-04-30 / USD 102.00
Tremendous progress has been made in the scientific and engineering disciplines regarding the use of iterative methods for linear systems. The size and complexity of linear and nonlinear systems arisi......一起来看看 《Iterative Methods for Sparse Linear Systems, Second Edition》 这本书的介绍吧!
