Summary of Red5 Streaming media live development (continued)

Source: Internet
Author: User

The previous article documented the acquisition and deployment of the service-side playlists project, which summarizes the bits and pieces of the client's playback of streaming media.

======================================================================================

1. Article III requirements: The terminal through the live streaming address, broadcast the live

Because the platform chooses the Android platform. There are a number of options for playing rtmp streaming streaming media. Android Open source player has vlc,vitamio. Android native player support for rtmp is not a force. So we need to integrate the Android open source player into the project. or choose to use Videojs,jwplayer. Because Android development can be divided into native Android development and web-class Android development (using the PHONEGAP framework), web development is not my forte, so choose a way to use integrated Android open source players.


On the integration of the method, there are a lot of examples on the web, there is no overview, the final choice to use Vitamio as our player.

======================================================================================

2. Twists of the test process

If you use Vitamio as a terminal player for your own streaming media, you need to go through the following rigorous testing steps

2.1 First will flow in the VLC terminal player test (VLC player on the Internet directly download a PC client)

2.2 If you can play it properly on the VLC, then test it using Vplayer (online download apk installed on the Android device)

2.3 or more of the two can play correctly, in the use of Vitamio player to play streaming media

These details are best done strictly, because the above steps in order to confirm whether the flow can be Vitamio play, if a direct play on a stream, out of the question, do not know where the wrong.

Example:

At that time my test selected Shenzhen satellite TV rtmp Flow, first do verification-see whether the player to rtmp protocol flow support.

Shenzhen satellite TV rtmp Flow: rtmp://tsl.s1979.cutv.com:1935/cutvchannellive/axefrth/live

The test results show that the Vitamio is able to play the live stream normally.

Next: Start taking your own live stream to replace the test;

Rtmp;//xxxx/webtv

Test results show: Vitamio playback is an error, open rtmp stream address failed.

There is no access problem because the access rights to the server have been released. So the work goes into a stalemate ....

======================================================================================

3. With a view to the problems arising from the second step, a large amount of information was consulted, mainly on FFmpeg.

This is the previous blog about FFmpeg's compilation and use.

Since the test results of the above two streams are very different, the results are confusing and start due to whether the video coding format in the streams/is related. View streaming media information by using the PC VLC playback terminal (under the Tools menu)


The results of the review are as follows:


However, the video format on your streaming media is:


2.


There are significant differences between the two types of coding formats.

So the goal to how to encode and Shenzhen satellite TV video format, and then play, whether it can solve the problem.

The answer is very regrettable. Even if you pass the video after FFmpeg and the Shenzhen TV live stream coding format consistent, or show, and VLC test results are only the sound of no picture. (The H.264 can be encoded on Linux using the FFmpeg integration X264 that you have compiled.) This depressing time is a reference

Rei's blog, also asked a lot of questions.

http://blog.csdn.net/leixiaohua1020/article/details/12029543

=====================================================================================

4. One address is essential:

FFmpeg official compilation Download Address: Windows version of Ha, there is a static library version, there are dynamic library version. has been compiled, many external libraries have been integrated in.

http://ffmpeg.zeranoe.com/builds/

I asked the question is also using the download of the Windows version of the FFmpeg to do, the Linux version is too cumbersome to compile their own pain, and some third-party libraries you do not necessarily integrate the full, so decisively chose the Windows version.

How to use Ffplay and FFmpeg code is not to repeat, the blogger's problem bar reply very clearly. I also thank the bloggers for their help.

======================================================================================

5. Unfortunately, I changed the address of the live stream to: "Rtmp;//xxxx/webtv live=1" in the Vitamio directly to the error:

The bottom is reported avformat_open_input:operation not permitted:-1 Error debug information: Detected librtmp style URL parameters, these aren ' t suppo RTed by the Libavformat internal RTMP handler currently enabled. The documentation for the correct way to pass parameters.

According to the Blogger's reply, I was initially certain that the Vitamio underlying ffmpeg did not contain the LIBRTMP library.

======================================================================================

6. So the direction of efforts to replace the Vitamio bottom FFmpeg library, but this method is too unreliable, there is no solution to the problem, the compiler has a lot of risks, the more fortunate is: the Vitamio team dedicated to maintain Vitamio. New version of Vitamio plugin 4.2. Integrated on this version. Spread out ....


Very surprised, also very lucky ~ ~ ~ ~

======================================================================================

7. Video Coding format Unification problem

Through the test results of the Red5 streaming media rtmp flow, all the audio and video codes are in the following format:



Using the FFmpeg command line for audio and video coding transcoding

Ffmpeg-i.. /gy.flv-vcodec flv1-r 15-s 720*576-q:v 6-aspect 1.7777-acodec libmp3lame-ac 1-ar
11025-ab 16k-f flv-y. /gy_ffmpeg.flv

Deploy to streaming media server after transcoding

Test.

You can also synchronize your tests using the Ffplay command line:

Ffplay-i "Rtmp://xxx/playlisttest/webtv live=1"

Note that the encoding of * * * audio must be 11025HZ, bit rate: 16kb/s. Adebo's rtmp manual is clearly required.

This is in a voice and video group to ask the master learned. If you hear the noise with another sample rate, there is a picture.

======================================================================================

8. Why is the demo level.

The reason is that the demo level is, in the online very few examples of Red5 live, video conferencing or video chat and other examples. This only enables normal interaction between the server and the client. As a whole, it red5+android the path of the road. However, a problem was found in the playback stream, that is, the buffer time is too long, and not from the first second of the flow to play, there is a direct jump frame phenomenon. and continue to develop research.

Related Article

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.