x264_android
所属分类:流媒体/Mpeg4/MP4
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2021-02-27 19:51:16
上 传 者:
sh-1993
说明: 用于android的缩放器和编码器h264,
(Scaler & Encoder h264 for android,)
文件列表:
.idea/ (0, 2021-02-27)
.idea/.name (11, 2021-02-27)
.idea/codeStyles/ (0, 2021-02-27)
.idea/codeStyles/Project.xml (4408, 2021-02-27)
.idea/codeStyles/codeStyleConfig.xml (142, 2021-02-27)
.idea/compiler.xml (170, 2021-02-27)
.idea/gradle.xml (972, 2021-02-27)
.idea/jarRepositories.xml (1052, 2021-02-27)
.idea/misc.xml (372, 2021-02-27)
.idea/vcs.xml (180, 2021-02-27)
app/ (0, 2021-02-27)
app/build.gradle (1229, 2021-02-27)
app/proguard-rules.pro (750, 2021-02-27)
app/src/ (0, 2021-02-27)
app/src/androidTest/ (0, 2021-02-27)
app/src/androidTest/java/ (0, 2021-02-27)
app/src/androidTest/java/daniel/ (0, 2021-02-27)
app/src/androidTest/java/daniel/avila/ (0, 2021-02-27)
app/src/androidTest/java/daniel/avila/x264/ (0, 2021-02-27)
app/src/androidTest/java/daniel/avila/x264/ExampleInstrumentedTest.kt (661, 2021-02-27)
app/src/main/ (0, 2021-02-27)
app/src/main/AndroidManifest.xml (1058, 2021-02-27)
app/src/main/java/ (0, 2021-02-27)
app/src/main/java/daniel/ (0, 2021-02-27)
app/src/main/java/daniel/avila/ (0, 2021-02-27)
app/src/main/java/daniel/avila/x264/ (0, 2021-02-27)
app/src/main/java/daniel/avila/x264/MainActivity.kt (5286, 2021-02-27)
app/src/main/java/daniel/avila/x264/encoder/ (0, 2021-02-27)
app/src/main/java/daniel/avila/x264/encoder/H264EncoderImp.kt (932, 2021-02-27)
app/src/main/java/daniel/avila/x264/encoder/IH264Encoder.kt (210, 2021-02-27)
app/src/main/java/daniel/avila/x264/utils.kt (652, 2021-02-27)
app/src/main/res/ (0, 2021-02-27)
app/src/main/res/drawable-v24/ (0, 2021-02-27)
app/src/main/res/drawable-v24/ic_launcher_foreground.xml (1702, 2021-02-27)
app/src/main/res/drawable/ (0, 2021-02-27)
app/src/main/res/drawable/ic_launcher_background.xml (5606, 2021-02-27)
... ...
# x264 & libyuv for Android
Preview frame scale & encoder to h264 using native libraries
* [x264]
* [libyuv]
### Usage
```
override fun onPreviewFrame(data: ByteArray, camera: Camera) {
val rotated = yuvUtils.nV21Rotate(
data,
widthPreview,
heightPreview,
Key.ROTATE_90,
true
)
val rotatedNScaled = yuvUtils.nV21Scale(
rotated,
heightPreview,
widthPreview,
widthOut,
heightOut,
Key.SCALE_MODE_LINEAR,
)
h264Encoder.nV21ToH264(rotatedNScaled) { h264Frame ->
// process h264Frame
}
}
```
This example record a video h264 and save in
```
storage/emulated/0/Download/sample.h264
```
To reproduce this video you can use [VLC for Android]
### Build x264 lib for Android ABIs (armeabi-v7a, arm64-v8a, x86, x86_64)
* configure your local NDK, HOST_TAG and TOOLCHAIN in build_x264.sh script
```
export NDK=/home/dani/Android/Sdk/ndk-bundle
export HOST_TAG=linux-x86_64
export TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/$HOST_TAG
```
* execute build_x264.sh - This script clone x264 repository and build different ABIs for android
```
# ./build_x264.sh
```
### Build libyuv lib for Android ABIs (armeabi-v7a, arm64-v8a, x86, x86_64)
* Coming soon..
This project is based in: [sszhangpengfei encoder] and [doggycoder AndroidLibyuv]
[sszhangpengfei encoder]: https://github.com/sszhangpengfei/android_x264_encoder
[doggycoder AndroidLibyuv]: https://github.com/doggycoder/AndroidLibyuv
[x264]: https://www.videolan.org/developers/x264.html
[libyuv]: https://chromium.googlesource.com/libyuv/libyuv/
[VLC for Android]: https://play.google.com/store/apps/details?id=org.videolan.vlc&hl=es_CO
近期下载者:
相关文件:
收藏者: