Mercurial > mplayer.hg
comparison DOCS/tech/mpcf.txt @ 17669:cb73482267a0
info packet stuff, chapters...
author | ods15 |
---|---|
date | Fri, 24 Feb 2006 05:41:35 +0000 |
parents | 9ef8d2944c21 |
children | 7f3f86ed5409 |
comparison
equal
deleted
inserted
replaced
17668:b822575a1140 | 17669:cb73482267a0 |
---|---|
260 reserved_bytes | 260 reserved_bytes |
261 index_ptr u(64) | 261 index_ptr u(64) |
262 checksum u(32) | 262 checksum u(32) |
263 | 263 |
264 info_frame: (optional) | 264 info_frame: (optional) |
265 for(;;){ | 265 stream_id_plus1 v |
266 id v | 266 chapter_id v |
267 if(id==0) break | 267 if (chapter_id) { |
268 name= info_table[id][0] | 268 chapter_start v |
269 type= info_table[id][1] | 269 chapter_len v |
270 if(type==NULL) | 270 } |
271 count v | |
272 for(i=0; i<count; i++){ | |
273 name vb | |
274 value s | |
275 if (value==-1){ | |
276 type= "UTF-8" | |
277 value vb | |
278 }else if (value==-2){ | |
271 type vb | 279 type vb |
272 if(name==NULL) | 280 value vb |
273 name vb | 281 }else if (value==-3){ |
274 if(type=="v") | 282 type= "signed integer" |
275 value v | |
276 else if(type=="s") | |
277 value s | 283 value s |
278 else | 284 }else if (value<-3){ |
279 value vb | 285 type= "rational" |
286 value.den= -value-2 | |
287 value.num s | |
288 }else{ | |
289 type= "unsigned integer" | |
290 } | |
280 } | 291 } |
281 reserved_bytes | 292 reserved_bytes |
282 checksum u(32) | 293 checksum u(32) |
283 | 294 |
284 info_packet: (optional) | 295 info_packet: (optional) |
607 there is an index at all. | 618 there is an index at all. |
608 | 619 |
609 Info tags: | 620 Info tags: |
610 ---------- | 621 ---------- |
611 | 622 |
612 id | 623 stream_id_plus1 |
613 the ID of the type/name pair, so it is more compact | 624 Stream this info packet applies to. If zero, packet applies to whole |
614 0 means end | 625 file. |
626 | |
627 chapter_id | |
628 Id of chapter this packet applies to. If zero, packet applies to whole | |
629 file. Positive chapter_id's are real chapters and MUST NOT overlap. | |
630 Negative chapter_id indicate a sub region of file and not a real | |
631 chapter. chapter_id MUST be unique to the region it represents. | |
632 | |
633 chapter_start | |
634 s= chapter_start % stream_count | |
635 timestamp= chapter_start / stream_count | |
636 timestamp of start of chapter in timebase of stream 's'. | |
637 | |
638 chapter_len | |
639 Length of chapter in same timebase of chapter_start. | |
615 | 640 |
616 type | 641 type |
617 for example: "UTF8" -> string or "JPEG" -> JPEG image | 642 for example: "UTF8" -> string or "JPEG" -> JPEG image |
618 Note: nonstandard fields should be prefixed by "X-" | 643 Note: nonstandard fields should be prefixed by "X-" |
619 Note: MUST be less than 6 byte long (might be increased to 64 later) | 644 Note: MUST be less than 6 byte long (might be increased to 64 later) |
620 | 645 |
621 info packet types | 646 info packet types |
622 the name of the info entry, valid names are | 647 the name of the info entry, valid names are |
623 "StreamId" | |
624 the stream(s) to which the info packet applies | |
625 "Author" | 648 "Author" |
626 "Description" | 649 "Description" |
627 "Copyright" | 650 "Copyright" |
628 "Encoder" | 651 "Encoder" |
629 the name & version of the software used for encoding | 652 the name & version of the software used for encoding |
630 "Title" | 653 "Title" |
631 "Cover" | 654 "Cover" (allowed types are "PNG" and "JPEG") |
632 image of the (CD, DVD, VHS, ..) cover (preferably PNG or JPEG) | 655 image of the (CD, DVD, VHS, ..) cover (preferably PNG or JPEG) |
633 "Source" | 656 "Source" |
634 "DVD", "VCD", "CD", "MD", "FM radio", "VHS", "TV", "LD" | 657 "DVD", "VCD", "CD", "MD", "FM radio", "VHS", "TV", "LD" |
635 Optional: appended PAL, NTSC, SECAM, ... in parentheses | 658 Optional: appended PAL, NTSC, SECAM, ... in parentheses |
636 "CaptureDevice" | 659 "CaptureDevice" |
638 "CreationTime" | 661 "CreationTime" |
639 "2003-01-20 20:13:15Z", ... | 662 "2003-01-20 20:13:15Z", ... |
640 (ISO 8601 format, see http://www.cl.cam.ac.uk/~mgk25/iso-time.html) | 663 (ISO 8601 format, see http://www.cl.cam.ac.uk/~mgk25/iso-time.html) |
641 Note: do not forget the timezone | 664 Note: do not forget the timezone |
642 "Keywords" | 665 "Keywords" |
643 "TotalTime" | |
644 total length of the stream in msecs | |
645 "Language" | 666 "Language" |
646 ISO 639 and ISO 3166 for language/country code | 667 ISO 639 and ISO 3166 for language/country code |
647 something like "eng" (US english), can be 0 if unknown | 668 something like "eng" (US english), can be 0 if unknown |
648 and "multi" if several languages | 669 and "multi" if several languages |
649 see http://www.loc.gov/standards/iso639-2/englangn.html | 670 see http://www.loc.gov/standards/iso639-2/englangn.html |
662 value of this name/type pair | 683 value of this name/type pair |
663 | 684 |
664 stuffing | 685 stuffing |
665 0x80 can be placed in front of any type v entry for stuffing purposes | 686 0x80 can be placed in front of any type v entry for stuffing purposes |
666 | 687 |
667 info_table[][2]={ | |
668 {NULL , NULL }, // end | |
669 {NULL , NULL }, | |
670 {NULL , "UTF8"}, | |
671 {NULL , "v"}, | |
672 {NULL , "s"}, | |
673 {"StreamId" , "v"}, | |
674 {"Author" , "UTF8"}, | |
675 {"Title" , "UTF8"}, | |
676 {"Language" , "UTF8"}, | |
677 {"Description" , "UTF8"}, | |
678 {"Copyright" , "UTF8"}, | |
679 {"Encoder" , "UTF8"}, | |
680 {"Keyword" , "UTF8"}, | |
681 {"Cover" , "JPEG"}, | |
682 {"Cover" , "PNG"}, | |
683 {"Disposition" , "UTF8"}, | |
684 }; | |
685 | 688 |
686 | 689 |
687 Structure: | 690 Structure: |
688 ---------- | 691 ---------- |
689 | 692 |
719 Index MAY only be repeated after main headers. | 722 Index MAY only be repeated after main headers. |
720 If an index is written anywhere in the file, it MUST be written at end of | 723 If an index is written anywhere in the file, it MUST be written at end of |
721 file as well. | 724 file as well. |
722 | 725 |
723 | 726 |
724 Info frames: | 727 Info: |
725 ------------ | 728 ----- |
729 | |
730 All info packets with the same chapter_id and stream_id are repeated info | |
731 packets and MUST be binary identical. | |
732 | |
733 All info packets MUST appear after main headers at begginning of file, and | |
734 SHOULD be repeated after all main headers unless they are very large. | |
726 | 735 |
727 Info frames can be used to describe the file or some part of it (chapters) | 736 Info frames can be used to describe the file or some part of it (chapters) |
737 | |
738 Info SHOULD be stored in global packets instead of info streams/frames if | |
739 possible, and the amount of data is not large. | |
728 | 740 |
729 | 741 |
730 demuxer (non-normative): | 742 demuxer (non-normative): |
731 ------------------------ | 743 ------------------------ |
732 | 744 |