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
table of Contents:
An introduction to HLS
Second reference
An introduction to HLS:
HLS--Http Live Streaming is a protocol for real-time streaming defined by Apple. HLS is implemented based on the HTTP protocol. The transmission content includes two parts, one is the M3U8 description file, and the other is the TS media file.
1.M3U8 file
a.M3U8 is a streaming media format, mainly in the form of a file list, which supports both live broadcast and on-demand, especially on Android, iOS and other platforms.
B. Simple example
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4
#EXT-X-MEDIA-SEQUENCE:0
#EXTINF:3.760000,
Out0.ts
#EXTINF:1.880000
Out1.ts
#EXTINF:1.880000
Out2.ts
#EXTINF:1.880000
Out3.ts
Field explanation:
#EXTM3U:
The M3U8 file must contain the label and must be on the first line of the file.
#EXT-X-VERSION:3
M3U8 file version
#EXT-X-TARGETDURATION:4
Each slice will have its own duration, and this label is the integer value of the largest slice after rounding the floating point number.
#EXT-X-MEDIA-SEQUENCE:0
The live sequence of M3U8 live broadcast, when playing M3U8 is turned on, the value of this tag is used as a reference, and the slice of the corresponding sequence number is played.
#EXTINF
The duration of each shard
#EXT-X-ENDLIST
If this tag appears, it means that the M3U8 will not be updated again, and the playback of the segment will end after this tag.
Keep all slice information in the M3U8 file and use this tag at the end. This M3U8 is the on-demand M3U8
#EXT-X-STREAM-INF
The appearance of this label means that this M3U8 file contains sub-M3U8 files, multi-level M3U8 files.
Or when the M3U8 file contains a multi-bitrate M3U8, the label needs to be followed by some attributes to explain.
2.ts file
A:
Ts file bit transmission file, the main video coding format is h264/mpeg4, audio bit is aac/mp3;
B:
The ts file is divided into three layers, the ts layer Transport Stream, the pes layer Packet Elemental Stream, and the es layer Elementary Stream. The es layer is the audio and video data, and the pes layer is the description information of the data frame such as time stamps on the audio and video data. The layer is to add the necessary information for the identification and transmission of the data stream in the pes layer
HLS and M3U8, TS
ts = pes + information necessary for the identification and transmission of data streams
pes = es + audio and video data plus data frame description information such as timestamp
(1) es layer
Es layer refers to audio and video data
H.264 video stream
To pack the H.264 video stream, we must add a NALU (Network Abstraction Layer unit) to the video data. NALU includes nalu header and nalu type. The header is fixed at 0x00000001 (the beginning of the frame) or 0x000001 (in the frame), H.264 The data is composed of slices. The content of slices includes video, sps, pps, etc. The NALU type determines the following H.264 data content
AAC and MP3:
You can check the format analysis of my MP3 and AAC
mp3 format analysis
AAC format analysis
(2) pes layer
The Pes layer is in every video/audio frame, if the silly girl has time stamp and other information
HLS and M3U8, TS
Audio pts and dts are the same, so only pts is needed
The existence of pts and dts caused by the B frame, the pts light and dts of the I and P frames, that is to say, if a video does not have a B frame, then P and pts will always be equal to dts, and read the video frames and retrieved frames sequentially from the file The order is the same as the dts order.
dts=initial value + increment
pts=dts+offset.
HLS and M3U8, TS
(3) ts layer
The ts packet size is fixed at 188 bytes, and the ts layer is divided into three parts: ts header (4 bytes), adaptation field (may exist), payload (pes data).
ts header
HLS and M3U8, TS
The content of the ts layer is identified by the PID value, and the main content includes: PAT table, PMT table, audio stream, and video stream. To parse the ts stream, you must first find the PAT table, as long as you find the PAT, you can find the PMT, and then you can find the audio and video streams. The PID value of the PAT table is fixed at 0. The PAT table and the PMT table need to be inserted into the ts stream regularly, because the user may join the ts stream at any time, this interval is relatively small, usually every few video frames to add PAT and PMT. PAT and PMT tables are necessary, and other tables such as SDT (service description table) can also be added, but the hls stream can be played as long as there are PAT and PMT.
PAT table: Its main function is to indicate the PID value of the PMT table.
PMT table: Its main function is to specify the PID value of the audio and video stream.
adaption
HLS and M3U8, TS
The length of the adaptation area shall include one byte identified by the transmission error indicator. pcr is the program clock reference, pcr, dts, pts are all sampled values of the same system clock, pcr is incremental, so it can be set as dts value, audio data does not need pcr. If there is no field, ipad can play, but vlc can not play. When packing the ts stream, the PAT and PMT tables do not have an adaptation field. If the length is not enough, just fill in 0xff. Both video stream and audio stream need to add an adaptation field, which is usually added to the first ts packet and the last ts packet of a frame, and the middle ts packet is not added.
|
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