Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
<span id="Label3"></p><p><p>Recently want to achieve an Android live, but for this aspect of the data are relatively fragmented, initially intended to use FFMPEG to achieve the code push stream, during the collection of data, found a few powerful open source libraries, directly avoid the JNI code, integrated only with a small amount of Java code can be encoded, Push stream and fetch stream play, organize a bit and do a demo, here to record</p></p><p><p>：<br></p></p><p><p>Coding and push flow, there are two options:</p></p> <blockquote> <blockquote> <p>One:<br>Using JAVACV to achieve, and eventually used ffmpeg to encode and push the stream, JAVACV to achieve direct access to the camera frame data<br>The code that needs to be implemented on its own is simply to turn on the camera, write a preview of the surfaceview, and then implement Previewcallback to give JAVACV the data for each frame of the camera<br>JAVACV address: HTTPS://GITHUB.COM/BYTEDECO/JAVACV<br>Demo Address: Https://github.com/beautifulSoup/RtmpRecoder/tree/master</p> <p>Two:<br>Using Android's own encoding tool, can be hard-coded, there is a domestic big God Open-source package is a well-developed library yasea, the first method needs to implement the camera acquisition part is packaged together, to carry out some simple configuration can realize the coded push stream, And Yasea currently has direct support for the Camera's eager swap, and various filter effects<br>Yasea address (built-in demo): Https://github.com/begeekmyfriend/yasea</p> </blockquote> </blockquote><p><p>Server</p></p> <blockquote> <blockquote> <p>Streaming media server I'm using srs, project Address: Https://github.com/ossrs/srs<br>About the SRS compilation, configuration, deployment, in the official wiki has been written in detail, and SRS is also a domestic developer open source projects, with all Chinese documents, it seems very convenient<br>Here is the most basic simple compilation deployment process for Android Live streaming (ii) SRS Streaming Media Server deployment</p> </blockquote> </blockquote><p><p>Player</p></p> <blockquote> <blockquote> <p>Android play using vitamio, or the domestic open-source player, is not feeling the domestic predecessors more and more Dick ^~^!<br>Vitamio supports almost all common video formats and streaming protocols<br>Vitamio address (built-in demo): Https://github.com/yixia/VitamioBundle</p> </blockquote> </blockquote><p><p>The Yaesa library is used here to introduce the flow of live implementation:<br>One: using Yaesa for Camera capture, encoding and then streaming to the SRS server rtmp<br>Two: deploying an SRS streaming media server<br>Three: use Vitamio to stream playback</p></p><p><p>Coded and pushed streams have been integrated, demo Address: https://github.com/SiKang123/LiveTest</p></p>
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.