如何在Android项目中使用VLC

栏目: Java · 发布时间: 7年前

内容简介:版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cuiran/article/details/85276384

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cuiran/article/details/85276384

继上一篇 如何在Ubuntu中编译VLC-Android开源项目 , 已经成功的编译了vlc-android,并且也编译出了对应版本的libvlc-xx.aar

所需环境

  • 项目使用的rtsp视频流,采用的是海康的摄像头
  • android studio最新版本
  • java jdk 1.8
  • 其他…

搭建工程

首先打开android studio,新建一个项目,输入项目的名称和包名,就ok了。

然后复制编译好的libvlc-xx.aar到libs目录下

我的工程目录结构如下

如何在Android项目中使用VLC

还需要在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')


}

最后运行如图所示

如何在Android项目中使用VLC

项目源码

https://github.com/cayden/facesample

本项目主要基于vlc来播放流媒体视频

主要包含以下内容

  • 1、使用已经编译的libvlc来播放流媒体视频
  • 2、使用MTCNN进行人脸识别并标记人脸
  • 3、保存标记的人脸图片
  • 4、使用FACENET进行人脸比对
  • 未完待续…
  • 1, added libvlc
  • 2, support for playing rtsp video stream

感谢大家的阅读,也希望能转发并关注我的公众号

如何在Android项目中使用VLC

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

数据结构与算法分析

数据结构与算法分析

维斯 / 人民邮电 / 2006-10 / 59.00元

《数据结构与算法分析:C++描述》秉承Weiss著全一贯的严谨风格,同时又突出了实践。书中充分应用了现代C++语言特性,透彻地讲述了数据结构的原理和应用,不仅使学生具备算法分析能力,能够开发高效的程序,而且让学生掌握良好的程序设计技巧。一起来看看 《数据结构与算法分析》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具