Giter Site home page Giter Site logo

qfsun / jrtplib4android Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 13.0 13.34 MB

基于jrtplib,在Android平台上实现RTP/RTCP数据接收、发送等示例。(包含H264数据分包发送、推送H264、FLV数据至RTMP服务器)

Java 52.73% Makefile 38.10% CMake 0.90% Python 0.57% Shell 0.02% C 7.68%

jrtplib4android's Introduction

Jrtplib4Android

基于开源项目jrtplib,自主编译出jni依赖库,在Android平台上实现RTP/RTCP数据接收、发送等示例。(包含H264数据分包发送,添加时间水印等)

注意:本人采用的是android-ndk-r14b,并不是as自带的。!!!(自带的会出现各种异常)

app编译项目

1、Android实现采集摄像头数据,异步编码为H264数据,通过jni发送至指定接收端;
2、实现网络摄像机RTSP协议对接(单通道视频流);
3、实现接收RTSP服务端的RTP数据,转发至指定接收端。(项目使用是局域网接收摄像机,通过Android手机传递至公网服务器);

jrtp编译项目

接收端实现的功能:

1、接收rtp数据,回调数据至java(目前只有byte[],length,isMarker,可根据需求自行修改);
2、接收rtp数据,解析PS流为H264数据;(1和2,具体要实现哪种,可以自己根据需求修改)
3、接收rtcp、bye命令等,回调至java,通过自定义的int值type来区分,同时传递了数据发送端的IP字符串。

发送端实现的功能:

1、实现FU-A分包发送H264数据;
2、实现发送RTP数据;
3、实现接收rtcp、bye命令等,回调至java,通过自定义的int值type来区分,同时传递了数据发送端的IP字符串。

osd编译项目

实现的功能:

1、实现将NV21格式数据转换为NV12格式,并旋转角度;
2、实现在NV12格式数据上,添加时间水印;

librtmp编译项目

实现的功能:

1、实现发送H264数据至rtmp服务器;
2、实现发送H264封装flv数据至rtmp服务器;
2、实现发送flv视频文件至rtmp服务器;

使用方法

RtpHandle是RTP相关jni操作对象。
initSendHandle方法适用于只发送数据;
initReceiveHandle方法适用于只接收数据;
initReceiveAndSendHandle方法适用于接收并转发数据;

YuvOsdUtils是时间水印相关jni操作对象。
initOsd方法初始化;
addOsd方法实时添加时间水印;
releaseOsd方法最后销毁时调用;

建议与反馈

项目中关于回调数据,建议不要在回调线程中直接处理。一些性能上的优化,暂时使用java来处理。 https://blog.csdn.net/sun8532685/article/details/100703331

jrtplib4android's People

Contributors

qfsun avatar

Stargazers

AD-long avatar 吴驰仁 avatar Kopite__ avatar cvabm avatar sven avatar hawskpy avatar  avatar LCH avatar  avatar aliang avatar  avatar  avatar shakyLL avatar  avatar xinkai avatar PockerKID avatar HanSir_belief avatar  avatar MAX avatar hu bing avatar 李志杰 avatar albertcreasy avatar  avatar  avatar

Watchers

Benny avatar  avatar  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.