[MPlayer-dev-eng] NUT cleanup
Oded Shimon
ods15 at ods15.dyndns.org
Mon Sep 5 20:52:56 CEST 2005
On Mon, Sep 05, 2005 at 09:43:47PM +0300, Oded Shimon wrote:
> - stream_id MUST be < stream_count
Oops, that shouldn't be there.
new patch.
BTW, can I add myself to the authors?...
- ods15
-------------- next part --------------
--- ../main/DOCS/tech/mpcf.txt 2005-06-19 12:17:44.000000000 +0300
+++ mpcf.txt 2005-09-05 21:51:18.000000000 +0300
@@ -156,7 +156,6 @@
stream_id v
stream_class v
fourcc vb
- average_bitrate v
time_base_nom v
time_base_denom v
msb_timestamp_shift v
@@ -183,6 +182,11 @@
reserved_bytes
checksum u(32)
+other_stream_header:
+ stream_header
+ reserved_bytes
+ checksum u(32)
+
Basic Packets:
frame:
@@ -204,6 +208,7 @@
index_startcode f(64)
packet header
stream_id v
+ last_pts v
index_length v
for(i=0; i<index_length; i++){
index_timestamp v
@@ -240,13 +245,15 @@
file:
file_id_string
- while(!eof && next_code != index_startcode){
+ while(next_code != end_startcode && next_code != index_startcode){
main_header
for(i=0; i<stream_count; i++){
if(next_packet==video_stream_header)
video_stream_header
- else
+ else if(next_packet==audio_stream_header)
audio_stream_header
+ else
+ other_stream_header
}
while(next_code != main_startcode){
if(next_code == info_startcode)
@@ -258,16 +265,19 @@
}
}
}
- index
-
+ while(next_code != end_startcode){
+ index
+ }
+ end_startcode f(64)
+ index_ptr v
Tag description:
forward_ptr
- size of the packet (exactly the distance from the first byte of the
- startcode of the current packet to the first byte of the following
- packet
+ size of the packet data (exactly the distance from the first byte
+ after the forward_ptr to the first byte of the checksum of the
+ packet or next packet if there is no checksum)
file_id_string
"nut/multimedia container\0"
@@ -292,6 +302,8 @@
0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48)
info_startcode
0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48)
+end_startcode
+ 0xE8154EDB2A7CULL + (((uint64_t)('N'<<8) + 'E')<<48)
version
NUT version. The current value is 2.
@@ -313,11 +325,8 @@
SHOULD be set to <=32768 or at least <=65536 unless there is a very
good reason to set it higher
-stream_id[FIXME]
+stream_id
Stream identifier
- Note: streams with a lower relative class MUST have a lower relative id
- so a stream with class 0 MUST always have an id which is lower than any
- stream with class > 0
stream_id MUST be < stream_count
stream_class
@@ -327,6 +336,8 @@
3 metadata
Note: the remaining values are reserved and MUST NOT be used
a demuxer MUST ignore streams with reserved classes
+ Note: stream_class MUST be bigger or equal to the stream_class of
+ the previous stream.
fourcc
identification for the codec
@@ -337,7 +348,7 @@
time_base_nom / time_base_denom = time_base
the number of timer ticks per second, this MUST be equal to the fps
if the fixed_fps is 1
- time_base_denom MUST NOT be 0
+ time_base_denom and time_base_nom MUST NOT be 0
time_base_nom and time_base_denom MUST be relatively prime
time_base_nom MUST be < 2^31
examples:
@@ -345,17 +356,10 @@
30 30 1
29.97 30000 1001
23.976 24000 1001
- sample_rate sample_rate_mul time_base_nom time_base_denom
- 44100 1 44100 1
- 44100 64 11025 16
- 48000 1024 375 8
-
- Note: the advantage to using a large sample_rate_mul is that
- the timestamps need fewer bits
global_time_base_nom / global_time_base_denom = global_time_base
the number of timer ticks per second
- global_time_base_denom MUST NOT be 0
+ global_time_base_nom and global_time_base_denom MUST NOT be 0
global_time_base_nom and global_time_base_denom MUST be relatively prime
global_time_base_nom MUST be < 2^31
@@ -453,9 +457,9 @@
stream, into which the current pts is inserted and the element with
the smallest value is removed, this is then the current dts
this buffer is initalized with decode_delay -1 elements
- all frames with dts == timestamp must be monotone, that means a frame
- which occures later in the stream must have a larger or equal dts
- than an earlier frame
+ all frames must be monotone, that means a frame which occures later
+ in the stream must have a larger or equal dts than an earlier
+ frame.
FIXME rename timestamp* to pts* ?
width/height
@@ -478,6 +482,12 @@
checksum
adler32 checksum
+ checksum is calculated for the area pointed to by forward_ptr
+ (first byte after the forward_ptr until last byte before the
+ checksum)
+
+last_pts
+ The timestamp of the last frame
index_timestamp
value of the timestamp of a keyframe relative to the last keyframe
@@ -490,6 +500,11 @@
2 consecutive index entries if they are more than max_index_distance
apart
+index_ptr
+ length in bytes from the first bytes of the first index startcode
+ to the first byte of the index_ptr. If there is no index, index_ptr
+ MUST be zero.
+
id
the id of the type/name pair, so it's more compact
0 means end
@@ -582,6 +597,8 @@
Index
Note: with realtime streaming, there is no end, so no index there either
+An index SHOULD be written for every stream. Indexes MUST be placed at end
+of file. Indexes MAY be repeated for a stream.
Info packets
the info_packet can be repeated, and can also contain different names & values
@@ -592,6 +609,9 @@
streaming info packets will normally be transmitted when they apply for
example, the current song title & artist of the currently shown music video
+If more than one stream of a given stream class is present, each one MUST
+have info tags specifying disposition, and if applicable, language.
+
Unknown packets
MUST be ignored by the demuxer
More information about the MPlayer-dev-eng
mailing list