Giter Site home page Giter Site logo

pplayer's Introduction

PPlayer Base on FFmpeg ,support RTMP/RTSP/HLS/H265

基于Ffmpeg4.0.2(arm64-v8a)静态库搭建一套高可用的播放器

FFmpeg 4.0.2静态库从0开始一个播放器的搭建,支持rtmp、rtsp、hls、本地MP4文件播放,视频解码+音频解码+音视频同步

在这里你可以看到全部的jni部分代码,不隐藏实现的c++代码,java调用c,然后c中回调java方法,在native层开启线程,同步锁pthred_mutex,pthread等等的使用。

你只需要有一点c的基础就可以动手开始改造本项目,查看本项目的每一次日志提交,清晰的脉络知识结构认知尽览无余。

FFmpeg4.0.2编译脚本及更多介绍参考PPlayer-Wiki

为什么选用静态库

静态库是源代码的静态备份,jni编译时候会选择有用的头文件加载对应的源文件打包成so库,方便开发者写native层代码,用多少取多少(so体积不会固定死)是它的优势,

目前开源项目采用静态库的不是很多,极不方便新手入门jni和音视频开发,我就是要让你能够像写hello-world一样开始音视频的开发,that's all!

pic

欢迎给我提issue,有想法也可以提.

ToDoList

  • 视频解码
  • 音频解码
  • 音视频同步
  • 播放在线流媒体RTMP、RTSP、HLS
  • 线程释放
  • seek进度条拖动(av_seek_frame)
  • 视频格式转码ex:flv->mp4. see FFmpegTools
  • x264推流H264 see PPush
  • faac推流AAC see PPush

运行demo

  1. 去release中下载源代码,
  2. 然后看下面静态库地址可以考虑百度网盘放到app/lib
  3. 直接使用AndroidStudio导入本项目运行app

播放本地MP4

  1. 拷贝capture/input.mp4/data/com.poe.pplayer/cache
  2. 点击"播放"

播放RTMP.

mPlayer.setDataSource("rtmp://xxxxxxx.com/abcd12343");

测试流地址

  1. 推荐red5百度网盘 提取码:veyq
  2. nginx+lib-rtmp服务器搭配FFmpeg或者Obs推流 pic

静态库由于体积太大,我放到了百度网盘,

FFmpeg4.0.2静态库(32/64bit) 提取码:2c16

License

Copyright 2020 Poe.Cai.

FFmpeg codebase is mainly LGPL-licensed with optional components licensed under GPL. Please refer to the LICENSE file for detailed information.

pplayer's People

Contributors

jdpxiaoming avatar

Stargazers

柯南 avatar  avatar WangJianjun avatar

Watchers

James Cloos avatar C++ avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.