How to build the live broadcast system of mobile phone program Front-end push flow
1. Push flow can take command: ffmpeg-i input-vcodec copy-acodec copy-f flv
Rtmp://127.0.0.1/live/cgstream0
Input can be a live stream, or it can be a file, if the file needs to be added-re. The need to use the 127.0.0.1
Replace the IP address of the machine where rtmp is located.
Use the command to push the time stamp information can not be arbitrarily modified, to achieve a satisfactory result or to be implemented in code.
The Main method code is as follows:
1. Open the video stream, filename can be a file name or a live stream URL.
2. Create the output context and the output stream, the format of the output stream needs to be set to FLV
3. Reading audio and video packets from the input stream
Configuration of the server side
Server can choose Crtmpserver,crtmpserver Open source, can be run under the Windows platform and Linux platform
。 With the improvement of video quality, basically the resolution of video is high definition (1080p), the rate of bitrate will basically
Above 4M. Imagine if the server network card Select Gigabit Network card, a single network card can support up to 200 multi-channel. Generally speaking
, the server CPU configuration is much higher than the average computer, support hundreds of-way concurrency is not a performance issue.
Three. If playing on the Web page (IE), you can choose Jwplayer, if the plug-in is also possible. Android side
Players can also play Crtmpserver forwarded audio and video streams if the underlying base is ffmpeg (FFmpeg need to introduce
Librtmp library), the same as the iOS system. The URL to play is rtmp:/
How to set up!
1. First download the Crtmpserver service (can be downloaded directly from the group), run double-click Folder Crtmpserver.exe,
If there is no flashback, the operation is successful.
2. Download Ffmpeg.exe (can be downloaded directly from the group), execute ffmpeg-i at the command line Input-vcodec
Copy-acodec copy-f flv Rtmp://127.0.0.1/live/cgstream0
The 127.0.0.1 is changed to the address of the server where the Crtmpserver.exe resides. If you push the stream under Linux, you need a Linux version
The FFmpeg. Cgstream0 can be arbitrarily modified as needed. Under the Windows platform if the push stream succeeds FFmpeg will be a
Direct printing information, error will also have a corresponding prompt.
3. Play: Play can be used Ffplayer.exe (can be downloaded from the group, this tool for RTMP stream support is not very good,
The address played is Rtmp://127.0.0.1/live/cgstream0 live=1) and can also be used with the Cgplayer player.
4. Above is just a simple live platform, if you need to enter the live broadcast market platform, this simple live platform does not apply, we suggest you still find professional live app source service provider for you to build. In order for more live people to have
belong to their own live platform and for every live person to create a live dream as a concept, now live software source has more interesting new features: Game Live, one-to-one live, short video, private live, treasure game, etc., support a variety of two development and so on.
Clouded Leopard Square Live source, mobile live system building experience to share!