FMUSER Wirless Transmit Video And Audio More Easier !
es.fmuser.org
it.fmuser.org
fr.fmuser.org
de.fmuser.org
af.fmuser.org ->Afrikaans
sq.fmuser.org ->Albanian
ar.fmuser.org ->Arabic
hy.fmuser.org ->Armenian
az.fmuser.org ->Azerbaijani
eu.fmuser.org ->Basque
be.fmuser.org ->Belarusian
bg.fmuser.org ->Bulgarian
ca.fmuser.org ->Catalan
zh-CN.fmuser.org ->Chinese (Simplified)
zh-TW.fmuser.org ->Chinese (Traditional)
hr.fmuser.org ->Croatian
cs.fmuser.org ->Czech
da.fmuser.org ->Danish
nl.fmuser.org ->Dutch
et.fmuser.org ->Estonian
tl.fmuser.org ->Filipino
fi.fmuser.org ->Finnish
fr.fmuser.org ->French
gl.fmuser.org ->Galician
ka.fmuser.org ->Georgian
de.fmuser.org ->German
el.fmuser.org ->Greek
ht.fmuser.org ->Haitian Creole
iw.fmuser.org ->Hebrew
hi.fmuser.org ->Hindi
hu.fmuser.org ->Hungarian
is.fmuser.org ->Icelandic
id.fmuser.org ->Indonesian
ga.fmuser.org ->Irish
it.fmuser.org ->Italian
ja.fmuser.org ->Japanese
ko.fmuser.org ->Korean
lv.fmuser.org ->Latvian
lt.fmuser.org ->Lithuanian
mk.fmuser.org ->Macedonian
ms.fmuser.org ->Malay
mt.fmuser.org ->Maltese
no.fmuser.org ->Norwegian
fa.fmuser.org ->Persian
pl.fmuser.org ->Polish
pt.fmuser.org ->Portuguese
ro.fmuser.org ->Romanian
ru.fmuser.org ->Russian
sr.fmuser.org ->Serbian
sk.fmuser.org ->Slovak
sl.fmuser.org ->Slovenian
es.fmuser.org ->Spanish
sw.fmuser.org ->Swahili
sv.fmuser.org ->Swedish
th.fmuser.org ->Thai
tr.fmuser.org ->Turkish
uk.fmuser.org ->Ukrainian
ur.fmuser.org ->Urdu
vi.fmuser.org ->Vietnamese
cy.fmuser.org ->Welsh
yi.fmuser.org ->Yiddish
1、 Development of mobile video live broadcast
It can be seen that, from PC to mobile, more and more live broadcast apps are online, and mobile broadcast has entered an unprecedented explosion stage. However, for most mobile live broadcast, it is still mainly implemented by native clients, but HTML5 also plays an irreplaceable role in the mobile live broadcast end, such as HTML5 With the advantages of fast transmission and easy to release, HTML5 can also play live video when it is the most important.
The complete live broadcast can be divided into the following:
(1) Video recording terminal: Generally speaking, it is a computer audio and video input device or a camera or microphone at the mobile terminal. Currently, mobile phone video is the main part.
(2) Video player: it can be a player on the computer, a native player on the mobile phone side, and a video label of HTML5. At present, it is still the main native player on the mobile phone.
(3) Video server: generally, it is a nginx server, which is used to accept the video source provided by the video recording side and provide the streaming service to the video playback end.
2、 HTML5 recording video:
For HTML5 video recording, the powerful webrtc (WEB real time communication) is a technology that supports real-time voice or video conversation in web browser. The disadvantage is that it only supports better on PC chrome and the mobile side is not ideal.
The basic process of recording video with webrtc is:
Call window.navigator.webkitGetUserMedia (obtain the video data of the user's PC camera).
Convert acquired to video stream data to window.webkitRTCPeerConnection (a video stream data format).
Using websocket to transfer video stream data to server
Because many methods need to be prefixed with browser, many mobile browsers do not support webrtc, so the real video recording is still implemented by the client (IOS, Android), and the effect will be better.
3、 HTML5 broadcast live video:
For video playback, you can use HLS (HTTP live streaming) protocol to play live streaming. IOS and Android both support this protocol naturally. It is simple to configure and use video tags directly.
Here is a simple code to play live video using video:
(1) what is HLS protocol:
In short, the whole stream is divided into small files, which are downloaded based on HTTP. Only some are downloaded at a time. The previous mentioned file of.M3u8 introduced in HTML5 broadcast live video is based on HLS protocol, which stores the metadata of video stream.
Each.M3u8 file corresponds to several TS files, which are the data for the real video storage. The m3u8 file only stores the configuration information and related paths of some TS files. When the video is played, the.M3u8 file is dynamically changed. The video label will parse the file and find the corresponding TS file to play. So in order to speed up the speed, the.M3u8 file will be used to analyze the file and find the corresponding TS file for playback. Therefore, in order to speed up the speed, the.M3u8 file will be used to analyze the file and find the corresponding TS file for playback. Therefore, in order to speed up Put it on the web server, and the TS file on the CDN.
The.M3u8 file is actually a M3U file encoded with UTF-8. This file cannot be played by itself, but only the text file containing the playback information.
(2) HLS request process:
The URL of the HTTP request m3u8.
The server returns a playlist of m3u8, which is updated in real time. Generally, the URL of 5 segments of data is given at a time.
The client parses the playlist of m3u8, and then requests the URL of each segment in order to obtain the TS data stream.
(3) HLS live broadcast delay:
We know that the HLS protocol divides the live stream into a small segment of video to download and play. So suppose that the list contains 5 TS files, each TS file contains 5 seconds of video content, then the overall delay is 25 seconds. Because when you see these videos, the host has recorded the video and uploaded it, so the delay is caused by this. Of course, the list length and the size of a single TS file can be shortened to reduce the delay. In the extreme, the list length can be reduced to 1 and the TS duration is 1s. However, this will increase the number of requests and increase the server pressure. When the network speed is slow, more buffer will be generated. Therefore, the TS time recommended by Apple officially lasts for 10s, so it will greatly change the delay of 30s. So the server receives the stream, transcoding, saves, cuts the block, and then distributes it to the client. Here is the root cause of the delay.
For more questions about delays, please refer to Apple's official address:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/FrequentlyAskedQuestions/FrequentlyAskedQuestions.html
However, HTML5 live video has some irreplaceable advantages:
① Good communication, easy to share and other operations.
② It can be released dynamically, which is conducive to real-time iteration of product requirements and rapid launch.
③ Without installing app, open the browser directly.
4、 IOS collection (recording) audio and video data OS
For audio and video acquisition and recording, first, the following concepts are clarified:
(1)Video coding: video coding refers to the way that a file in a video format is converted into another video format file through a specific compression technology. The video recorded by iPhone we use must be encoded, uploaded and decoded before it can be played in the user-side player.
(2)Codec standard: the most important codec standards in video stream transmission include H.261, H.263 and H.264 of ITU, in which HLS protocol supports H.264 format coding.
(3)Audio coding: similar to video coding, the original audio stream is encoded, uploaded, decoded according to certain standards, and played in the player. Of course, audio also has many coding standards, such as PCM code, wma code, AAC code, etc. the audio coding method supported by our HLS protocol is AAC code.
The video and audio data acquisition is mainly divided into the following steps:
(1)the video and audio data acquisition by using the camera on IOS
(2)In IOS, the original audio and video data stream can be collected by avcapturesession and avcapturedevice.
(3)The video is encoded with h264, and the audio is AAC coded. In IOS, there are already packaged coding libraries to realize the coding of audio and video.
(4)The audio and video data after coding are assembled and sealed;
(5)Establish RTMP connection and push it up to the server.
The following is the specific process of collecting audio and video data:
(1) about RTMP:
Real time messaging protocol (RTMP) is a set of live video protocol developed by Macromedia, and now belongs to adobe. As with HLS, it can be used for video broadcast. The difference is that RTMP can not play in IOS browser based on flash, but it is better in real time than HLS. So this protocol is generally used to upload video stream, which is, video stream is pushed to server.
(2) push flow
The so-called streaming refers to sending the audio and video data we have encoded to the video stream server. In IOS code, RTMP streaming is commonly used. Librtmp IOS, a third-party library, can be used for streaming. Librtmp encapsulates some core APIs for users to call. For example, push the API and so on, configure the server address, and then push the transcoding video stream to the server.
So how to build a streaming server?
Simple streaming server is built. Since the video stream we upload is based on RTMP protocol, the server must support RTMP. It may take the following steps:
(1)Install a nginx server.
(2)The RTMP extension of nginx is installed. Configure conf file for nginx
(3)Restart nginx and write the streaming address of RTMP as rtmp://ip : 1935/hls/mystream, where HLS_ Path represents the address of the generated.M3u8 and TS files, HLS_ Fragment represents the length of slice, and mystream represents an instance. The file name to be generated can be set by itself.
5、 User interaction in live broadcast:
For the user interaction in live broadcast, it can be roughly divided into:
giving gifts.
To comment or to play
For gift delivery, DOM and CSS3 can be used to realize the logic of gift sending and some special gift animation on HTML5. The technical difficulties are not very big.
For a barrage, to be a little more complex, you may need to pay attention to the following:
The real-time performance of the projectile can be sent and received in real time by webscock and rendered.
For browsers that do not support websocket, they can only be degraded to long polling or front-end timer sending requests to obtain real-time pop-up.
Animation and collision detection (i.e. no overlap) and so on in the rendering
|
Enter email to get a surprise
es.fmuser.org
it.fmuser.org
fr.fmuser.org
de.fmuser.org
af.fmuser.org ->Afrikaans
sq.fmuser.org ->Albanian
ar.fmuser.org ->Arabic
hy.fmuser.org ->Armenian
az.fmuser.org ->Azerbaijani
eu.fmuser.org ->Basque
be.fmuser.org ->Belarusian
bg.fmuser.org ->Bulgarian
ca.fmuser.org ->Catalan
zh-CN.fmuser.org ->Chinese (Simplified)
zh-TW.fmuser.org ->Chinese (Traditional)
hr.fmuser.org ->Croatian
cs.fmuser.org ->Czech
da.fmuser.org ->Danish
nl.fmuser.org ->Dutch
et.fmuser.org ->Estonian
tl.fmuser.org ->Filipino
fi.fmuser.org ->Finnish
fr.fmuser.org ->French
gl.fmuser.org ->Galician
ka.fmuser.org ->Georgian
de.fmuser.org ->German
el.fmuser.org ->Greek
ht.fmuser.org ->Haitian Creole
iw.fmuser.org ->Hebrew
hi.fmuser.org ->Hindi
hu.fmuser.org ->Hungarian
is.fmuser.org ->Icelandic
id.fmuser.org ->Indonesian
ga.fmuser.org ->Irish
it.fmuser.org ->Italian
ja.fmuser.org ->Japanese
ko.fmuser.org ->Korean
lv.fmuser.org ->Latvian
lt.fmuser.org ->Lithuanian
mk.fmuser.org ->Macedonian
ms.fmuser.org ->Malay
mt.fmuser.org ->Maltese
no.fmuser.org ->Norwegian
fa.fmuser.org ->Persian
pl.fmuser.org ->Polish
pt.fmuser.org ->Portuguese
ro.fmuser.org ->Romanian
ru.fmuser.org ->Russian
sr.fmuser.org ->Serbian
sk.fmuser.org ->Slovak
sl.fmuser.org ->Slovenian
es.fmuser.org ->Spanish
sw.fmuser.org ->Swahili
sv.fmuser.org ->Swedish
th.fmuser.org ->Thai
tr.fmuser.org ->Turkish
uk.fmuser.org ->Ukrainian
ur.fmuser.org ->Urdu
vi.fmuser.org ->Vietnamese
cy.fmuser.org ->Welsh
yi.fmuser.org ->Yiddish
FMUSER Wirless Transmit Video And Audio More Easier !
Contact
Address:
No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620
Categories
Newsletter