当前位置: 首页 > 软件库 > 手机/移动开发 > >

rtmp-rtsp-stream-client-java

授权协议 Apache-2.0 License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 訾凯歌
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

rtmp-rtsp-stream-client-java

Sponsored with ��   by
Stream Chat
Enterprise Grade APIs for Feeds & Chat. Try the Android Chat tutorial ��


Library for stream in RTMP and RTSP. All code in Java.

If you need a player see this project:

https://github.com/pedroSG94/vlc-example-streamplayer

Wiki

https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/wiki

Permissions:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--Optional for play store-->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />

Compile

To use this library in your project with gradle add this to your build.gradle:

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}
dependencies {
  implementation 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:2.1.1'
}

Features:

  • Android min API 16.
  • Support camera1 and camera2 API
  • Encoder type buffer to buffer.
  • Encoder type surface to buffer.
  • RTMP/RTSP auth.
  • Audio noise suppressor.
  • Audio echo cancellation.
  • Disable/Enable video and audio while streaming.
  • Switch camera while streaming.
  • Change video bitrate while streaming (API 19+).
  • Get upload bandwidth used.
  • Record MP4 file while streaming (API 18+).
  • H264, H265 and AAC hardware encoding.
  • Force H264 and AAC Codec hardware/software encoding (Not recommended).
  • RTSP TCP/UDP.
  • Stream from video and audio files like mp4, webm, mp3, etc (Limited by device decoders). More info
  • Stream device display (API 21+).
  • Set Image, Gif or Text to stream on real time.
  • OpenGL real time filters. More info
  • RTMPS and RTSPS.
  • RTSP H265 support (Waiting FLV official packetization to add RTMP support).

iOS version (under develop):

https://github.com/pedroSG94/rtmp-rtsp-stream-client-swift

Other related projects:

https://github.com/pedroSG94/RTSP-Server

https://github.com/pedroSG94/AndroidReStreamer

https://github.com/pedroSG94/Stream-USB-test

Real time filters:

NOTE:

In library version 2.0.9, the filters was refactored. Check the wiki link to migrate your implementation.

https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/wiki/Real-time-filters

Use example:

This code is a basic example.I recommend you go to Activities in app module and see all examples.

RTMP:

//default

//create builder
RtmpCamera1 rtmpCamera1 = new RtmpCamera1(openGlView, connectCheckerRtmp);
//start stream
if (rtmpCamera1.prepareAudio() && rtmpCamera1.prepareVideo()) {
  rtmpCamera1.startStream("rtmp://yourEndPoint");
} else {
 /**This device cant init encoders, this could be for 2 reasons: The encoder selected doesnt support any configuration setted or your device hasnt a H264 or AAC encoder (in this case you can see log error valid encoder not found)*/
}
//stop stream
rtmpCamera1.stopStream();

//with params

//create builder
RtmpCamera1 rtmpCamera1 = new RtmpCamera1(openGlView, connectCheckerRtmp);
//start stream
if (rtmpCamera1.prepareAudio(int bitrate, int sampleRate, boolean isStereo, boolean echoCanceler,
      boolean noiseSuppressor) && rtmpCamera1.prepareVideo(int width, int height, int fps, int bitrate, int rotation)) {
  rtmpCamera1.startStream("rtmp://yourEndPoint");
} else {
 /**This device cant init encoders, this could be for 2 reasons: The encoder selected doesnt support any configuration setted or your device hasnt a H264 or AAC encoder (in this case you can see log error valid encoder not found)*/
}
//stop stream
rtmpCamera1.stopStream();

RTSP:

//default

//create builder
//by default TCP protocol.
RtspCamera1 rtspCamera1 = new RtspCamera1(openGlView, connectCheckerRtsp);
//start stream
if (rtspCamera1.prepareAudio() && rtspCamera1.prepareVideo()) {
  rtspCamera1.startStream("rtsp://yourEndPoint");
} else {
 /**This device cant init encoders, this could be for 2 reasons: The encoder selected doesnt support any configuration setted or your device hasnt a H264 or AAC encoder (in this case you can see log error valid encoder not found)*/
}
//stop stream
rtspCamera1.stopStream();

//with params

//create builder
RtspCamera1 rtspCamera1 = new RtspCamera1(openGlView, connectCheckerRtsp);
rtspCamera1.setProtocol(protocol);
//start stream
if (rtspCamera1.prepareAudio(int bitrate, int sampleRate, boolean isStereo, boolean echoCanceler,
      boolean noiseSuppressor) && rtspCamera1.prepareVideo(int width, int height, int fps, int bitrate, int rotation)) {
  rtspCamera1.startStream("rtsp://yourEndPoint");
} else {
 /**This device cant init encoders, this could be for 2 reasons: The encoder selected doesnt support any configuration setted or your device hasnt a H264 or AAC encoder (in this case you can see log error valid encoder not found)*/
}
//stop stream
rtspCamera1.stopStream();
  • packagecom.awifi.video.media.test;importorg.bytedeco.javacpp.avcodec;importorg.bytedeco.javacv.FFmpegFrameGrabber;importorg.bytedeco.javacv.FFmpegFrameRecorder;importorg.bytedeco.javacv.Frame;importor

  • RTSP、 RTMP、HTTP的共同点、区别 共同点: 1:RTSP RTMP HTTP都是在应用应用层。 2: 理论上RTSP RTMPHTTP都可以做直播和点播,但一般做直播用RTSP RTMP,做点播用HTTP。做视频会议的时候原来用SIP协议,现在基本上被RTMP协议取代了。   区别: 1:HTTP: 即超文本传送协议(ftp即文件传输协议)。 HTTP:(Real Time Strea

  • 视频-Android上的实时流RTMP / RTSP播放器,无需使用webview(WOWZA服务器) 我正在开发一个Android应用程序,我想在其中发布和播放视频... 我想要的是: 我的应用记录了一个视频,该视频已发送到服务器 录制的视频将同时直播到另一个Android设备。 我已经使用javac和ffmpeg完成了第一个任务。 我被困在第二项任务中。 我进行了大量搜索以从服务器流式传输视频

 相关资料
  • 要将视频从IP cam流到Youtube,我使用的代码(通过Ubunu):ffmpeg-f lavfi-I anullsrc-rtsp\u transport tcp-Irtsp://user:psw@192.168.0.100:554-tune zerolatency-vcodec libx264-pix\u fmt-c:v copy-c:a aac-strict experimental-f

  • rtmp 1.0规范中,指定了RTMP的握手协议: c0/s0:一个字节,说明是明文还是加密。 c1/s1: 1536字节,4字节时间,4字节0x00,1528字节随机数 c2/s2: 1536字节,4字节时间1,4字节时间2,1528随机数和s1相同。 这个就是srs以及其他开源软件所谓的simple handshake,简单握手,标准握手,FMLE也是使用这个握手协议。 Flash播放器连接服

  • docker nginx rtmp 一个Dockerfile从源代码安装NGINX,nginx-rtmp-module和FFmpeg HLS实时流媒体的默认设置。 建立在Alpine Linux上。 Nginx 1.15.3 (从源代码编译) nginx-rtmp-module 1.2.1 (从源代码编译) ffmpeg 4.0.2 (从源代码编译) 默认HLS设置(见: nginx.conf)

  • 一个采用MIT协议授权的国产的简单的RTMP/HLS 直播服务器,其核心的价值理念在于简单高效。 使用方法: tep 1: build srs tar xf simple-rtmp-server-*.*.tar.gzcd simple-rtmp-server-*.*/trunk./configure --with-ssl --with-hlsmake step 2: start srs ./obj

  • 战斗民族俄罗斯人民开发的一款NGINX的流媒体插件,除了直播发布音视频流之外具备流媒体服务器的常见功能 比如推拉流媒体资源 基于HTTP的FLV/MP4 VOD点播 HLS (HTTP Live Streaming) M3U8的支持 基于http的操作(发布、播放、录制) 可以很好的协同现有的流媒体服务器以及播放器一起工作 在线调用ffmpeg对流媒体进行转码 H264/AAC音视频编码格式的支持

  • anyRTC-RTMP-OpenSource anyRTC-RTMP开源项目即将迎来2.0版本,本项目是开源的客户端,基于RTMP协议的推流拉流,采用跨平台架构设计,一套代码支持Android、iOS、Windows、Mac、Ubuntu等平台。 直播涉及的流程:『音视频采集->编码->传输->解码->音视频渲染』本项目统统包含,这不是软文,这是实实在在的商业级实战代码;无论是你新手还是老司机,我