rtmp-rtsp-stream-client-java


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

rtmp-rtsp-stream-client-java

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 (Becoming)

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" /> <!--some devices need it--> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera2.full" /> <uses-feature android:name="android.hardware.camera2.autofocus" />

Compile

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

allprojects {

repositories {

  maven {
 url 'https://jitpack.io' 
}

}
 
}
 dependencies {

compile 'com.github.pedroSG94.rtmp-rtsp-stream-client-java:rtplibrary:1.2.2' 
}
 

Features:

  • Android min API 16.
  • Support camera1 and camera2 API
  • Encoder type buffer to buffer.
  • Encoder type surface to buffer.
  • RTMP/RTSP auth wowza.
  • Audio noise suppressor.
  • Audio echo cancellation.
  • Disable/Enable video and audio while streaming.
  • Switch camera while streaming.
  • Change video bitrate while streaming (API 19+).
  • Record MP4 file while streaming (API 18+).
  • H264 and AAC hardware encoding.
  • RTSP TCP/UDP.
  • Stream from MP4 file (only video, no sound, API 18+).
  • Stream device display(API 21+).
  • Set Image, Gif or Text to stream on real time.
  • RTMPS and RTSPS

Backlog

  • H265 support

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(surfaceView, 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(surfaceView, 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, boolean hardwareRotation, 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(surfaceView, 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(surfaceView, 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, boolean hardwareRotation, 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();
 

Resources

Simple custom ViewGroup with two shapes inside and simple scale animation. You can flexible customizing it. (For example separating shape into two buttons or into single).

Want to detect human faces on a camera preview stream in real time? Well, you came to the right place.

FaceDetector is a library which:

  • detects faces
  • works on Android
  • very simple to use
  • comes with Fotoapparat integration (but you can use it with whatever you like)
  • with a C++ core which can easily be ported to iOS (we have plans for that)

A cute day night switch for android.

Android library to use android utils with annotations.

Combined both TedBottomPicker and Camera View, to get the View Similar to ImagePickers of Olx.

We can Pick Images From Gallery and Camera in two modes (Single, Multi), and pick multiple images from both Camera and Gallery.

This is the RxJava2 port of the RxGroups project developed by AirBnb. The branch rx-2.0 has the Rx2 changes. The changes have been done on master branch of RxGroups. The following documentation written for RxGroups by AirBnb applies to Rx2Groups as well. All the API and package names originally written by AirBnb remains as it is. I have transitioned all the RxJava APIs(including the unit tests) to RxJava2.

RxGroups lets you group RxJava Observables together in groups and tie them to your Android lifecycle. This is especially useful when used with Retrofit.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes