mp4 文件 dref 解析

Data ReferenceBox

Box Types: ‘dref’
Container: Data Information Box (‘dinf’)
Mandatory: Yes
Quantity: Exactly one

Box Types: ‘url ‘, ‘urn’
Container: Data Information Box (‘dref’)
Mandatory: Yes (at least one of ‘url ‘ or ‘urn ‘ shall be present)
Quantity: One or more
The data reference object contains a table of data references (normally URLs) that declare the location(s) of the media data used within the presentation. The data reference index in the sample description ties entries in this table to the samples in the track. A track may be split over several sources in this way.

If the flag is set indicating that the data is in the same file as this box, then no string (not even an empty one) shall be supplied in the entry field.

The entry_count in the DataReferenceBox shall be 1 or greater; each DataEntryBox within the DataReferenceBox shall be either a DataEntryUrnBox or a DataEntryUrlBox.

NOTE Though the count is 32 bits, the number of items is usually much fewer, and is restricted by the fact that the reference index in the sample table is only 16 bits

When a file that has data entries with the flag set indicating that the media data is in the same file, is split into segments for transport, the value of this flag does not change, as the file is (logically) reassembled after the transport operation.

aligned(8) class DataEntryUrlBox (bit(24) flags) extends FullBox(‘url ‘, version = 0, flags) {
string location;
}

aligned(8) class DataEntryUrnBox (bit(24) flags) extends FullBox(‘urn ‘, version = 0, flags) {
string name;
string location;
}

aligned(8) class DataReferenceBox
extends FullBox(‘dref’, version = 0, 0) {
unsigned int(32) entry_count;
for (i=1; i <= entry_count; i++) {
DataEntryBox(entry_version, entry_flags) data_entry;
}
}

000006b0: 00 00 00 24 64 69 6e 66 00 00 00 1c 64 72 65 66 …$dinf….dref
000006c0: 00 00 00 00 00 00 00 01 00 00 00 0c 75 72 6c 20 …………url
000006d0: 00 00 00 01 00 00 01 0b 73 74 62 6c 00 00 00 a7 ……..stbl….
000006e0: 73 74 73 64 00 00 00 00 00 00 00 01 00 00 00 97 stsd…………

size 00 00 00 1c

vesion 8 00

flags 24 00 00 00

entry_count 32 00 00 00 01

DataEntryUrlBox

000006c0: 00 00 00 00 00 00 00 01 00 00 00 0c 75 72 6c 20 …………url
000006d0: 00 00 00 01 00 00 01 0b 73 74 62 6c 00 00 00 a7 ……..stbl….

size 00 00 00 0c

type 75 72 6c 20 0x20==space

version 0 

flags 00 00 01

 

 

000008d0: 00 00 00 00 00 00 00 24 64 69 6e 66 00 00 00 1c …….$dinf….
000008e0: 64 72 65 66 00 00 00 00 00 00 00 01 00 00 00 0c dref…………
000008f0: 75 72 6c 20 00 00 00 01 00 00 00 a3 73 74 62 6c url ……..stbl