3/18/12

File Structured and Examples

Basic File Structured

There are 6 basic file structure

1.Pile
2.Sequential File (SF)
3.Indexed SF
4.Indexed File (File berindeks majemuk)
5.Directed Hashed File
6.Multiring File

File access methods

• Some file systems provide different access methods that specify
ways the application will access data
• Sequential access
– Read bytes one at a time, in order
– This is the most common mode.
• Random access
– Random access given a block/byte #
– Examples: data set for demand paging, libraries, databases. . .
• Keyed/Indexed access
– FS contains an index to a particular field of each record in a file
– Apps can find a file based on value in that record (similar to DB)
– Can be considered a form of random access


Flash Video is a container file format used to deliver video over the Internet using Adobe Flash Player versions 6–11. Flash Video content may also be embedded within SWF files. There are two different video file formats known as Flash Video: FLV and F4V. The audio and video data within FLV files are encoded in the same manner as they are within SWF files. The latter F4V file format is based on the ISO base media file format and is starting with Flash Player 9 update 3.[1][2] Both formats are supported in Adobe Flash Player and currently developed by Adobe Systems. FLV was originally developed by Macromedia.


File Structure

Header

FLV files start with a standard header which is shown below



Tags
Followed the header, the file is split into packets called FLV tags which are delineated by 11-byte headers and 4-byte footers. The first byte of the tag denotes the packet type as follows:

0x12 - Metadata packet
0x08 - Audio packet
0x09 - Video packet


Following that, we find 3 bytes denoting length, 3 denoting the timestamp and 4 denoting the stream id. There is a direct relation between the fields encountered in an FLV Tag and those found in a RTMP packet, as for example the FLV Packet Type field uses the same numeric values as the RTMP Chunk Type field (ex. 0x08 for audio and 0x09 for video). FLV tags are thus converted into RTMP packets when the file is streamed through a Flash Media Server or equivalent RTMP Server. Each tag ends with 4 bytes denoting the total length of the packet which is the length found in the header plus 11 bytes for the header. Between the tag header and footer is found the compressed media data that will eventually be passed to the codec.


The first packet encountered is usually a metadata packet which contains information such as

  • - width/height - as an integer
  • - duration
  • - framerate
  • - keyframes - an array with the positions of p-frames, needed when random access is sought.

When streamed using an Actionscript built player, the metadata values above are passed as arguments on the onMetaData callback function.

No comments:

Post a Comment

Slack Space

Slack space is a form of internal fragmentation, i.e. wasted space, on a hard disk. When a file is written to disk it’s stored at the “begin...