回顧
繼上一篇如何在Ubuntu中編譯VLC-Android開源項目, 已經成功的編譯了vlc-android,並且也編譯出了對應版本的libvlc-xx.aar
所需環境
- 項目使用的rtsp視頻流,採用的是海康的攝像頭
- android studio最新版本
- java jdk 1.8
- 其他…
搭建工程
首先打開android studio,新建一個項目,輸入項目的名稱和包名,就ok了。
然後複製編譯好的libvlc-xx.aar到libs目錄下
我的工程目錄結構如下
還需要在build.gradle文件做修改,如下
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.cayden.face"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
flatDir {
dirs 'libs'
}
maven {
url "http://dl.bintray.com/jlmd/maven"
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compile(name: 'libvlc-3.0.0', ext: 'aar')
implementation files('libs/androidutils.jar')
}
最後運行如圖所示
項目源碼
https://github.com/cayden/facesample
本項目主要基於vlc來播放流媒體視頻
主要包含以下內容
- 1、使用已經編譯的libvlc來播放流媒體視頻
- 2、使用MTCNN進行人臉識別並標記人臉
- 3、保存標記的人臉圖片
- 4、使用FACENET進行人臉比對
- 未完待續…
v1.0.0
- 1, added libvlc
- 2, support for playing rtsp video stream
感謝大家的閱讀,也希望能轉發並關注我的公衆號