Mercurial > mplayer.hg
comparison DOCS/tech/mpcf.txt @ 14919:1d4861b2ac4a
returning to the old index at the end system, alternatives are too complex with questionable advantages
author | michael |
---|---|
date | Fri, 04 Mar 2005 23:12:41 +0000 |
parents | 6a8b15582f64 |
children | 0a43341c8bfd |
comparison
equal
deleted
inserted
replaced
14918:354e7a03ee54 | 14919:1d4861b2ac4a |
---|---|
117 main_startcode f(64) | 117 main_startcode f(64) |
118 packet header | 118 packet header |
119 version v | 119 version v |
120 stream_count v | 120 stream_count v |
121 max_distance v | 121 max_distance v |
122 index_distance v | 122 max_index_distance v |
123 global_time_base_nom v | 123 global_time_base_nom v |
124 global_time_base_denom v | 124 global_time_base_denom v |
125 for(i=0; i<256; ){ | 125 for(i=0; i<256; ){ |
126 tmp_flag v | 126 tmp_flag v |
127 tmp_fields v | 127 tmp_fields v |
158 average_bitrate v | 158 average_bitrate v |
159 time_base_nom v | 159 time_base_nom v |
160 time_base_denom v | 160 time_base_denom v |
161 msb_timestamp_shift v | 161 msb_timestamp_shift v |
162 decode_delay v | 162 decode_delay v |
163 index_modulo v | |
164 index_increment v | |
165 fixed_fps u(1) | 163 fixed_fps u(1) |
166 reserved u(6) | 164 reserved u(6) |
167 codec_specific_data vb | 165 codec_specific_data vb |
168 | 166 |
169 video_stream_header: | 167 video_stream_header: |
203 | 201 |
204 index: | 202 index: |
205 index_startcode f(64) | 203 index_startcode f(64) |
206 packet header | 204 packet header |
207 stream_id v | 205 stream_id v |
208 index_id v | |
209 index_length v | 206 index_length v |
210 for(i=0; i<index_length; i++){ | 207 for(i=0; i<index_length; i++){ |
211 index_timestamp v | 208 index_timestamp v |
212 index_position v | 209 index_position v |
213 } | 210 } |
240 | 237 |
241 Complete definition: | 238 Complete definition: |
242 | 239 |
243 file: | 240 file: |
244 file_id_string | 241 file_id_string |
245 while(!eof){ | 242 while(!eof && next_code != index_startcode){ |
246 main_header | 243 main_header |
247 for(i=0; i<stream_count; i++){ | 244 for(i=0; i<stream_count; i++){ |
248 if(next_packet==video_stream_header) | 245 if(next_packet==video_stream_header) |
249 video_stream_header | 246 video_stream_header |
250 else | 247 else |
251 audio_stream_header | 248 audio_stream_header |
252 } | 249 } |
253 while(next_code != main_startcode){ | 250 while(next_code != main_startcode){ |
254 if(next_code == info_startcode) | 251 if(next_code == info_startcode) |
255 info_packet | 252 info_packet |
256 else if(next_code == index_startcode){ | 253 else{ |
257 index | |
258 }else{ | |
259 if(next_code == frame_startcode) | 254 if(next_code == frame_startcode) |
260 sync_point | 255 sync_point |
261 frame | 256 frame |
262 } | 257 } |
263 } | 258 } |
264 } | 259 } |
260 index | |
265 | 261 |
266 | 262 |
267 | 263 |
268 Tag description: | 264 Tag description: |
269 | 265 |
307 | 303 |
308 SHOULD be set to <=32768 or at least <=65536 unless there is a very | 304 SHOULD be set to <=32768 or at least <=65536 unless there is a very |
309 good reason to set it higher otherwise reasonable error recovery will | 305 good reason to set it higher otherwise reasonable error recovery will |
310 be impossible | 306 be impossible |
311 | 307 |
312 index_distance | 308 max_index_distance |
313 distance at which indexes are approximately stored, or 0 if there are | 309 max distance of keyframes which are represented in the index, the |
314 no indexes in the file | 310 distance between consecutive entries A and B may only be larger if |
315 in every [x*index_distance, (x+1)*index_distance) interval, there | 311 there are no keyframes within this stream between A and B |
316 must be an index packet for every stream, and these packets must be | 312 SHOULD be set to <=32768 or at least <=65536 unless there is a very |
317 located prior to all frames within the interval | 313 good reason to set it higher |
318 reasoning: this ensures good error recovery as there are many and | |
319 evenly distributed indexes, and also allows very quick finding of the | |
320 index packets | |
321 | |
322 index_modulo | |
323 index_id | |
324 each index packet contains every index_moduloth's keyframe of a stream, | |
325 so the i'th keyframe of a stream will be at least in packets with | |
326 (i % index_modulo) == index_id | |
327 furthermore a index packet contains all indexed keyframes since the | |
328 last index packet | |
329 (indexed keyframes == keyframes which are referenced from any index | |
330 packet) | |
331 | |
332 index_increment | |
333 the index_id increment value, this MUST be a relative prime to | |
334 index_modulo | |
335 index_increment / index_modulo SHOULD be approximately 2/(sqrt(5)+1) | |
336 | 314 |
337 stream_id[FIXME] | 315 stream_id[FIXME] |
338 Stream identifier | 316 Stream identifier |
339 Note: streams with a lower relative class MUST have a lower relative id | 317 Note: streams with a lower relative class MUST have a lower relative id |
340 so a stream with class 0 MUST always have a id which is lower then any | 318 so a stream with class 0 MUST always have a id which is lower then any |
505 stored in this index | 483 stored in this index |
506 | 484 |
507 index_position | 485 index_position |
508 position in bytes of the first byte of a keyframe, relative to the | 486 position in bytes of the first byte of a keyframe, relative to the |
509 last keyframe stored in this index | 487 last keyframe stored in this index |
488 there MUST be no keyframe with the same stream_id as this index between | |
489 2 consecutive index entries if they are more then max_index_distance | |
490 appart | |
510 | 491 |
511 id | 492 id |
512 the id of the type/name pair, so its more compact | 493 the id of the type/name pair, so its more compact |
513 0 means end | 494 0 means end |
514 | 495 |
597 | 578 |
598 info packets which describe the whole file or individual streams/tracks must be | 579 info packets which describe the whole file or individual streams/tracks must be |
599 placed before any video/audio/... frames | 580 placed before any video/audio/... frames |
600 | 581 |
601 Index | 582 Index |
583 Note: in case of realtime streaming there is no end, so no index there either | |
602 | 584 |
603 Info packets | 585 Info packets |
604 the info_packet can be repeated, it can also contain different names & values | 586 the info_packet can be repeated, it can also contain different names & values |
605 each time but only if also the time is different | 587 each time but only if also the time is different |
606 Info packets can be used to describe the file or some part of it (chapters) | 588 Info packets can be used to describe the file or some part of it (chapters) |