# ⚠️HardwareVideoCodec will not be updated
This project has been migrated to [hwvc](https://github.com/lmylr/hwvc) now. [hwvc](https://github.com/lmylr/hwvc) is a cross-platform project. Committed to quickly and easily implement a variety of complex multimedia needs, including recording and editing. This project uses c / c + + implementation, currently only supports Android platform, but it can also be easily ported to other platforms, such as IOS.
## HWVC(HardwareVideoCodec)
[ ![Download](https://api.bintray.com/packages/lmylr/maven/hardwarevideocodec/images/download.svg) ](https://bintray.com/lmylr/maven/hardwarevideocodec/_latestVersion)
HWVC is an efficient video encoding library for Android. Supports `software` and `hardware` encode.
With it, you can encode a video at any resolution, no longer need to care about camera resolution. Everything is so easy.
![ScreenRecord_1](https://github.com/lmylr/HardwareVideoCodec/blob/master/images/ScreenRecord_1.gif)
![ScreenRecord_1](https://github.com/lmylr/HardwareVideoCodec/blob/master/images/ScreenRecord_2.gif)
## Latest release
[V1.7.3](https://github.com/lmylr/HardwareVideoCodec/releases/tag/v1.7.3)
* Support seek now.
* Fix player`s life cycle.
* Support add filters to existing videos or cut videos.
* Support video player.
## Features
* Support video encoding at any resolution. No need to care about camera resolution.
* Support for add filters to existing videos or cut videos.
* Support RTMP stream.
* Support for changing resolution without restarting the camera.
* Support hard & soft encode.
* Record video & audio. Pack mp4 through MediaMuxer.
* Use OpenGL to render and support filter.
* Supports 40+ filters
* Support beauty filter.
* Support for changing resolution without restarting the camera.
* More features.
## Start
If you are building with Gradle, simply add the following code to your project:
* You need to configure your kotlin environment. Project root 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()
}
}
```
* Module build.gradle
```
dependencies {
implementation 'com.lmy.codec:hardwarevideocodec:1.7.3'
implementation 'com.lmy.codec:rtmp:1.7.3'//If you want to use RTMP stream.
}
```
* For record mp4
```
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")
setOutputSize(720, 1280)//Default 720x1280
setFps(30)
setFilter(getDefaultFilter())
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
}
}
private fun getDefaultFilter(): BaseFilter = GroupFilter.create(BeautyV4Filter())
.addSticker(TextSticker().apply {
setText(TextSticker.Text("HWVC", 56f).apply {
x = 0.8f
y = 0.03f
})
})
.addSticker(ImageSticker().apply {
setImage(ImageSticker.Image().apply {
x = 0.03f
y = 0.03f
scale = 1.6f
bitmap = BitmapFactory.decodeResource(resources, R.mipmap.ic_logo_hwvc)
})
})
override fun onDestroy() {
super.onDestroy()
mRecorder.release()
}
}
```
* For live
```
class MainActivity : AppCompatActivity() {
private lateinit var mRecorder: VideoRecorderImpl
private val onStateListener = object : VideoRecorder.OnStateListener {
override fun onStop() {
}
override fun onPrepared(encoder: Encoder) {
mRecorder.start()
}
override fun onRecord(encoder: Encoder, timeUs: Long) {
}
override fun onError(error: Int, msg: String) {
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val mTextureView = TextureView(this)
setContentView(mTextureView)
mRecorder = VideoRecorderImpl(this).apply {
reset()
setOutputUri("rtmp://192.168.16.125:1935/live/livestream")
setOutputSize(720, 1280)//Default 720x1280
setFps(30)
setFilter(getDefaultFilter())//Default NormalFilter
setPreviewDisplay(mTextureView)
setOnStateListener(onStateListener)
}
mRecorder.prepare()
}
private fun getDefaultFilter(): BaseFilter = GroupFilter.create(BeautyV4Filter())
.addSticker(TextSticker().apply {
setText(TextSticker.Text("HWVC", 56f).apply {
x = 0.8f
y = 0.03f
})
})
.addSticker(ImageSticker().apply {
setImage(ImageSticker.Image().apply {
x = 0.03f
y = 0.03f
scale = 1.6f
bitmap = BitmapFactory.decodeResource(resources, R.mipmap.ic_logo_hwvc)
})
})
override fun onDestroy() {
super.onDestroy()
mRecorder.release()
}
}
```
## Join the HWVC community
Please use our [issues page](https://github.com/lmylr/HardwareVideoCodec/issues) to let us know of any problems.
## License
HWVC(HardwareVideoCodec) is [GPL-licensed](https://github.com/lmylr/HardwareVideoCodec/tree/master/LICENSE).
没有合适的资源?快使用搜索试试~ 我知道了~
HardwareVideoCodec 是一个高效的 Android 视频录制库,支持软硬件编码_C语言_代码_下载
共532个文件
h:143个
kt:137个
glsl:58个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 121 浏览量
2022-07-04
14:44:12
上传
评论
收藏 9.16MB ZIP 举报
温馨提示
HardwareVideoCodec 是一个高效的 Android 视频录制库。支持软硬件编码。有了它,您可以以任何分辨率录制视频,无需关心相机分辨率。一切都是那么容易。 特征 支持任何分辨率的视频编码。无需关心相机分辨率。 支持为现有视频添加过滤器或剪切视频。 支持 RTMP 流。 支持在不重新启动相机的情况下更改分辨率。 支持硬编码和软编码。 录制视频和音频。通过 MediaMuxer 打包 mp4。 使用 OpenGL 渲染并支持滤镜。 支持 40+ 过滤器 支持美颜滤镜。 支持在不重新启动相机的情况下更改分辨率。 更多功能。 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
HardwareVideoCodec 是一个高效的 Android 视频录制库,支持软硬件编码_C语言_代码_下载 (532个子文件)
librtmp.3 7KB
Makefile.am 2KB
Makefile.am 1KB
Makefile.am 722B
Makefile.am 278B
Makefile.am 17B
Makefile.am 17B
Android.mk.backup 1KB
Android.mk.backup 664B
Android.mk.backup 623B
make-Makefiles.bash 111B
make-Makefiles.bash 111B
gradlew.bat 2KB
rtmp.c 137KB
nb_celp.c 57KB
ns_core.c 50KB
sb_celp.c 44KB
mdf.c 43KB
resample.c 43KB
preprocess.c 41KB
fft4g.c 36KB
jitter.c 29KB
amf.c 27KB
filters.c 24KB
ltp.c 24KB
smallft.c 22KB
smallft.c 22KB
cb_search.c 18KB
lsp.c 18KB
kiss_fft.c 16KB
kiss_fft.c 15KB
hashswf.c 15KB
vorbis_psy.c 11KB
kiss_fftr.c 10KB
fftwrap.c 10KB
kiss_fftr.c 10KB
bits.c 10KB
stereo.c 10KB
quant_lsp.c 10KB
modes.c 9KB
vbr.c 8KB
scal.c 8KB
lsp_tables_nb.c 8KB
modes_wb.c 7KB
filterbank.c 7KB
parseurl.c 7KB
speex.c 7KB
exc_5_256_table.c 6KB
speex_header.c 6KB
hexc_table.c 6KB
window.c 6KB
lpc.c 5KB
high_lsp_tables.c 5KB
exc_8_128_table.c 5KB
buffer.c 5KB
log.c 4KB
vq.c 4KB
speex_callbacks.c 4KB
gain_table.c 4KB
exc_20_32_table.c 3KB
com_lmy_codec_helper_GLHelper.c 3KB
hexc_10_32_table.c 3KB
exc_5_64_table.c 3KB
exc_10_32_table.c 3KB
exc_10_16_table.c 2KB
gain_table_lbr.c 2KB
noise_suppression.c 2KB
checks.cc 4KB
crosscompile.cmake 829B
crosscompile.cmake 745B
COPYING 26KB
RtmpClient.cpp 17KB
X264Encoder.cpp 11KB
X265Encoder.cpp 5KB
Java_com_lmy_rtmp_RtmpClient.cpp 5KB
HandlerThread.cpp 3KB
Java_com_lmy_codec_x264_X264Encoder.cpp 3KB
DeNoise.cpp 3KB
Java_com_lmy_codec_x265_X265Encoder.cpp 2KB
Java_com_lmy_codec_helper_Libyuv.cpp 2KB
Java_com_lmy_codec_native_processor_DeNoise.cpp 990B
Message.cpp 797B
SpecificData.cpp 773B
Lock.cpp 380B
ScreenRecord_2.gif 4.4MB
ScreenRecord_1.gif 1020KB
.gitattributes 57B
.gitignore 549B
.gitignore 7B
.gitignore 7B
.gitignore 7B
fragment_beauty_v4.glsl 6KB
fragment_beauty.glsl 5KB
fragment_pixar.glsl 4KB
fragment_smooth.glsl 2KB
fragment_brannan.glsl 2KB
fragment_sketch.glsl 2KB
vertex_sketch.glsl 1KB
fragment_hue.glsl 1KB
fragment_rgba_to_yuv422.glsl 1KB
共 532 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功