Mercurial > mplayer.hg
comparison DOCS/tech/nut.txt @ 21175:3cdb95ea504d
specify, where possible, the type of the tags in the tag description section
author | ivo |
---|---|
date | Fri, 24 Nov 2006 16:31:48 +0000 |
parents | da82711ea019 |
children | 5db85f2c7ef6 |
comparison
equal
deleted
inserted
replaced
21174:364075c5bc6c | 21175:3cdb95ea504d |
---|---|
408 file_id_string | 408 file_id_string |
409 "nut/multimedia container\0" | 409 "nut/multimedia container\0" |
410 the very first thing in every nut file, useful for identifying nut | 410 the very first thing in every nut file, useful for identifying nut |
411 files | 411 files |
412 | 412 |
413 *_startcode | 413 *_startcode (f(64)) |
414 all startcodes start with 'N' | 414 all startcodes start with 'N' |
415 | 415 |
416 main_startcode | 416 main_startcode (f(64)) |
417 0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48) | 417 0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48) |
418 | 418 |
419 stream_startcode | 419 stream_startcode (f(64)) |
420 0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48) | 420 0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48) |
421 | 421 |
422 syncpoint_startcode | 422 syncpoint_startcode (f(64)) |
423 0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48) | 423 0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48) |
424 | 424 |
425 index_startcode | 425 index_startcode (f(64)) |
426 0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48) | 426 0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48) |
427 | 427 |
428 info_startcode | 428 info_startcode (f(64)) |
429 0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48) | 429 0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48) |
430 | 430 |
431 version | 431 version (v) |
432 NUT version. The current value is 3. All lower values are pre-freeze | 432 NUT version. The current value is 3. All lower values are pre-freeze |
433 | 433 |
434 stream_count | 434 stream_count (v) |
435 number of streams in this file | 435 number of streams in this file |
436 | 436 |
437 time_base_count | 437 time_base_count (v) |
438 number of different time bases in this file | 438 number of different time bases in this file |
439 this MUST NOT be 0 | 439 this MUST NOT be 0 |
440 | 440 |
441 forward_ptr | 441 forward_ptr (v) |
442 size of the packet data (exactly the distance from the first byte | 442 size of the packet data (exactly the distance from the first byte |
443 after the packet_header to the first byte of the next packet) | 443 after the packet_header to the first byte of the next packet) |
444 every nut packet contains a forward_ptr immediately after its startcode | 444 every nut packet contains a forward_ptr immediately after its startcode |
445 with the exception of frame_code based packets, the forward pointer | 445 with the exception of frame_code based packets, the forward pointer |
446 can be used to skip over the packet without decoding its contents | 446 can be used to skip over the packet without decoding its contents |
447 | 447 |
448 max_distance | 448 max_distance (v) |
449 max distance between startcodes. If p1 and p2 are the byte | 449 max distance between startcodes. If p1 and p2 are the byte |
450 positions of the first byte of two consecutive startcodes, then | 450 positions of the first byte of two consecutive startcodes, then |
451 p2-p1 MUST be less than or equal to max_distance unless the entire | 451 p2-p1 MUST be less than or equal to max_distance unless the entire |
452 span from p1 to p2 comprises a single packet or a syncpoint | 452 span from p1 to p2 comprises a single packet or a syncpoint |
453 followed by a single frame. This imposition places efficient upper | 453 followed by a single frame. This imposition places efficient upper |
464 | 464 |
465 This is also half the max frame size without a checksum after the | 465 This is also half the max frame size without a checksum after the |
466 frameheader. | 466 frameheader. |
467 | 467 |
468 | 468 |
469 max_pts_distance | 469 max_pts_distance (v) |
470 max absolute difference of pts of new frame from last_pts in the | 470 max absolute difference of pts of new frame from last_pts in the |
471 timebase of the stream, without a checksum after the frameheader. | 471 timebase of the stream, without a checksum after the frameheader. |
472 A frame header MUST include a checksum if abs(pts-last_pts) is | 472 A frame header MUST include a checksum if abs(pts-last_pts) is |
473 strictly greater than max_pts_distance. | 473 strictly greater than max_pts_distance. |
474 Note that last_pts is not necessarily the pts of the last frame | 474 Note that last_pts is not necessarily the pts of the last frame |
475 on the same stream, as it is altered by syncpoint timestamps. | 475 on the same stream, as it is altered by syncpoint timestamps. |
476 SHOULD NOT be higher than 1/timebase | 476 SHOULD NOT be higher than 1/timebase |
477 | 477 |
478 stream_id | 478 stream_id (v) |
479 Stream identifier | 479 Stream identifier |
480 stream_id MUST be < stream_count | 480 stream_id MUST be < stream_count |
481 | 481 |
482 stream_class | 482 stream_class (v) |
483 0 video | 483 0 video |
484 1 audio | 484 1 audio |
485 2 subtitles | 485 2 subtitles |
486 3 userdata | 486 3 userdata |
487 Note: the remaining values are reserved and MUST NOT be used | 487 Note: the remaining values are reserved and MUST NOT be used |
488 a demuxer MUST ignore streams with reserved classes | 488 a demuxer MUST ignore streams with reserved classes |
489 | 489 |
490 fourcc | 490 fourcc (vb) |
491 identification for the codec | 491 identification for the codec |
492 example: "H264" | 492 example: "H264" |
493 MUST contain 2 or 4 bytes, note, this might be increased in the future | 493 MUST contain 2 or 4 bytes, note, this might be increased in the future |
494 if needed | 494 if needed |
495 the id values used are the same as in avi, so if a codec uses a specific | 495 the id values used are the same as in avi, so if a codec uses a specific |
496 fourcc in avi then the same fourcc MUST be used here | 496 fourcc in avi then the same fourcc MUST be used here |
497 | 497 |
498 time_base_nom / time_base_denom = time_base | 498 time_base_nom (v) / time_base_denom (v) = time_base |
499 the length of a timer tick in seconds, this MUST be equal to the 1/fps | 499 the length of a timer tick in seconds, this MUST be equal to the 1/fps |
500 if FLAG_FIXED_FPS is set | 500 if FLAG_FIXED_FPS is set |
501 time_base_nom and time_base_denom MUST NOT be 0 | 501 time_base_nom and time_base_denom MUST NOT be 0 |
502 time_base_nom and time_base_denom MUST be relatively prime | 502 time_base_nom and time_base_denom MUST be relatively prime |
503 time_base_denom MUST be < 2^31 | 503 time_base_denom MUST be < 2^31 |
507 29.97 1001 30000 | 507 29.97 1001 30000 |
508 23.976 1001 24000 | 508 23.976 1001 24000 |
509 There MUST NOT be 2 identical timebases in a file. | 509 There MUST NOT be 2 identical timebases in a file. |
510 There SHOULD NOT be more timebases than streams. | 510 There SHOULD NOT be more timebases than streams. |
511 | 511 |
512 time_base_id | 512 time_base_id (v) |
513 index into the time_base table | 513 index into the time_base table |
514 MUST be < time_base_count | 514 MUST be < time_base_count |
515 | 515 |
516 convert_ts | 516 convert_ts |
517 To switch from 2 different timebases, the following calculation is | 517 To switch from 2 different timebases, the following calculation is |
541 | 541 |
542 if (convert_ts(a, a_timebase, b_timebase) < b) return -1; | 542 if (convert_ts(a, a_timebase, b_timebase) < b) return -1; |
543 if (convert_ts(b, b_timebase, a_timebase) < a) return 1; | 543 if (convert_ts(b, b_timebase, a_timebase) < a) return 1; |
544 return 0; | 544 return 0; |
545 | 545 |
546 msb_pts_shift | 546 msb_pts_shift (v) |
547 amount of bits in lsb_pts | 547 amount of bits in lsb_pts |
548 MUST be <16 | 548 MUST be <16 |
549 | 549 |
550 decode_delay | 550 decode_delay (v) |
551 size of the reordering buffer used to convert pts to dts | 551 size of the reordering buffer used to convert pts to dts |
552 codecs which don't support b frames normally use 0 | 552 codecs which don't support b frames normally use 0 |
553 mpeg1/mpeg2 style codecs with b frames use 1 | 553 mpeg1/mpeg2 style codecs with b frames use 1 |
554 h264 style b pyramid uses 2 | 554 h264 style b pyramid uses 2 |
555 h264 and future codecs might need values >2 | 555 h264 and future codecs might need values >2 |
556 audio codecs generally use 0 (we aren't aware of any which doesn't | 556 audio codecs generally use 0 (we aren't aware of any which doesn't |
557 but its theoretically possible that one exists which needs it >0) | 557 but its theoretically possible that one exists which needs it >0) |
558 decode_delay MUST NOT be set higher than necessary for a codec. | 558 decode_delay MUST NOT be set higher than necessary for a codec. |
559 | 559 |
560 stream_flags | 560 stream_flags (v) |
561 Bit Name Description | 561 Bit Name Description |
562 1 FLAG_FIXED_FPS indicates that the fps is fixed | 562 1 FLAG_FIXED_FPS indicates that the fps is fixed |
563 | 563 |
564 codec_specific_data | 564 codec_specific_data (vb) |
565 private global data for a codec (could be huffman tables or ...) | 565 private global data for a codec (could be huffman tables or ...) |
566 if a codec has a global header it SHOULD be placed in here instead of | 566 if a codec has a global header it SHOULD be placed in here instead of |
567 at the start of every keyframe | 567 at the start of every keyframe |
568 the exact format is specified in the codec spec | 568 the exact format is specified in the codec spec |
569 for H.264 the NAL units MUST be formatted as in a bytestream | 569 for H.264 the NAL units MUST be formatted as in a bytestream |
574 it also MUST NOT contain normal packets which cause the reference decoder | 574 it also MUST NOT contain normal packets which cause the reference decoder |
575 to generate any specific decoded samples | 575 to generate any specific decoded samples |
576 the encoder name and version, shall be considered essential as it is very | 576 the encoder name and version, shall be considered essential as it is very |
577 usefull to workaround possible encoder bugs | 577 usefull to workaround possible encoder bugs |
578 | 578 |
579 frame_code | 579 frame_code (f(8)) |
580 frame_code is an 8-bit field which exists before every frame, it can | 580 frame_code is an 8-bit field which exists before every frame, it can |
581 store part of the size of the frame, the stream number, the timestamp | 581 store part of the size of the frame, the stream number, the timestamp |
582 and some flags amongst other things, what is not directly stored | 582 and some flags amongst other things, what is not directly stored |
583 in it but is needed is stored in various fields immediately after it | 583 in it but is needed is stored in various fields immediately after it |
584 the values stored in it can be found in the main header | 584 the values stored in it can be found in the main header |
585 the value 78 ('N') is forbidden to ensure that the byte is always | 585 the value 78 ('N') is forbidden to ensure that the byte is always |
586 different from the first byte of any startcode | 586 different from the first byte of any startcode |
587 a muxer SHOULD mark 0x00 and 0xFF as invalid to improve error | 587 a muxer SHOULD mark 0x00 and 0xFF as invalid to improve error |
588 detection | 588 detection |
589 | 589 |
590 flags[frame_code], frame_flags | 590 flags[frame_code], frame_flags (v) |
591 Bit Name Description | 591 Bit Name Description |
592 1 FLAG_KEY if set, frame is keyframe | 592 1 FLAG_KEY if set, frame is keyframe |
593 2 FLAG_EOR if set, stream has no relevance on | 593 2 FLAG_EOR if set, stream has no relevance on |
594 presentation. (EOR) | 594 presentation. (EOR) |
595 8 FLAG_CODED_PTS if set, coded_pts is in the frame header | 595 8 FLAG_CODED_PTS if set, coded_pts is in the frame header |
614 last_pts | 614 last_pts |
615 the timestamp of the last frame with the same stream_id as the current | 615 the timestamp of the last frame with the same stream_id as the current |
616 if there is no such frame between the last syncpoint and the current | 616 if there is no such frame between the last syncpoint and the current |
617 frame then the syncpoint timestamp is used, see global_key_pts | 617 frame then the syncpoint timestamp is used, see global_key_pts |
618 | 618 |
619 stream_id[frame_code] | 619 stream_id[frame_code] (v) |
620 if FLAG_STREAM_ID is not set then this is the stream number for the | 620 if FLAG_STREAM_ID is not set then this is the stream number for the |
621 frame following this frame_code | 621 frame following this frame_code |
622 if FLAG_STREAM_ID is set then this value has no meaning | 622 if FLAG_STREAM_ID is set then this value has no meaning |
623 MUST be <250 | 623 MUST be <250 |
624 | 624 |
625 data_size_mul[frame_code] | 625 data_size_mul[frame_code] (v) |
626 if FLAG_SIZE_MSB is set then data_size_msb which is stored after the | 626 if FLAG_SIZE_MSB is set then data_size_msb which is stored after the |
627 frame code is multiplied with it and forms the more significant part | 627 frame code is multiplied with it and forms the more significant part |
628 of the size of the following frame | 628 of the size of the following frame |
629 if FLAG_SIZE_MSB is not set then this field has no meaning | 629 if FLAG_SIZE_MSB is not set then this field has no meaning |
630 MUST be <16384 | 630 MUST be <16384 |
631 | 631 |
632 data_size_lsb[frame_code] | 632 data_size_lsb[frame_code] (v) |
633 the less significant part of the size of the following frame | 633 the less significant part of the size of the following frame |
634 this added together with data_size_mul*data_size_msb is the size of | 634 this added together with data_size_mul*data_size_msb is the size of |
635 the following frame | 635 the following frame |
636 MUST be <16384 | 636 MUST be <16384 |
637 | 637 |
638 pts_delta[frame_code] | 638 pts_delta[frame_code] (s) |
639 MUST be <16384 and >-16384 | 639 MUST be <16384 and >-16384 |
640 if FLAG_CODED_PTS is set in the flags of the current frame then this | 640 if FLAG_CODED_PTS is set in the flags of the current frame then this |
641 value MUST be ignored, if FLAG_CODED_PTS is not set then pts_delta is the | 641 value MUST be ignored, if FLAG_CODED_PTS is not set then pts_delta is the |
642 difference between the current pts and last_pts | 642 difference between the current pts and last_pts |
643 | 643 |
644 reserved_count[frame_code] | 644 reserved_count[frame_code] (v) |
645 MUST be <256 | 645 MUST be <256 |
646 | 646 |
647 data_size | 647 data_size |
648 the size of the following frame | 648 the size of the following frame |
649 data_size= data_size_lsb + data_size_msb*data_size_mul; | 649 data_size= data_size_lsb + data_size_msb*data_size_mul; |
650 | 650 |
651 coded_pts | 651 coded_pts (v) |
652 if coded_pts < (1<<msb_pts_shift) then it is an lsb | 652 if coded_pts < (1<<msb_pts_shift) then it is an lsb |
653 pts, otherwise it is a full pts + (1<<msb_pts_shift) | 653 pts, otherwise it is a full pts + (1<<msb_pts_shift) |
654 lsb pts is converted to a full pts by: | 654 lsb pts is converted to a full pts by: |
655 mask = (1<<msb_pts_shift)-1; | 655 mask = (1<<msb_pts_shift)-1; |
656 delta = last_pts - mask/2 | 656 delta = last_pts - mask/2 |
687 previous frames in all streams, compared in common timebase. (EOR | 687 previous frames in all streams, compared in common timebase. (EOR |
688 frames are NOT exempt from this rule) | 688 frames are NOT exempt from this rule) |
689 Dts of all frames MUST be bigger or equal to dts of all previous frames | 689 Dts of all frames MUST be bigger or equal to dts of all previous frames |
690 in the same stream | 690 in the same stream |
691 | 691 |
692 width/height | 692 width (v) / height (v) |
693 width and height of the video in pixels | 693 width and height of the video in pixels |
694 MUST be set to the coded width/height, MUST NOT be 0 | 694 MUST be set to the coded width/height, MUST NOT be 0 |
695 | 695 |
696 sample_width/sample_height (aspect ratio) | 696 sample_width (v) /sample_height (v) (aspect ratio) |
697 sample_width is the horizontal distance between samples | 697 sample_width is the horizontal distance between samples |
698 sample_width and sample_height MUST be relatively prime if not zero | 698 sample_width and sample_height MUST be relatively prime if not zero |
699 both MUST be 0 if unknown otherwise both MUST be non zero | 699 both MUST be 0 if unknown otherwise both MUST be non zero |
700 | 700 |
701 colorspace_type | 701 colorspace_type (v) |
702 0 unknown | 702 0 unknown |
703 1 ITU Rec 624 / ITU Rec 601 Y range: 16..235 Cb/Cr range: 16..240 | 703 1 ITU Rec 624 / ITU Rec 601 Y range: 16..235 Cb/Cr range: 16..240 |
704 2 ITU Rec 709 Y range: 16..235 Cb/Cr range: 16..240 | 704 2 ITU Rec 709 Y range: 16..235 Cb/Cr range: 16..240 |
705 17 ITU Rec 624 / ITU Rec 601 Y range: 0..255 Cb/Cr range: 0..255 | 705 17 ITU Rec 624 / ITU Rec 601 Y range: 0..255 Cb/Cr range: 0..255 |
706 18 ITU Rec 709 Y range: 0..255 Cb/Cr range: 0..255 | 706 18 ITU Rec 709 Y range: 0..255 Cb/Cr range: 0..255 |
707 | 707 |
708 samplerate_nom / samplerate_denom = samplerate | 708 samplerate_nom (v) / samplerate_denom (v) = samplerate |
709 the number of samples per second, MUST NOT be 0 | 709 the number of samples per second, MUST NOT be 0 |
710 | 710 |
711 crc32 checksum | 711 crc32 checksum |
712 Generator polynomial is 0x104C11DB7. Starting value is zero. | 712 Generator polynomial is 0x104C11DB7. Starting value is zero. |
713 | 713 |
714 checksum | 714 checksum (u(32)) |
715 crc32 checksum | 715 crc32 checksum |
716 checksum is calculated for the area pointed to by forward_ptr not | 716 checksum is calculated for the area pointed to by forward_ptr not |
717 including the checksum itself (from first byte after the | 717 including the checksum itself (from first byte after the |
718 packet_header until last byte before the checksum). | 718 packet_header until last byte before the checksum). |
719 for frame headers the checksum contains the framecode byte and all | 719 for frame headers the checksum contains the framecode byte and all |
720 following bytes up to the checksum itself | 720 following bytes up to the checksum itself |
721 | 721 |
722 header_checksum | 722 header_checksum (u(32)) |
723 checksum over the startcode and forward pointer | 723 checksum over the startcode and forward pointer |
724 | 724 |
725 Syncpoint tags: | 725 Syncpoint tags: |
726 --------------- | 726 --------------- |
727 | 727 |
728 back_ptr_div16 | 728 back_ptr_div16 (v) |
729 back_ptr = back_ptr_div16 * 16 + 15 | 729 back_ptr = back_ptr_div16 * 16 + 15 |
730 back_ptr must point to a position within 16 bytes of a syncpoint | 730 back_ptr must point to a position within 16 bytes of a syncpoint |
731 startcode. This syncpoint MUST be the closest syncpoint such that at | 731 startcode. This syncpoint MUST be the closest syncpoint such that at |
732 least one keyframe with a pts lower or equal to the original syncpoint's | 732 least one keyframe with a pts lower or equal to the original syncpoint's |
733 global_key_pts for all streams lies between it and the current syncpoint. | 733 global_key_pts for all streams lies between it and the current syncpoint. |
734 | 734 |
735 A stream where EOR is set is to be ignored for back_ptr. | 735 A stream where EOR is set is to be ignored for back_ptr. |
736 | 736 |
737 global_key_pts | 737 global_key_pts (t) |
738 After a syncpoint, last_pts of each stream is to be set to: | 738 After a syncpoint, last_pts of each stream is to be set to: |
739 last_pts[i] = convert_ts(global_key_pts, time_base[id], time_base[i]) | 739 last_pts[i] = convert_ts(global_key_pts, time_base[id], time_base[i]) |
740 | 740 |
741 global_key_pts MUST be bigger or equal to dts of all past frames across | 741 global_key_pts MUST be bigger or equal to dts of all past frames across |
742 all streams, and smaller or equal to pts of all future frames. | 742 all streams, and smaller or equal to pts of all future frames. |
743 | 743 |
744 Index tags: | 744 Index tags: |
745 ----------- | 745 ----------- |
746 | 746 |
747 max_pts | 747 max_pts (t) |
748 The highest pts in the entire file | 748 The highest pts in the entire file |
749 | 749 |
750 syncpoint_pos_div16 | 750 syncpoint_pos_div16 (v) |
751 offset from beginning of file to up to 15 bytes before the syncpoint | 751 offset from beginning of file to up to 15 bytes before the syncpoint |
752 referred to in this index entry. Relative to position of last | 752 referred to in this index entry. Relative to position of last |
753 syncpoint. | 753 syncpoint. |
754 | 754 |
755 has_keyframe | 755 has_keyframe |
762 | 762 |
763 eor_pts | 763 eor_pts |
764 Coded only if EOR is set at the position of the syncpoint. The pts of | 764 Coded only if EOR is set at the position of the syncpoint. The pts of |
765 that EOR. EOR is unset by the first keyframe after it. | 765 that EOR. EOR is unset by the first keyframe after it. |
766 | 766 |
767 index_ptr | 767 index_ptr (u(64)) |
768 Length in bytes of the entire index, from the first byte of the | 768 Length in bytes of the entire index, from the first byte of the |
769 startcode until the last byte of the checksum. | 769 startcode until the last byte of the checksum. |
770 Note: A demuxer can use this to find the index when it is written at | 770 Note: A demuxer can use this to find the index when it is written at |
771 EOF, as index_ptr will always be 12 bytes before the end of file if | 771 EOF, as index_ptr will always be 12 bytes before the end of file if |
772 there is an index at all. | 772 there is an index at all. |
773 | 773 |
774 | 774 |
775 Info tags: | 775 Info tags: |
776 ---------- | 776 ---------- |
777 | 777 |
778 stream_id_plus1 | 778 stream_id_plus1 (v) |
779 Stream this info packet applies to. If zero, packet applies to whole | 779 Stream this info packet applies to. If zero, packet applies to whole |
780 file. | 780 file. |
781 | 781 |
782 chapter_id | 782 chapter_id (s) |
783 Id of chapter this packet applies to. If zero, packet applies to whole | 783 Id of chapter this packet applies to. If zero, packet applies to whole |
784 file. Positive chapter_id's are real chapters and MUST NOT overlap. | 784 file. Positive chapter_id's are real chapters and MUST NOT overlap. |
785 Negative chapter_id indicate a sub region of file and not a real | 785 Negative chapter_id indicate a sub region of file and not a real |
786 chapter. chapter_id MUST be unique to the region it represents. | 786 chapter. chapter_id MUST be unique to the region it represents. |
787 chapter_id n MUST not be used unless there are at least n chapters in the | 787 chapter_id n MUST not be used unless there are at least n chapters in the |
788 file | 788 file |
789 | 789 |
790 chapter_start | 790 chapter_start (t) |
791 timestamp of start of chapter | 791 timestamp of start of chapter |
792 | 792 |
793 chapter_len | 793 chapter_len (v) |
794 Length of chapter in same timebase of chapter_start. | 794 Length of chapter in same timebase of chapter_start. |
795 | 795 |
796 type | 796 type |
797 for example: "UTF8" -> string or "JPEG" -> JPEG image | 797 for example: "UTF8" -> string or "JPEG" -> JPEG image |
798 "v" -> unsigned integer | 798 "v" -> unsigned integer |