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
Recently began to contact the video live project, I also summarized some video live related concepts, technologies and solutions.
First of all, understand the concept of live video. Several common video protocols are: RTMP, http-flv, HLS, RTP / RTCP.
Then we will explain the whole process of live broadcasting and related technologies.
1、 Live video protocol
In the field of live broadcasting, there are two types of live broadcasting: interactive live broadcasting and non interactive live broadcasting.
Non interactive live broadcasting (such as: Live parade, NBA Live Broadcasting, Champions League live broadcasting, etc.) is not highly interactive, allowing a delay of 10 seconds or more. It is characterized by relatively few sources and suitable for multi-channel transcoding (users can watch it according to network conditions).
The typical scenes of interactive live broadcasting include show live broadcasting, game live broadcasting, etc. Because of the high requirements for the interaction between the anchor and the audience, these live broadcasts are required to be delayed within 5S. The characteristics of interactive live broadcasting are: more sources, not suitable for multi-channel transcoding, intermediate server only as a transit role.
The media of live content transmission is the network, and the corresponding protocols are needed to transmit video or audio in the network. At present, the common protocols suitable for live scenes are as follows.
1. RTMP protocol (not supported by HTML 5, supported by flash)
RTMP is a streaming media protocol, which is Adobe's patent protocol. Based on TCP, it is very popular in China.
Popular reason: the support of open source software and open source library is stable and complete, and the most commonly used streaming and streaming solutions can basically run stably. For example: open source librtmp push stream library, service side has nginx RTMP plug-in, pull stream has ijkplayer play library.
2. Http-flv protocol (not supported by HTML 5, supported by flash)
That is to use HTTP protocol to stream media content. HTTP is simpler and better known than RTMP. The content delay can also be 2-5 seconds, and the opening speed is faster, because HTTP itself has no complex state interaction. So from the perspective of latency, http-flv is better than RTMP.
3. HLS protocol (HTML support, Flash support)
HTTP live streaming is a streaming media transport protocol based on HTTP proposed by apple. HLS has a very big advantage: HTML5 can be directly opened and played; this means that a live link can be shared through wechat and other forwarding, without the need to install any independent app, with a browser, so it is very popular. Social live app, HLS is just needed. The live stream URL based on HLS is an m3u8 file, which contains several recent small video TS files. The delay of this playback mode is relatively high (which is related to the size of TS file), and it can achieve 5-7 seconds delay in the same city network.
4. RTP / RTCP protocol
Real time transport protocol is a transport layer protocol for multimedia data stream on Internet. RTCP transmits the signaling of interactive control and RTP transmits the actual media data.
RTP is widely used in video surveillance, video conference and IP phone, because one of the important experience of video conference and IP phone is strong real-time content.
Compared with the above three protocols, one important difference between RTP and them is that UDP protocol is used to transmit data by default, while RTMP and HTTP are based on TCP protocol.
Use scenario analysis: the scene of real-time audio and video stream does not need reliable guarantee, so there is no need to have a retransmission mechanism. It is not important to see the image and sound in real time, lose some content when the network jitters, blur the picture and splash screen. In order to retransmit, TCP will cause delay and asynchrony. If a certain section of content arrives after one second due to retransmission, then the whole conversation will be delayed by one second. With the network jitter, the delay will increase to two seconds or three seconds. If the client does not handle the playback, the direct broadcast experience will be seriously affected. How to optimize, will be explained in the following article.
Conclusion: in the selection of live broadcast protocol, if RTMP or http-flv is selected, it means that there is a content delay of 2-5 seconds, but as far as the open delay is concerned, http-flv is better than RTMP. HLS has a content delay of 5-7 seconds. Choosing RTP for live broadcast can delay the live broadcast within 1 second. However, as far as we know, the major CDN manufacturers do not support live broadcast based on RTP, so the current domestic mainstream is RTMP or http-flv.
2、 Video live broadcast process
The technical process related to live video is: real-time video stream acquisition --- video stream coding --- video stream transmission --- video stream decoding --- video playing.
1. The idea of real-time video capture
a) By setting setpreviewcallback in Android camera shooting preview, the onpreviewframe interface is realized to capture the data of each video stream in real time.
b) Through Android mediarecorder, bind localsocket in setoutputfile function.
c) Streaming media server mode, using ffmpeg or getstreamer to get camera video.
2. The realization of video compression coding
a) Without encoding, the original yuv420sp video frame is transmitted directly through socket.
b) JEPG compresses the original yuv420sp video frame into H.264 and then transmits it.
c) H.264/avc. The original yuv420sp video frame is compressed into H.264 and then transmitted. Common open source encoders based on H264 include JM, x264, t264, hdot264, etc
d) . mpeg4. Compress the original yuv420sp video frame into MPEG4 and then transmit
3. The idea of video transmission
a) . socket transmission
b) . HTTP transport
c) . RTP / RTSP transmission
d) . streaming media server mode, such as live555, etc
4. The realization of video decoding
a) . decoder corresponding to encoding
5. The idea of video playing
a) . through Android videoview
b) . via Android mediaplay
c) . paste frame image directly through canvas
|
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