Implementation of RED5 on-demand and live broadcasting

Source: Internet
Author: User
Tags live chat flv file

(i) Red5 Streaming Media Server Introduction
Red5 is an open source Flash streaming media server with Java development. It supports: Convert audio (MP3) and video (FLV) to play stream, record client stream (FLV only), share object, live stream release, Remote call. Red5 uses RSTP as the streaming media transport protocol, and in some of its own examples, it demonstrates some of the basic features of online recording, Flash streaming, live chat, video conferencing, and more.
(ii) Introduction of the RTSP protocol
RTSP (real Time streaming Protocol), live streaming protocol, is an application-level protocol in the TCP/IP protocol system, and is submitted by the IETF RFC standard by Columbia University, Netscape, and RealNetworks Corporation. This protocol defines how a one-to-many application can efficiently transmit multimedia data over an IP network. RTSP is architecture-based on RTP and RTCP, and it uses TCP or RTP to complete the data transfer. HTTP transmits HTML compared to RTSP, while RTSP transmits multimedia data. HTTP requests are made by the client, the server responds, and when RTSP is used, both the client and the server can make a request that RTSP can be bidirectional.
(iii) Introduction of Juv-rtmp-client-1.5.10.jar
A charge of foreign rtmpclient, it is equivalent to a RED5 server component, which encapsulates how to package into RTMP protocol data, connect streaming media server, streaming media communications and other functions. This jar package is charged, but the charges will be someone to crack, here is the download cracked version:

(iv) on-demand and live broadcasting
1) Android uses camera to capture video data
? Using Localserversocket to capture real-time streaming data from video data, Android comes with Localserversocket that are different from Java ServerSocket. Because Localserversocket both the client and the server must be native, we can set up a client localsocket to send data to the server and receive data calls on the server when we call Recodmedia to record the video juv-rtmp- The client packages the received data into the RTMP protocol data and sends the data to the streaming media server.
? Using the Android camera to record data, the main use of the camera's callback callback interface, in this callback interface can receive real-time camera recorded video data, the recorded video data is the YUV420SP format of the data stream, which is the most primitive data flow , it is not possible to display the server interface. Convert the data stream into YUV420SP2RGB format data, and then use Juv-rtmp-client to send data to the streaming media server.
2) Send video data to the streaming media server
? Juv-rtmp-client This jar package encapsulates many of the methods of interacting with streaming media servers, and of course the video data transfer format. Streaming media Services provides three formats for transmission: Record, Live, Append.
? Record mode is the real-time video data written to your RED5 server project inside, when you connect to the server can choose to watch the server received video data, but this is not real-time, no matter when you look at the video data from the first frame of the data to start watching, this is called on-demand
? Live mode is the real-time video data stream to the server, do not store any files on the server, is called live broadcast, no matter when the watch is currently recording the screen.
3) Streaming media server play FLV file and video Live streaming method
? Red5 after the installation is complete, create a new Red5 project, and when Android connects to the service your new project, it automatically creates a stream folder, which is primarily responsible for storing streaming media files.
? Open the Address bar input: Streaming server address, and connect to the Red5 with the player debugging, publisher interface, in this debugging window write your streaming address, project name and you need to connect the real-time stream publishing name, click Play can play your recorded video in real-time.

Implementation of RED5 on-demand and live broadcasting

Contact Us

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.