diff --git a/TODO b/TODO index 9d265a9..a1a02ef 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,7 @@ - implement chain-reuse for output +- move shared bufs-related code to a separate .c + - get rid of greedy send_chain - remove macros hell from ngx_rtmp_send.c diff --git a/doc/flv.html b/doc/flv.html new file mode 100644 index 0000000..f15feca --- /dev/null +++ b/doc/flv.html @@ -0,0 +1,990 @@ + + +
+ ++ +Flash Video is the name of a file format used to deliver video over the Internet using Adobe Flash Player version 6 or newer. Flash Video content may also be embedded within SWF files. Until version 9 update 3 of the Flash Player, Flash Video referred to a proprietary file format, having the extension .FLV but Adobe introduced new file extensions and MIME types and suggests to use those instead of the old FLV: + +
+File Extension | FTYP | MIME Type | Description | +
---|---|---|---|
.f4v | 'F4V ' | video/mp4 | Video for Adobe Flash Player | +
.f4p | 'F4P ' | video/mp4 | Protected Media for Adobe Flash Player | +
.f4a | 'F4A ' | video/mp4 | Audio for Adobe Flash Player | +
.f4b | 'F4B ' | video/mp4 | Audio Book for Adobe Flash Player | +
.flv | video/x-flv | Flash Video | +
+ +It is possible to place H.264 and AAC streams into the traditional FLV file, but Adobe strongly encourages everyone to embrace the new standard file format. There are functional limits with the FLV structure when streaming H.264 which couldn't be overcome without a redesign of the file format. This is one of the reasons Adobe is moving away from the traditional FLV file structure. Specifically dealing with sequence headers and enders is tricky with FLV streams. Adobe is still working out if it's possible to place On2 VP6 streams into the new file format. +
+ ++Tools to solve FLV-related issues: + +
++You load and play .mp4,.m4v,.m4a,.mov and .3gp files using the same NetStream API you use to load FLV files. There are a few things to be aware of: +
+Codec | Introduced in Flash Player version | Introduced in Flash Lite version | Container Formats | ISO Specification | Codec Id | +
---|---|---|---|---|---|
Sorenson Spark 2) | 6 | 3 | FLV | 2 | +|
Macromedia Screen Video 3) | 6 | - | FLV | 3 | +|
Macromedia ScreenVideo 2 4) | 8 | - | FLV | 6 | +|
On2 TrueMotion VP6-E | 8 | 3 | MOV | 4 | +|
On2 TrueMotion VP6-S | 9.0.115.0 | - | MP4V, M4V | 5 | +|
H.264 (MPEG-4 Part 10) | 9.0.115.0 | - | MP4, F4V, 3GP, 3G2 | ISO 14496-10 | + |
Codec | Introduced in Flash Player version | Container Formats | ISO Specification | Codec Id | +
---|---|---|---|---|
MP3 | 6 | MP3 | 2 | +|
Nellymoser ASAO Codec (speech compression) audio content | 6 | FLV | 5, 6 | +|
Raw PCM sampled audio content | 6 | WAV | 0 | +|
ADPCM (Adaptive Delta Pulse Code Modulation) audio content | 6 | 1 | +||
AAC (HE-AAC/AAC SBR, AAC Main Profile, and AAC-LC) | 9.0.115.0 | M4A, MP4 | ISO 14496-3 | + |
Speex | 10 | FLV | Wiki | 11 | +
Property | Value | Notes | +
---|---|---|
duration | Obvious. | Unlike for FLV files this field will always be present. | +
videocodecid | For H.264 it reports 'avc1'. | + |
audiocodecid | For AAC it reports 'mp4a', for MP3 it reports '.mp3'. | + |
avcprofile | 66, 77, 88, 100, 110, 122 or 144 | Corresponds to the H.264 profiles | +
avclevel | A number between 10 and 51. | Consult this list to find out more. | +
aottype | Either 0, 1 or 2. | This corresponds to AAC Main, AAC LC and SBR audio types. | +
moovposition | int | The offset in bytes of the moov atom in a file. | +
trackinfo | Array | An array of objects containing various infomation about all the tracks in a file. | +
chapters | Array | Information about chapters in audiobooks. | +
seekpoints | Array | Times you can directly feed into NetStream.seek(); | +
videoframerate | int | The frame rate of the video if a monotone frame rate is used. Most videos will have a monotone frame rate. | +
audiosamplerate | The original sampling rate of the audio track. | +|
audiochannels | The original number of channels of the audio track. | +|
tags | ID3 like tag information | +
+A Flash Video file (.FLV file extension) consists of a short header, and then interleaved audio, video, and metadata packets. The audio and video packets are stored very similarly to those in SWF, and the metadata packets consist of AMF data. +
+ +Field | Data Type | Example | Description | +
---|---|---|---|
Signature | byte[3] | “FLV” | Always “FLV” | +
Version | uint8 | “\x01” (1) | Currently 1 for known FLV files | +
Flags | uint8 bitmask | “\x05” (5, audio+video) | Bitmask: 4 is audio, 1 is video | +
Offset | uint32_be | “\x00\x00\x00\x09” (9) | Total size of header (always 9 for known FLV files) | +
Field | Data Type | Example | Description | +
---|---|---|---|
PreviousTagSize | uint32_be | “\x00\x00\x00\x00” (0) | Always 0 | +
+ +Then a sequence of tags followed by their size until EOF. +
+ +Field | Data Type | Example | Description | +
---|---|---|---|
Type | uint8 | “\x12” (0x12, META) | Determines the layout of Body, see below for tag types | +
BodyLength | uint24_be | “\x00\x00\xe0” (224) | Size of Body (total tag size - 11) | +
Timestamp | uint24_be | “\x00\x00\x00” (0) | Timestamp of tag (in milliseconds) | +
TimestampExtended | uint8 | “\x00” (0) | Timestamp extension to form a uint32_be. This field has the upper 8 bits. | +
StreamId | uint24_be | “\x00\x00\x00” (0) | Always 0 | +
Body | byte[BodyLength] | … | Dependent on the value of Type | +
Field | Data Type | Example | Description | +
---|---|---|---|
PreviousTagSize | uint32_be | “\x00\x00\x00\x00” (0) | Total size of previous tag, or 0 for first tag | +
Tag code | Name | Description | +
---|---|---|
0x08 | AUDIO | Contains an audio packet similar to a SWF SoundStreamBlock plus codec information | +
0x09 | VIDEO | Contains a video packet similar to a SWF VideoFrame plus codec information | +
0x12 | META | Contains two AMF packets, the name of the event and the data to go with it | +
+ +The first byte of an audio packet contains bitflags that +describe the codec used, with the following layout: + +
+Name | Expression | Description | +
---|---|---|
soundType | (byte & 0x01) » 0 | 0: mono, 1: stereo | +
soundSize | (byte & 0x02) » 1 | 0: 8-bit, 1: 16-bit | +
soundRate | (byte & 0x0C) » 2 | 0: 5.5 kHz (or speex 16kHz), 1: 11 kHz, 2: 22 kHz, 3: 44 kHz | +
soundFormat | (byte & 0xf0) » 4 | 0: Uncompressed, 1: ADPCM, 2: MP3, 5: Nellymoser 8kHz mono, 6: Nellymoser, 11: Speex | +
+ +The rest of the audio packet is simply the relevant data for that format, as per a SWF SoundStreamBlock. +
+ ++ +The first byte of a video packet describes contains bitflags +that describe the codec used, and the type of frame + +
+Name | Expression | Description | +
---|---|---|
codecID | (byte & 0x0f) » 0 | 2: Sorensen H.263, 3: Screen video, 4: On2 VP6, 5: On2 VP6 Alpha, 6: ScreenVideo 2 | +
frameType | (byte & 0xf0) » 4 | 1: keyframe, 2: inter frame, 3: disposable inter frame | +
+ +In some cases it is also useful to decode some of the body of the video +packet, such as to acquire its resolution (if the initial onMetaData META +tag is missing, for example). +
+ ++TODO: Describe the techniques for acquiring this information. Until then, you can +consult the flashticle sources. +
+ ++ +The contents of a meta packet are two AMF packets. The first is +almost always a short uint16_be length-prefixed UTF-8 string +(AMF type 0x02), and the second is typically a mixed array +(AMF type 0x08). However, the second chunk typically contains +a variety of types, so a full AMF parser should be used. +
+ ++ +It is possible to semi-stream flv over http using a trick which sends the normal headers then skips forward to a desired point in the file and moves the timestamps forward accordingly. +
+ ++A sample php script and fla is available at FlashComGuru +
+ ++Another tool that you can use to stream flv files using http is using Flv4PHP this tool is both a FLV Metadata injector and a stream tool, using php 4.x. this Project is GPL. + +
+ +
+ Discussion +
+<a href="http://hdwebplayer.com">Flv Player</a> +
Check this website to know more about Eben pagan guru Master class..<a href=>]Eben pagan guru blueprint</a>
If you want to know more about the course you can follow the video on youtube about the guru blueprint..
<a href=http://www.youtube.com/watch?v=rm8Spt2_Zv0>Eben pagan guru blueprint</a>
<a href=http://www.youtube.com/watch?v=5MrCM4MnSqM>Eben pagan guru blueprint</a>
<a href=http://www.youtube.com/watch?v=ZEYhOkb9Wys>Eben pagan guru blueprint</a>
you can go here to find out more about the guru masterclass.. <a href=http://www.helpandinfo.com/guru-masterclass-free-training-video-three.html>Eben pagan guru blueprint</a>
You can learn much more about marketing by just listening to this guy talk. he is such an amazing personality. See as eben pagan releases his master class..
guru blueprint.. +
I am working on a project in Flash which the user can draw some animation and then covert the final product as an FLV file so he can share it on facebook and youtube,
I have searched for a suitable solution but yet can’t find any, in go Animat (www.goAnimat.com) engine covert to FLV very smoothly,
So is it possible to guide me on how to do this, or maybe provide my with this service on servers.
I would really appreciate you help on this. +