Recommended scheme for video player during seven cattle use

Source: Internet
Author: User
Qiniu Seven cow problem solution

A lot of seven cattle users in the use of seven cattle cloud storage process to encounter the problem of video player selection, here I do a simple recommendation. Audio and video support audio and video playback

In the process of setting up a video application relying on seven cattle cloud storage, the user often encounters the problem of playback: Choose what kind of player. What encoding and container formats are used. How to adapt to a variety of clients. Wait a minute. The requirements of the player

Video applications typically require the player to have the following basic features:

Multi-client support. Includes: PC side (Web playback) and mobile end (ios,android, etc.). A platform-supported player helps simplify development and circumvent the differences between platforms.
Commonly used audio and video coding format support. Common coding formats are: Video H264, audio MP3 and AAC. These audio and video formats are widely used and have good compatibility.
Commonly used container format support. Common container formats include: FLV, MP4, HLS (m3u8/mpeg-ts), MP3,AAC. By satisfying these formats, you can overwrite most of the application scenarios.
Play data statistics. Broadcast statistics are mainly used for users to watch statistics, billing, basic service status analysis, user behavior analysis and so on.
Advertising. Advertising is an important means of transformation of video applications.
Appearance customization. Visual customization helps audio and video applications to beautify the interface and improve the user experience.
The selection of the player

There are many players available to choose from, but the number of players that can support the above function well is few and often used:

Ckplayer:http://www.ckplayer.com
grindplayer:http://osmfhls.kutu.ru/docs/grind/The following table lists the functional features of these players: Seweise palyer JW player Free+hlsprovider Ckplayer Grindplayer main format mp4, FLV, m3u8 mp4, FLV, m3u8 mp4, flv mp4, FLV, m3u8 playback technology FLASH&HTML5 FLASH&HTML5 Support support for FLASH&HTML5 appearance settings support support unsupported supporting supported AD support support supporting support supporting statistics support supports supported Pro support supported supporting support supporting supported support support supports DVR support does not support support for live RTM P, HLs rtmp, HLS rtmp HLS HLS encryption support not supported (requires premium and enterprise version) do not support 128bit charge free/Open source free/open source (not for commercial use) free open source

As you can see, JW player is the most complete feature. Its free version has limitations, such as no HLS support, but there are some open source plug-ins that can complement these features. The main problem with the JW player free version + plugin is that the free version is not available for commercial use. There are a lot of ckplayer features, but the lack of HLS playback support on the web is a barrier to use. Grindplayer function is more comprehensive, usually under the use of conditions, the use of foot assignment.

So, Premium's JW player is the best option if you can afford to pay for it. If audio and video applications want to use a free player and have no need for appearance settings, you can use Grindplayer. If the user does not need HLS support, then you can use Ckplayer. If Grindplayer and Ckplayer can not meet the requirements, but also free, then the free version of the JW player+ plug-in. It should be stated, however, that this form may be legally risky because the free version of JW Player cannot be used for commercial purposes. Selection of formats

The choice of audio-video coding and container format needs to take into account the different playback platforms and players, and also need the least resource consumption and development.

We first recommend using a better generic format. The most popular encoding format is H264, and most browsers, mobile terminals, and players support this encoding format. The most common audio formats are MP3 and AAC, both of which receive most platform support. Therefore, audio and video applications should be as much as possible to generate video files with these codes, so as to eliminate the trouble of further coding conversion. If the application can not control the source audio and video encoding, then the audio and video upload after the use of seven cattle cloud memory audio and video transcoding function, generate playback of the required audio and video.

The container format is relatively complex. Support for different playback platforms is different. However, if you choose the right player, then this choice can be a lot simpler. In general, the FLV format is mainly used for flash players, and MP4 support is good on HTML5. On the mobile side (IOS, Android), the main support MP4 and HLS. The FLV format cannot be played because the iOS side rejects Flash. If we want to use a unified format on all platforms, then only MP4. So, in general, we recommend using MP4 as the primary format for video playback.

The disadvantage of MP4 is that the drag playback (seek) support is not good. Drag playback is a common type of playback behavior of users, when users need to skip certain content, or audio and video applications to support the progress bar and thumbnail function, drag playback plays a very important role. Normally, the player needs to cache the MP4 audio and video files to a drag-and-drop point before it can begin to play formally. But this can cause users to wait for a long time and generate a lot of waste traffic. There are a number of tools to help the server provide support for "start= ..." such as parameters, but there are many limitations and problems in their use. A more efficient way is to cut the long video into fragments (usually 5-10 minutes), strung together by a playlist. When the player drags the playback, it downloads only the fragments involved, enhances the response, and reduces the waste flow.

However, the feature of this long video slice requires additional support from the player, and the existing player does not support it much. The shortcut is to use HLS. HLS, although usually used for direct broadcast, can also be used on demand. The practice is to make a long video slice and then index it with the m3u8 file, which is parsed by the player and automatically loaded and played.

HLS's problem is that the PC-side player support is not ideal, Flash Player and desktop browser HTML5 are not native support HLS. As a result, we use HLS as an important capability when selecting the player. Most of the four types of players listed above support the HLS protocol. Therefore, we recommend that users select the player that supports web-side HLS, and use the video slicing function of seven cow cloud storage to convert it to HLS protocol, simplify application development and improve user experience. For HLS playback related support, please refer to the Seven cattle cloud storage play HLS

In addition, for some applications, we would like to use different audio and video resolution and bit rate for different clients to adapt to different usage environments. For example, the mobile end uses a lower bit rate and audio and video quality, while the PC side uses a higher rate and quality. Further, you can allow users to automatically or manually select audio and video quality according to their different network environment. This requires the support of multiple code rates for audio and video playback. HLS itself supports multiple-bit-rate audio and video streaming, which can be easily implemented. For HLS multiple bit rate support, please refer to how to use the seven Neu Yun storage to achieve HLS multiple bit rate playback case

Suppose there is a video file: Sintel_trailer.mp4, to HLS playback. Need to do three things:

Upload the file to seven cattle cloud storage. Specific Upload method reference upload operation.
Use the avthumb/m3u8 feature to convert it to a HLS media file. The conversion can be performed using the data preprocessing function at upload time, or the FOP is persisted after the upload is completed. However, either way, you need to use the SaveAs function transcoding result to save as the specified name (the. m3u8 filename suffix is required).
The result of the transcoding is constructed to download the url:http://ztest.qiniudn.com/sintel.m3u8, then put into the player, or play the parameters of the page. The most important for everyone to recommend a free play plugin

Plugin Address: Https://github.com/jackzhang1204/sewise-player
Demao:http://jackzhang1204.github.io/sewise/sewise_player/demos/index.html

The following playback page demonstrates several player playback sample videos:

HLS:

Seweizhi:http://seweizhi.qiniudn.com/demao.html
Grindplayer:http://www.flashls.org/latest/examples/osmf/grindplayer.html
Seweizhi:http://jackzhang1204.github.io/sewise/sewise_player/demos/index.html

MP4:
Seweizhi:https://github.com/jackzhang1204/sewise-player

FLV:
Seweizhi:http://jackzhang1204.github.io/sewise/sewise_player/demos/index.html
About Us Job Opportunities edit Page New page Shanghai ICP 备 No. 11,037,377th-5 license

Copyright (c) qiniu.com

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.