Edit File by line
/home/barbar84/public_h.../wp-inclu.../ID3
File: module.audio-video.matroska.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/////////////////////////////////////////////////////////////////
[2] Fix | Delete
/// getID3() by James Heinrich <info@getid3.org> //
[3] Fix | Delete
// available at https://github.com/JamesHeinrich/getID3 //
[4] Fix | Delete
// or https://www.getid3.org //
[5] Fix | Delete
// or http://getid3.sourceforge.net //
[6] Fix | Delete
// see readme.txt for more details //
[7] Fix | Delete
/////////////////////////////////////////////////////////////////
[8] Fix | Delete
// //
[9] Fix | Delete
// module.audio-video.matriska.php //
[10] Fix | Delete
// module for analyzing Matroska containers //
[11] Fix | Delete
// dependencies: NONE //
[12] Fix | Delete
// ///
[13] Fix | Delete
/////////////////////////////////////////////////////////////////
[14] Fix | Delete
[15] Fix | Delete
if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
[16] Fix | Delete
exit;
[17] Fix | Delete
}
[18] Fix | Delete
[19] Fix | Delete
define('EBML_ID_CHAPTERS', 0x0043A770); // [10][43][A7][70] -- A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation.
[20] Fix | Delete
define('EBML_ID_SEEKHEAD', 0x014D9B74); // [11][4D][9B][74] -- Contains the position of other level 1 elements.
[21] Fix | Delete
define('EBML_ID_TAGS', 0x0254C367); // [12][54][C3][67] -- Element containing elements specific to Tracks/Chapters. A list of valid tags can be found <http://www.matroska.org/technical/specs/tagging/index.html>.
[22] Fix | Delete
define('EBML_ID_INFO', 0x0549A966); // [15][49][A9][66] -- Contains miscellaneous general information and statistics on the file.
[23] Fix | Delete
define('EBML_ID_TRACKS', 0x0654AE6B); // [16][54][AE][6B] -- A top-level block of information with many tracks described.
[24] Fix | Delete
define('EBML_ID_SEGMENT', 0x08538067); // [18][53][80][67] -- This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment.
[25] Fix | Delete
define('EBML_ID_ATTACHMENTS', 0x0941A469); // [19][41][A4][69] -- Contain attached files.
[26] Fix | Delete
define('EBML_ID_EBML', 0x0A45DFA3); // [1A][45][DF][A3] -- Set the EBML characteristics of the data to follow. Each EBML document has to start with this.
[27] Fix | Delete
define('EBML_ID_CUES', 0x0C53BB6B); // [1C][53][BB][6B] -- A top-level element to speed seeking access. All entries are local to the segment.
[28] Fix | Delete
define('EBML_ID_CLUSTER', 0x0F43B675); // [1F][43][B6][75] -- The lower level element containing the (monolithic) Block structure.
[29] Fix | Delete
define('EBML_ID_LANGUAGE', 0x02B59C); // [22][B5][9C] -- Specifies the language of the track in the Matroska languages form.
[30] Fix | Delete
define('EBML_ID_TRACKTIMECODESCALE', 0x03314F); // [23][31][4F] -- The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs).
[31] Fix | Delete
define('EBML_ID_DEFAULTDURATION', 0x03E383); // [23][E3][83] -- Number of nanoseconds (i.e. not scaled) per frame.
[32] Fix | Delete
define('EBML_ID_CODECNAME', 0x058688); // [25][86][88] -- A human-readable string specifying the codec.
[33] Fix | Delete
define('EBML_ID_CODECDOWNLOADURL', 0x06B240); // [26][B2][40] -- A URL to download about the codec used.
[34] Fix | Delete
define('EBML_ID_TIMECODESCALE', 0x0AD7B1); // [2A][D7][B1] -- Timecode scale in nanoseconds (1.000.000 means all timecodes in the segment are expressed in milliseconds).
[35] Fix | Delete
define('EBML_ID_COLOURSPACE', 0x0EB524); // [2E][B5][24] -- Same value as in AVI (32 bits).
[36] Fix | Delete
define('EBML_ID_GAMMAVALUE', 0x0FB523); // [2F][B5][23] -- Gamma Value.
[37] Fix | Delete
define('EBML_ID_CODECSETTINGS', 0x1A9697); // [3A][96][97] -- A string describing the encoding setting used.
[38] Fix | Delete
define('EBML_ID_CODECINFOURL', 0x1B4040); // [3B][40][40] -- A URL to find information about the codec used.
[39] Fix | Delete
define('EBML_ID_PREVFILENAME', 0x1C83AB); // [3C][83][AB] -- An escaped filename corresponding to the previous segment.
[40] Fix | Delete
define('EBML_ID_PREVUID', 0x1CB923); // [3C][B9][23] -- A unique ID to identify the previous chained segment (128 bits).
[41] Fix | Delete
define('EBML_ID_NEXTFILENAME', 0x1E83BB); // [3E][83][BB] -- An escaped filename corresponding to the next segment.
[42] Fix | Delete
define('EBML_ID_NEXTUID', 0x1EB923); // [3E][B9][23] -- A unique ID to identify the next chained segment (128 bits).
[43] Fix | Delete
define('EBML_ID_CONTENTCOMPALGO', 0x0254); // [42][54] -- The compression algorithm used. Algorithms that have been specified so far are:
[44] Fix | Delete
define('EBML_ID_CONTENTCOMPSETTINGS', 0x0255); // [42][55] -- Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track.
[45] Fix | Delete
define('EBML_ID_DOCTYPE', 0x0282); // [42][82] -- A string that describes the type of document that follows this EBML header ('matroska' in our case).
[46] Fix | Delete
define('EBML_ID_DOCTYPEREADVERSION', 0x0285); // [42][85] -- The minimum DocType version an interpreter has to support to read this file.
[47] Fix | Delete
define('EBML_ID_EBMLVERSION', 0x0286); // [42][86] -- The version of EBML parser used to create the file.
[48] Fix | Delete
define('EBML_ID_DOCTYPEVERSION', 0x0287); // [42][87] -- The version of DocType interpreter used to create the file.
[49] Fix | Delete
define('EBML_ID_EBMLMAXIDLENGTH', 0x02F2); // [42][F2] -- The maximum length of the IDs you'll find in this file (4 or less in Matroska).
[50] Fix | Delete
define('EBML_ID_EBMLMAXSIZELENGTH', 0x02F3); // [42][F3] -- The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid.
[51] Fix | Delete
define('EBML_ID_EBMLREADVERSION', 0x02F7); // [42][F7] -- The minimum EBML version a parser has to support to read this file.
[52] Fix | Delete
define('EBML_ID_CHAPLANGUAGE', 0x037C); // [43][7C] -- The languages corresponding to the string, in the bibliographic ISO-639-2 form.
[53] Fix | Delete
define('EBML_ID_CHAPCOUNTRY', 0x037E); // [43][7E] -- The countries corresponding to the string, same 2 octets as in Internet domains.
[54] Fix | Delete
define('EBML_ID_SEGMENTFAMILY', 0x0444); // [44][44] -- A randomly generated unique ID that all segments related to each other must use (128 bits).
[55] Fix | Delete
define('EBML_ID_DATEUTC', 0x0461); // [44][61] -- Date of the origin of timecode (value 0), i.e. production date.
[56] Fix | Delete
define('EBML_ID_TAGLANGUAGE', 0x047A); // [44][7A] -- Specifies the language of the tag specified, in the Matroska languages form.
[57] Fix | Delete
define('EBML_ID_TAGDEFAULT', 0x0484); // [44][84] -- Indication to know if this is the default/original language to use for the given tag.
[58] Fix | Delete
define('EBML_ID_TAGBINARY', 0x0485); // [44][85] -- The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString.
[59] Fix | Delete
define('EBML_ID_TAGSTRING', 0x0487); // [44][87] -- The value of the Tag.
[60] Fix | Delete
define('EBML_ID_DURATION', 0x0489); // [44][89] -- Duration of the segment (based on TimecodeScale).
[61] Fix | Delete
define('EBML_ID_CHAPPROCESSPRIVATE', 0x050D); // [45][0D] -- Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.
[62] Fix | Delete
define('EBML_ID_CHAPTERFLAGENABLED', 0x0598); // [45][98] -- Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter.
[63] Fix | Delete
define('EBML_ID_TAGNAME', 0x05A3); // [45][A3] -- The name of the Tag that is going to be stored.
[64] Fix | Delete
define('EBML_ID_EDITIONENTRY', 0x05B9); // [45][B9] -- Contains all information about a segment edition.
[65] Fix | Delete
define('EBML_ID_EDITIONUID', 0x05BC); // [45][BC] -- A unique ID to identify the edition. It's useful for tagging an edition.
[66] Fix | Delete
define('EBML_ID_EDITIONFLAGHIDDEN', 0x05BD); // [45][BD] -- If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks).
[67] Fix | Delete
define('EBML_ID_EDITIONFLAGDEFAULT', 0x05DB); // [45][DB] -- If a flag is set (1) the edition should be used as the default one.
[68] Fix | Delete
define('EBML_ID_EDITIONFLAGORDERED', 0x05DD); // [45][DD] -- Specify if the chapters can be defined multiple times and the order to play them is enforced.
[69] Fix | Delete
define('EBML_ID_FILEDATA', 0x065C); // [46][5C] -- The data of the file.
[70] Fix | Delete
define('EBML_ID_FILEMIMETYPE', 0x0660); // [46][60] -- MIME type of the file.
[71] Fix | Delete
define('EBML_ID_FILENAME', 0x066E); // [46][6E] -- Filename of the attached file.
[72] Fix | Delete
define('EBML_ID_FILEREFERRAL', 0x0675); // [46][75] -- A binary value that a track/codec can refer to when the attachment is needed.
[73] Fix | Delete
define('EBML_ID_FILEDESCRIPTION', 0x067E); // [46][7E] -- A human-friendly name for the attached file.
[74] Fix | Delete
define('EBML_ID_FILEUID', 0x06AE); // [46][AE] -- Unique ID representing the file, as random as possible.
[75] Fix | Delete
define('EBML_ID_CONTENTENCALGO', 0x07E1); // [47][E1] -- The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values:
[76] Fix | Delete
define('EBML_ID_CONTENTENCKEYID', 0x07E2); // [47][E2] -- For public key algorithms this is the ID of the public key the data was encrypted with.
[77] Fix | Delete
define('EBML_ID_CONTENTSIGNATURE', 0x07E3); // [47][E3] -- A cryptographic signature of the contents.
[78] Fix | Delete
define('EBML_ID_CONTENTSIGKEYID', 0x07E4); // [47][E4] -- This is the ID of the private key the data was signed with.
[79] Fix | Delete
define('EBML_ID_CONTENTSIGALGO', 0x07E5); // [47][E5] -- The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values:
[80] Fix | Delete
define('EBML_ID_CONTENTSIGHASHALGO', 0x07E6); // [47][E6] -- The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values:
[81] Fix | Delete
define('EBML_ID_MUXINGAPP', 0x0D80); // [4D][80] -- Muxing application or library ("libmatroska-0.4.3").
[82] Fix | Delete
define('EBML_ID_SEEK', 0x0DBB); // [4D][BB] -- Contains a single seek entry to an EBML element.
[83] Fix | Delete
define('EBML_ID_CONTENTENCODINGORDER', 0x1031); // [50][31] -- Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment.
[84] Fix | Delete
define('EBML_ID_CONTENTENCODINGSCOPE', 0x1032); // [50][32] -- A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values:
[85] Fix | Delete
define('EBML_ID_CONTENTENCODINGTYPE', 0x1033); // [50][33] -- A value describing what kind of transformation has been done. Possible values:
[86] Fix | Delete
define('EBML_ID_CONTENTCOMPRESSION', 0x1034); // [50][34] -- Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking.
[87] Fix | Delete
define('EBML_ID_CONTENTENCRYPTION', 0x1035); // [50][35] -- Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise.
[88] Fix | Delete
define('EBML_ID_CUEREFNUMBER', 0x135F); // [53][5F] -- Number of the referenced Block of Track X in the specified Cluster.
[89] Fix | Delete
define('EBML_ID_NAME', 0x136E); // [53][6E] -- A human-readable track name.
[90] Fix | Delete
define('EBML_ID_CUEBLOCKNUMBER', 0x1378); // [53][78] -- Number of the Block in the specified Cluster.
[91] Fix | Delete
define('EBML_ID_TRACKOFFSET', 0x137F); // [53][7F] -- A value to add to the Block's Timecode. This can be used to adjust the playback offset of a track.
[92] Fix | Delete
define('EBML_ID_SEEKID', 0x13AB); // [53][AB] -- The binary ID corresponding to the element name.
[93] Fix | Delete
define('EBML_ID_SEEKPOSITION', 0x13AC); // [53][AC] -- The position of the element in the segment in octets (0 = first level 1 element).
[94] Fix | Delete
define('EBML_ID_STEREOMODE', 0x13B8); // [53][B8] -- Stereo-3D video mode.
[95] Fix | Delete
define('EBML_ID_OLDSTEREOMODE', 0x13B9); // [53][B9] -- Bogus StereoMode value used in old versions of libmatroska. DO NOT USE. (0: mono, 1: right eye, 2: left eye, 3: both eyes).
[96] Fix | Delete
define('EBML_ID_PIXELCROPBOTTOM', 0x14AA); // [54][AA] -- The number of video pixels to remove at the bottom of the image (for HDTV content).
[97] Fix | Delete
define('EBML_ID_DISPLAYWIDTH', 0x14B0); // [54][B0] -- Width of the video frames to display.
[98] Fix | Delete
define('EBML_ID_DISPLAYUNIT', 0x14B2); // [54][B2] -- Type of the unit for DisplayWidth/Height (0: pixels, 1: centimeters, 2: inches).
[99] Fix | Delete
define('EBML_ID_ASPECTRATIOTYPE', 0x14B3); // [54][B3] -- Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed).
[100] Fix | Delete
define('EBML_ID_DISPLAYHEIGHT', 0x14BA); // [54][BA] -- Height of the video frames to display.
[101] Fix | Delete
define('EBML_ID_PIXELCROPTOP', 0x14BB); // [54][BB] -- The number of video pixels to remove at the top of the image.
[102] Fix | Delete
define('EBML_ID_PIXELCROPLEFT', 0x14CC); // [54][CC] -- The number of video pixels to remove on the left of the image.
[103] Fix | Delete
define('EBML_ID_PIXELCROPRIGHT', 0x14DD); // [54][DD] -- The number of video pixels to remove on the right of the image.
[104] Fix | Delete
define('EBML_ID_FLAGFORCED', 0x15AA); // [55][AA] -- Set if that track MUST be used during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind.
[105] Fix | Delete
define('EBML_ID_MAXBLOCKADDITIONID', 0x15EE); // [55][EE] -- The maximum value of BlockAddID. A value 0 means there is no BlockAdditions for this track.
[106] Fix | Delete
define('EBML_ID_WRITINGAPP', 0x1741); // [57][41] -- Writing application ("mkvmerge-0.3.3").
[107] Fix | Delete
define('EBML_ID_CLUSTERSILENTTRACKS', 0x1854); // [58][54] -- The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use.
[108] Fix | Delete
define('EBML_ID_CLUSTERSILENTTRACKNUMBER', 0x18D7); // [58][D7] -- One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster.
[109] Fix | Delete
define('EBML_ID_ATTACHEDFILE', 0x21A7); // [61][A7] -- An attached file.
[110] Fix | Delete
define('EBML_ID_CONTENTENCODING', 0x2240); // [62][40] -- Settings for one content encoding like compression or encryption.
[111] Fix | Delete
define('EBML_ID_BITDEPTH', 0x2264); // [62][64] -- Bits per sample, mostly used for PCM.
[112] Fix | Delete
define('EBML_ID_CODECPRIVATE', 0x23A2); // [63][A2] -- Private data only known to the codec.
[113] Fix | Delete
define('EBML_ID_TARGETS', 0x23C0); // [63][C0] -- Contain all UIDs where the specified meta data apply. It is void to describe everything in the segment.
[114] Fix | Delete
define('EBML_ID_CHAPTERPHYSICALEQUIV', 0x23C3); // [63][C3] -- Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.
[115] Fix | Delete
define('EBML_ID_TAGCHAPTERUID', 0x23C4); // [63][C4] -- A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment.
[116] Fix | Delete
define('EBML_ID_TAGTRACKUID', 0x23C5); // [63][C5] -- A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment.
[117] Fix | Delete
define('EBML_ID_TAGATTACHMENTUID', 0x23C6); // [63][C6] -- A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment.
[118] Fix | Delete
define('EBML_ID_TAGEDITIONUID', 0x23C9); // [63][C9] -- A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment.
[119] Fix | Delete
define('EBML_ID_TARGETTYPE', 0x23CA); // [63][CA] -- An informational string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).
[120] Fix | Delete
define('EBML_ID_TRACKTRANSLATE', 0x2624); // [66][24] -- The track identification for the given Chapter Codec.
[121] Fix | Delete
define('EBML_ID_TRACKTRANSLATETRACKID', 0x26A5); // [66][A5] -- The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used.
[122] Fix | Delete
define('EBML_ID_TRACKTRANSLATECODEC', 0x26BF); // [66][BF] -- The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).
[123] Fix | Delete
define('EBML_ID_TRACKTRANSLATEEDITIONUID', 0x26FC); // [66][FC] -- Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment.
[124] Fix | Delete
define('EBML_ID_SIMPLETAG', 0x27C8); // [67][C8] -- Contains general information about the target.
[125] Fix | Delete
define('EBML_ID_TARGETTYPEVALUE', 0x28CA); // [68][CA] -- A number to indicate the logical level of the target (see TargetType).
[126] Fix | Delete
define('EBML_ID_CHAPPROCESSCOMMAND', 0x2911); // [69][11] -- Contains all the commands associated to the Atom.
[127] Fix | Delete
define('EBML_ID_CHAPPROCESSTIME', 0x2922); // [69][22] -- Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter).
[128] Fix | Delete
define('EBML_ID_CHAPTERTRANSLATE', 0x2924); // [69][24] -- A tuple of corresponding ID used by chapter codecs to represent this segment.
[129] Fix | Delete
define('EBML_ID_CHAPPROCESSDATA', 0x2933); // [69][33] -- Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands.
[130] Fix | Delete
define('EBML_ID_CHAPPROCESS', 0x2944); // [69][44] -- Contains all the commands associated to the Atom.
[131] Fix | Delete
define('EBML_ID_CHAPPROCESSCODECID', 0x2955); // [69][55] -- Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later.
[132] Fix | Delete
define('EBML_ID_CHAPTERTRANSLATEID', 0x29A5); // [69][A5] -- The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used.
[133] Fix | Delete
define('EBML_ID_CHAPTERTRANSLATECODEC', 0x29BF); // [69][BF] -- The chapter codec using this ID (0: Matroska Script, 1: DVD-menu).
[134] Fix | Delete
define('EBML_ID_CHAPTERTRANSLATEEDITIONUID', 0x29FC); // [69][FC] -- Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment.
[135] Fix | Delete
define('EBML_ID_CONTENTENCODINGS', 0x2D80); // [6D][80] -- Settings for several content encoding mechanisms like compression or encryption.
[136] Fix | Delete
define('EBML_ID_MINCACHE', 0x2DE7); // [6D][E7] -- The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used.
[137] Fix | Delete
define('EBML_ID_MAXCACHE', 0x2DF8); // [6D][F8] -- The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed.
[138] Fix | Delete
define('EBML_ID_CHAPTERSEGMENTUID', 0x2E67); // [6E][67] -- A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used.
[139] Fix | Delete
define('EBML_ID_CHAPTERSEGMENTEDITIONUID', 0x2EBC); // [6E][BC] -- The edition to play from the segment linked in ChapterSegmentUID.
[140] Fix | Delete
define('EBML_ID_TRACKOVERLAY', 0x2FAB); // [6F][AB] -- Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc.
[141] Fix | Delete
define('EBML_ID_TAG', 0x3373); // [73][73] -- Element containing elements specific to Tracks/Chapters.
[142] Fix | Delete
define('EBML_ID_SEGMENTFILENAME', 0x3384); // [73][84] -- A filename corresponding to this segment.
[143] Fix | Delete
define('EBML_ID_SEGMENTUID', 0x33A4); // [73][A4] -- A randomly generated unique ID to identify the current segment between many others (128 bits).
[144] Fix | Delete
define('EBML_ID_CHAPTERUID', 0x33C4); // [73][C4] -- A unique ID to identify the Chapter.
[145] Fix | Delete
define('EBML_ID_TRACKUID', 0x33C5); // [73][C5] -- A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file.
[146] Fix | Delete
define('EBML_ID_ATTACHMENTLINK', 0x3446); // [74][46] -- The UID of an attachment that is used by this codec.
[147] Fix | Delete
define('EBML_ID_CLUSTERBLOCKADDITIONS', 0x35A1); // [75][A1] -- Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data.
[148] Fix | Delete
define('EBML_ID_CHANNELPOSITIONS', 0x347B); // [7D][7B] -- Table of horizontal angles for each successive channel, see appendix.
[149] Fix | Delete
define('EBML_ID_OUTPUTSAMPLINGFREQUENCY', 0x38B5); // [78][B5] -- Real output sampling frequency in Hz (used for SBR techniques).
[150] Fix | Delete
define('EBML_ID_TITLE', 0x3BA9); // [7B][A9] -- General name of the segment.
[151] Fix | Delete
define('EBML_ID_CHAPTERDISPLAY', 0x00); // [80] -- Contains all possible strings to use for the chapter display.
[152] Fix | Delete
define('EBML_ID_TRACKTYPE', 0x03); // [83] -- A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control).
[153] Fix | Delete
define('EBML_ID_CHAPSTRING', 0x05); // [85] -- Contains the string to use as the chapter atom.
[154] Fix | Delete
define('EBML_ID_CODECID', 0x06); // [86] -- An ID corresponding to the codec, see the codec page for more info.
[155] Fix | Delete
define('EBML_ID_FLAGDEFAULT', 0x08); // [88] -- Set if that track (audio, video or subs) SHOULD be used if no language found matches the user preference.
[156] Fix | Delete
define('EBML_ID_CHAPTERTRACKNUMBER', 0x09); // [89] -- UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks.
[157] Fix | Delete
define('EBML_ID_CLUSTERSLICES', 0x0E); // [8E] -- Contains slices description.
[158] Fix | Delete
define('EBML_ID_CHAPTERTRACK', 0x0F); // [8F] -- List of tracks on which the chapter applies. If this element is not present, all tracks apply
[159] Fix | Delete
define('EBML_ID_CHAPTERTIMESTART', 0x11); // [91] -- Timecode of the start of Chapter (not scaled).
[160] Fix | Delete
define('EBML_ID_CHAPTERTIMEEND', 0x12); // [92] -- Timecode of the end of Chapter (timecode excluded, not scaled).
[161] Fix | Delete
define('EBML_ID_CUEREFTIME', 0x16); // [96] -- Timecode of the referenced Block.
[162] Fix | Delete
define('EBML_ID_CUEREFCLUSTER', 0x17); // [97] -- Position of the Cluster containing the referenced Block.
[163] Fix | Delete
define('EBML_ID_CHAPTERFLAGHIDDEN', 0x18); // [98] -- If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks).
[164] Fix | Delete
define('EBML_ID_FLAGINTERLACED', 0x1A); // [9A] -- Set if the video is interlaced.
[165] Fix | Delete
define('EBML_ID_CLUSTERBLOCKDURATION', 0x1B); // [9B] -- The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track. When not written and with no DefaultDuration, the value is assumed to be the difference between the timecode of this Block and the timecode of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks.
[166] Fix | Delete
define('EBML_ID_FLAGLACING', 0x1C); // [9C] -- Set if the track may contain blocks using lacing.
[167] Fix | Delete
define('EBML_ID_CHANNELS', 0x1F); // [9F] -- Numbers of channels in the track.
[168] Fix | Delete
define('EBML_ID_CLUSTERBLOCKGROUP', 0x20); // [A0] -- Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock.
[169] Fix | Delete
define('EBML_ID_CLUSTERBLOCK', 0x21); // [A1] -- Block containing the actual data to be rendered and a timecode relative to the Cluster Timecode.
[170] Fix | Delete
define('EBML_ID_CLUSTERBLOCKVIRTUAL', 0x22); // [A2] -- A Block with no data. It must be stored in the stream at the place the real Block should be in display order.
[171] Fix | Delete
define('EBML_ID_CLUSTERSIMPLEBLOCK', 0x23); // [A3] -- Similar to Block but without all the extra information, mostly used to reduced overhead when no extra feature is needed.
[172] Fix | Delete
define('EBML_ID_CLUSTERCODECSTATE', 0x24); // [A4] -- The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry.
[173] Fix | Delete
define('EBML_ID_CLUSTERBLOCKADDITIONAL', 0x25); // [A5] -- Interpreted by the codec as it wishes (using the BlockAddID).
[174] Fix | Delete
define('EBML_ID_CLUSTERBLOCKMORE', 0x26); // [A6] -- Contain the BlockAdditional and some parameters.
[175] Fix | Delete
define('EBML_ID_CLUSTERPOSITION', 0x27); // [A7] -- Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.
[176] Fix | Delete
define('EBML_ID_CODECDECODEALL', 0x2A); // [AA] -- The codec can decode potentially damaged data.
[177] Fix | Delete
define('EBML_ID_CLUSTERPREVSIZE', 0x2B); // [AB] -- Size of the previous Cluster, in octets. Can be useful for backward playing.
[178] Fix | Delete
define('EBML_ID_TRACKENTRY', 0x2E); // [AE] -- Describes a track with all elements.
[179] Fix | Delete
define('EBML_ID_CLUSTERENCRYPTEDBLOCK', 0x2F); // [AF] -- Similar to SimpleBlock but the data inside the Block are Transformed (encrypt and/or signed).
[180] Fix | Delete
define('EBML_ID_PIXELWIDTH', 0x30); // [B0] -- Width of the encoded video frames in pixels.
[181] Fix | Delete
define('EBML_ID_CUETIME', 0x33); // [B3] -- Absolute timecode according to the segment time base.
[182] Fix | Delete
define('EBML_ID_SAMPLINGFREQUENCY', 0x35); // [B5] -- Sampling frequency in Hz.
[183] Fix | Delete
define('EBML_ID_CHAPTERATOM', 0x36); // [B6] -- Contains the atom information to use as the chapter atom (apply to all tracks).
[184] Fix | Delete
define('EBML_ID_CUETRACKPOSITIONS', 0x37); // [B7] -- Contain positions for different tracks corresponding to the timecode.
[185] Fix | Delete
define('EBML_ID_FLAGENABLED', 0x39); // [B9] -- Set if the track is used.
[186] Fix | Delete
define('EBML_ID_PIXELHEIGHT', 0x3A); // [BA] -- Height of the encoded video frames in pixels.
[187] Fix | Delete
define('EBML_ID_CUEPOINT', 0x3B); // [BB] -- Contains all information relative to a seek point in the segment.
[188] Fix | Delete
define('EBML_ID_CRC32', 0x3F); // [BF] -- The CRC is computed on all the data of the Master element it's in, regardless of its position. It's recommended to put the CRC value at the beggining of the Master element for easier reading. All level 1 elements should include a CRC-32.
[189] Fix | Delete
define('EBML_ID_CLUSTERBLOCKADDITIONID', 0x4B); // [CB] -- The ID of the BlockAdditional element (0 is the main Block).
[190] Fix | Delete
define('EBML_ID_CLUSTERLACENUMBER', 0x4C); // [CC] -- The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.
[191] Fix | Delete
define('EBML_ID_CLUSTERFRAMENUMBER', 0x4D); // [CD] -- The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame).
[192] Fix | Delete
define('EBML_ID_CLUSTERDELAY', 0x4E); // [CE] -- The (scaled) delay to apply to the element.
[193] Fix | Delete
define('EBML_ID_CLUSTERDURATION', 0x4F); // [CF] -- The (scaled) duration to apply to the element.
[194] Fix | Delete
define('EBML_ID_TRACKNUMBER', 0x57); // [D7] -- The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number).
[195] Fix | Delete
define('EBML_ID_CUEREFERENCE', 0x5B); // [DB] -- The Clusters containing the required referenced Blocks.
[196] Fix | Delete
define('EBML_ID_VIDEO', 0x60); // [E0] -- Video settings.
[197] Fix | Delete
define('EBML_ID_AUDIO', 0x61); // [E1] -- Audio settings.
[198] Fix | Delete
define('EBML_ID_CLUSTERTIMESLICE', 0x68); // [E8] -- Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback.
[199] Fix | Delete
define('EBML_ID_CUECODECSTATE', 0x6A); // [EA] -- The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry.
[200] Fix | Delete
define('EBML_ID_CUEREFCODECSTATE', 0x6B); // [EB] -- The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry.
[201] Fix | Delete
define('EBML_ID_VOID', 0x6C); // [EC] -- Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use.
[202] Fix | Delete
define('EBML_ID_CLUSTERTIMECODE', 0x67); // [E7] -- Absolute timecode of the cluster (based on TimecodeScale).
[203] Fix | Delete
define('EBML_ID_CLUSTERBLOCKADDID', 0x6E); // [EE] -- An ID to identify the BlockAdditional level.
[204] Fix | Delete
define('EBML_ID_CUECLUSTERPOSITION', 0x71); // [F1] -- The position of the Cluster containing the required Block.
[205] Fix | Delete
define('EBML_ID_CUETRACK', 0x77); // [F7] -- The track for which a position is given.
[206] Fix | Delete
define('EBML_ID_CLUSTERREFERENCEPRIORITY', 0x7A); // [FA] -- This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced.
[207] Fix | Delete
define('EBML_ID_CLUSTERREFERENCEBLOCK', 0x7B); // [FB] -- Timecode of another frame used as a reference (ie: B or P frame). The timecode is relative to the block it's attached to.
[208] Fix | Delete
define('EBML_ID_CLUSTERREFERENCEVIRTUAL', 0x7D); // [FD] -- Relative position of the data that should be in position of the virtual block.
[209] Fix | Delete
[210] Fix | Delete
[211] Fix | Delete
/**
[212] Fix | Delete
* @tutorial http://www.matroska.org/technical/specs/index.html
[213] Fix | Delete
*
[214] Fix | Delete
* @todo Rewrite EBML parser to reduce it's size and honor default element values
[215] Fix | Delete
* @todo After rewrite implement stream size calculation, that will provide additional useful info and enable AAC/FLAC audio bitrate detection
[216] Fix | Delete
*/
[217] Fix | Delete
class getid3_matroska extends getid3_handler
[218] Fix | Delete
{
[219] Fix | Delete
/**
[220] Fix | Delete
* If true, do not return information about CLUSTER chunks, since there's a lot of them
[221] Fix | Delete
* and they're not usually useful [default: TRUE].
[222] Fix | Delete
*
[223] Fix | Delete
* @var bool
[224] Fix | Delete
*/
[225] Fix | Delete
public static $hide_clusters = true;
[226] Fix | Delete
[227] Fix | Delete
/**
[228] Fix | Delete
* True to parse the whole file, not only header [default: FALSE].
[229] Fix | Delete
*
[230] Fix | Delete
* @var bool
[231] Fix | Delete
*/
[232] Fix | Delete
public static $parse_whole_file = false;
[233] Fix | Delete
[234] Fix | Delete
/*
[235] Fix | Delete
* Private parser settings/placeholders.
[236] Fix | Delete
*/
[237] Fix | Delete
private $EBMLbuffer = '';
[238] Fix | Delete
private $EBMLbuffer_offset = 0;
[239] Fix | Delete
private $EBMLbuffer_length = 0;
[240] Fix | Delete
private $current_offset = 0;
[241] Fix | Delete
private $unuseful_elements = array(EBML_ID_CRC32, EBML_ID_VOID);
[242] Fix | Delete
[243] Fix | Delete
/**
[244] Fix | Delete
* @return bool
[245] Fix | Delete
*/
[246] Fix | Delete
public function Analyze()
[247] Fix | Delete
{
[248] Fix | Delete
$info = &$this->getid3->info;
[249] Fix | Delete
[250] Fix | Delete
// parse container
[251] Fix | Delete
try {
[252] Fix | Delete
$this->parseEBML($info);
[253] Fix | Delete
} catch (Exception $e) {
[254] Fix | Delete
$this->error('EBML parser: '.$e->getMessage());
[255] Fix | Delete
}
[256] Fix | Delete
[257] Fix | Delete
// calculate playtime
[258] Fix | Delete
if (isset($info['matroska']['info']) && is_array($info['matroska']['info'])) {
[259] Fix | Delete
foreach ($info['matroska']['info'] as $key => $infoarray) {
[260] Fix | Delete
if (isset($infoarray['Duration'])) {
[261] Fix | Delete
// TimecodeScale is how many nanoseconds each Duration unit is
[262] Fix | Delete
$info['playtime_seconds'] = $infoarray['Duration'] * ((isset($infoarray['TimecodeScale']) ? $infoarray['TimecodeScale'] : 1000000) / 1000000000);
[263] Fix | Delete
break;
[264] Fix | Delete
}
[265] Fix | Delete
}
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
// extract tags
[269] Fix | Delete
if (isset($info['matroska']['tags']) && is_array($info['matroska']['tags'])) {
[270] Fix | Delete
foreach ($info['matroska']['tags'] as $key => $infoarray) {
[271] Fix | Delete
$this->ExtractCommentsSimpleTag($infoarray);
[272] Fix | Delete
}
[273] Fix | Delete
}
[274] Fix | Delete
[275] Fix | Delete
// process tracks
[276] Fix | Delete
if (isset($info['matroska']['tracks']['tracks']) && is_array($info['matroska']['tracks']['tracks'])) {
[277] Fix | Delete
foreach ($info['matroska']['tracks']['tracks'] as $key => $trackarray) {
[278] Fix | Delete
[279] Fix | Delete
$track_info = array();
[280] Fix | Delete
$track_info['dataformat'] = self::CodecIDtoCommonName($trackarray['CodecID']);
[281] Fix | Delete
$track_info['default'] = (isset($trackarray['FlagDefault']) ? $trackarray['FlagDefault'] : true);
[282] Fix | Delete
if (isset($trackarray['Name'])) { $track_info['name'] = $trackarray['Name']; }
[283] Fix | Delete
[284] Fix | Delete
switch ($trackarray['TrackType']) {
[285] Fix | Delete
[286] Fix | Delete
case 1: // Video
[287] Fix | Delete
$track_info['resolution_x'] = $trackarray['PixelWidth'];
[288] Fix | Delete
$track_info['resolution_y'] = $trackarray['PixelHeight'];
[289] Fix | Delete
$track_info['display_unit'] = self::displayUnit(isset($trackarray['DisplayUnit']) ? $trackarray['DisplayUnit'] : 0);
[290] Fix | Delete
$track_info['display_x'] = (isset($trackarray['DisplayWidth']) ? $trackarray['DisplayWidth'] : $trackarray['PixelWidth']);
[291] Fix | Delete
$track_info['display_y'] = (isset($trackarray['DisplayHeight']) ? $trackarray['DisplayHeight'] : $trackarray['PixelHeight']);
[292] Fix | Delete
[293] Fix | Delete
if (isset($trackarray['PixelCropBottom'])) { $track_info['crop_bottom'] = $trackarray['PixelCropBottom']; }
[294] Fix | Delete
if (isset($trackarray['PixelCropTop'])) { $track_info['crop_top'] = $trackarray['PixelCropTop']; }
[295] Fix | Delete
if (isset($trackarray['PixelCropLeft'])) { $track_info['crop_left'] = $trackarray['PixelCropLeft']; }
[296] Fix | Delete
if (isset($trackarray['PixelCropRight'])) { $track_info['crop_right'] = $trackarray['PixelCropRight']; }
[297] Fix | Delete
if (isset($trackarray['DefaultDuration'])) { $track_info['frame_rate'] = round(1000000000 / $trackarray['DefaultDuration'], 3); }
[298] Fix | Delete
if (isset($trackarray['CodecName'])) { $track_info['codec'] = $trackarray['CodecName']; }
[299] Fix | Delete
[300] Fix | Delete
switch ($trackarray['CodecID']) {
[301] Fix | Delete
case 'V_MS/VFW/FOURCC':
[302] Fix | Delete
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
[303] Fix | Delete
[304] Fix | Delete
$parsed = getid3_riff::ParseBITMAPINFOHEADER($trackarray['CodecPrivate']);
[305] Fix | Delete
$track_info['codec'] = getid3_riff::fourccLookup($parsed['fourcc']);
[306] Fix | Delete
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;
[307] Fix | Delete
break;
[308] Fix | Delete
[309] Fix | Delete
/*case 'V_MPEG4/ISO/AVC':
[310] Fix | Delete
$h264['profile'] = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 1, 1));
[311] Fix | Delete
$h264['level'] = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 3, 1));
[312] Fix | Delete
$rn = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 4, 1));
[313] Fix | Delete
$h264['NALUlength'] = ($rn & 3) + 1;
[314] Fix | Delete
$rn = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], 5, 1));
[315] Fix | Delete
$nsps = ($rn & 31);
[316] Fix | Delete
$offset = 6;
[317] Fix | Delete
for ($i = 0; $i < $nsps; $i ++) {
[318] Fix | Delete
$length = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));
[319] Fix | Delete
$h264['SPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);
[320] Fix | Delete
$offset += 2 + $length;
[321] Fix | Delete
}
[322] Fix | Delete
$npps = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 1));
[323] Fix | Delete
$offset += 1;
[324] Fix | Delete
for ($i = 0; $i < $npps; $i ++) {
[325] Fix | Delete
$length = getid3_lib::BigEndian2Int(substr($trackarray['CodecPrivate'], $offset, 2));
[326] Fix | Delete
$h264['PPS'][] = substr($trackarray['CodecPrivate'], $offset + 2, $length);
[327] Fix | Delete
$offset += 2 + $length;
[328] Fix | Delete
}
[329] Fix | Delete
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $h264;
[330] Fix | Delete
break;*/
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
$info['video']['streams'][$trackarray['TrackUID']] = $track_info;
[334] Fix | Delete
break;
[335] Fix | Delete
[336] Fix | Delete
case 2: // Audio
[337] Fix | Delete
$track_info['sample_rate'] = (isset($trackarray['SamplingFrequency']) ? $trackarray['SamplingFrequency'] : 8000.0);
[338] Fix | Delete
$track_info['channels'] = (isset($trackarray['Channels']) ? $trackarray['Channels'] : 1);
[339] Fix | Delete
$track_info['language'] = (isset($trackarray['Language']) ? $trackarray['Language'] : 'eng');
[340] Fix | Delete
if (isset($trackarray['BitDepth'])) { $track_info['bits_per_sample'] = $trackarray['BitDepth']; }
[341] Fix | Delete
if (isset($trackarray['CodecName'])) { $track_info['codec'] = $trackarray['CodecName']; }
[342] Fix | Delete
[343] Fix | Delete
switch ($trackarray['CodecID']) {
[344] Fix | Delete
case 'A_PCM/INT/LIT':
[345] Fix | Delete
case 'A_PCM/INT/BIG':
[346] Fix | Delete
$track_info['bitrate'] = $track_info['sample_rate'] * $track_info['channels'] * $trackarray['BitDepth'];
[347] Fix | Delete
break;
[348] Fix | Delete
[349] Fix | Delete
case 'A_AC3':
[350] Fix | Delete
case 'A_EAC3':
[351] Fix | Delete
case 'A_DTS':
[352] Fix | Delete
case 'A_MPEG/L3':
[353] Fix | Delete
case 'A_MPEG/L2':
[354] Fix | Delete
case 'A_FLAC':
[355] Fix | Delete
$module_dataformat = ($track_info['dataformat'] == 'mp2' ? 'mp3' : ($track_info['dataformat'] == 'eac3' ? 'ac3' : $track_info['dataformat']));
[356] Fix | Delete
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.'.$module_dataformat.'.php', __FILE__, true);
[357] Fix | Delete
[358] Fix | Delete
if (!isset($info['matroska']['track_data_offsets'][$trackarray['TrackNumber']])) {
[359] Fix | Delete
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because $info[matroska][track_data_offsets]['.$trackarray['TrackNumber'].'] not set');
[360] Fix | Delete
break;
[361] Fix | Delete
}
[362] Fix | Delete
[363] Fix | Delete
// create temp instance
[364] Fix | Delete
$getid3_temp = new getID3();
[365] Fix | Delete
if ($track_info['dataformat'] != 'flac') {
[366] Fix | Delete
$getid3_temp->openfile($this->getid3->filename, $this->getid3->info['filesize'], $this->getid3->fp);
[367] Fix | Delete
}
[368] Fix | Delete
$getid3_temp->info['avdataoffset'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'];
[369] Fix | Delete
if ($track_info['dataformat'][0] == 'm' || $track_info['dataformat'] == 'flac') {
[370] Fix | Delete
$getid3_temp->info['avdataend'] = $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['offset'] + $info['matroska']['track_data_offsets'][$trackarray['TrackNumber']]['length'];
[371] Fix | Delete
}
[372] Fix | Delete
[373] Fix | Delete
// analyze
[374] Fix | Delete
$class = 'getid3_'.$module_dataformat;
[375] Fix | Delete
$header_data_key = $track_info['dataformat'][0] == 'm' ? 'mpeg' : $track_info['dataformat'];
[376] Fix | Delete
$getid3_audio = new $class($getid3_temp, __CLASS__);
[377] Fix | Delete
if ($track_info['dataformat'] == 'flac') {
[378] Fix | Delete
$getid3_audio->AnalyzeString($trackarray['CodecPrivate']);
[379] Fix | Delete
}
[380] Fix | Delete
else {
[381] Fix | Delete
$getid3_audio->Analyze();
[382] Fix | Delete
}
[383] Fix | Delete
if (!empty($getid3_temp->info[$header_data_key])) {
[384] Fix | Delete
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info[$header_data_key];
[385] Fix | Delete
if (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
[386] Fix | Delete
foreach ($getid3_temp->info['audio'] as $sub_key => $value) {
[387] Fix | Delete
$track_info[$sub_key] = $value;
[388] Fix | Delete
}
[389] Fix | Delete
}
[390] Fix | Delete
}
[391] Fix | Delete
else {
[392] Fix | Delete
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because '.$class.'::Analyze() failed at offset '.$getid3_temp->info['avdataoffset']);
[393] Fix | Delete
}
[394] Fix | Delete
[395] Fix | Delete
// copy errors and warnings
[396] Fix | Delete
if (!empty($getid3_temp->info['error'])) {
[397] Fix | Delete
foreach ($getid3_temp->info['error'] as $newerror) {
[398] Fix | Delete
$this->warning($class.'() says: ['.$newerror.']');
[399] Fix | Delete
}
[400] Fix | Delete
}
[401] Fix | Delete
if (!empty($getid3_temp->info['warning'])) {
[402] Fix | Delete
foreach ($getid3_temp->info['warning'] as $newerror) {
[403] Fix | Delete
$this->warning($class.'() says: ['.$newerror.']');
[404] Fix | Delete
}
[405] Fix | Delete
}
[406] Fix | Delete
unset($getid3_temp, $getid3_audio);
[407] Fix | Delete
break;
[408] Fix | Delete
[409] Fix | Delete
case 'A_AAC':
[410] Fix | Delete
case 'A_AAC/MPEG2/LC':
[411] Fix | Delete
case 'A_AAC/MPEG2/LC/SBR':
[412] Fix | Delete
case 'A_AAC/MPEG4/LC':
[413] Fix | Delete
case 'A_AAC/MPEG4/LC/SBR':
[414] Fix | Delete
$this->warning($trackarray['CodecID'].' audio data contains no header, audio/video bitrates can\'t be calculated');
[415] Fix | Delete
break;
[416] Fix | Delete
[417] Fix | Delete
case 'A_VORBIS':
[418] Fix | Delete
if (!isset($trackarray['CodecPrivate'])) {
[419] Fix | Delete
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because CodecPrivate data not set');
[420] Fix | Delete
break;
[421] Fix | Delete
}
[422] Fix | Delete
$vorbis_offset = strpos($trackarray['CodecPrivate'], 'vorbis', 1);
[423] Fix | Delete
if ($vorbis_offset === false) {
[424] Fix | Delete
$this->warning('Unable to parse audio data ['.basename(__FILE__).':'.__LINE__.'] because CodecPrivate data does not contain "vorbis" keyword');
[425] Fix | Delete
break;
[426] Fix | Delete
}
[427] Fix | Delete
$vorbis_offset -= 1;
[428] Fix | Delete
[429] Fix | Delete
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio.ogg.php', __FILE__, true);
[430] Fix | Delete
[431] Fix | Delete
// create temp instance
[432] Fix | Delete
$getid3_temp = new getID3();
[433] Fix | Delete
[434] Fix | Delete
// analyze
[435] Fix | Delete
$getid3_ogg = new getid3_ogg($getid3_temp);
[436] Fix | Delete
$oggpageinfo['page_seqno'] = 0;
[437] Fix | Delete
$getid3_ogg->ParseVorbisPageHeader($trackarray['CodecPrivate'], $vorbis_offset, $oggpageinfo);
[438] Fix | Delete
if (!empty($getid3_temp->info['ogg'])) {
[439] Fix | Delete
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $getid3_temp->info['ogg'];
[440] Fix | Delete
if (isset($getid3_temp->info['audio']) && is_array($getid3_temp->info['audio'])) {
[441] Fix | Delete
foreach ($getid3_temp->info['audio'] as $sub_key => $value) {
[442] Fix | Delete
$track_info[$sub_key] = $value;
[443] Fix | Delete
}
[444] Fix | Delete
}
[445] Fix | Delete
}
[446] Fix | Delete
[447] Fix | Delete
// copy errors and warnings
[448] Fix | Delete
if (!empty($getid3_temp->info['error'])) {
[449] Fix | Delete
foreach ($getid3_temp->info['error'] as $newerror) {
[450] Fix | Delete
$this->warning('getid3_ogg() says: ['.$newerror.']');
[451] Fix | Delete
}
[452] Fix | Delete
}
[453] Fix | Delete
if (!empty($getid3_temp->info['warning'])) {
[454] Fix | Delete
foreach ($getid3_temp->info['warning'] as $newerror) {
[455] Fix | Delete
$this->warning('getid3_ogg() says: ['.$newerror.']');
[456] Fix | Delete
}
[457] Fix | Delete
}
[458] Fix | Delete
[459] Fix | Delete
if (!empty($getid3_temp->info['ogg']['bitrate_nominal'])) {
[460] Fix | Delete
$track_info['bitrate'] = $getid3_temp->info['ogg']['bitrate_nominal'];
[461] Fix | Delete
}
[462] Fix | Delete
unset($getid3_temp, $getid3_ogg, $oggpageinfo, $vorbis_offset);
[463] Fix | Delete
break;
[464] Fix | Delete
[465] Fix | Delete
case 'A_MS/ACM':
[466] Fix | Delete
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.audio-video.riff.php', __FILE__, true);
[467] Fix | Delete
[468] Fix | Delete
$parsed = getid3_riff::parseWAVEFORMATex($trackarray['CodecPrivate']);
[469] Fix | Delete
foreach ($parsed as $sub_key => $value) {
[470] Fix | Delete
if ($sub_key != 'raw') {
[471] Fix | Delete
$track_info[$sub_key] = $value;
[472] Fix | Delete
}
[473] Fix | Delete
}
[474] Fix | Delete
$info['matroska']['track_codec_parsed'][$trackarray['TrackNumber']] = $parsed;
[475] Fix | Delete
break;
[476] Fix | Delete
[477] Fix | Delete
default:
[478] Fix | Delete
$this->warning('Unhandled audio type "'.(isset($trackarray['CodecID']) ? $trackarray['CodecID'] : '').'"');
[479] Fix | Delete
break;
[480] Fix | Delete
}
[481] Fix | Delete
[482] Fix | Delete
$info['audio']['streams'][$trackarray['TrackUID']] = $track_info;
[483] Fix | Delete
break;
[484] Fix | Delete
}
[485] Fix | Delete
}
[486] Fix | Delete
[487] Fix | Delete
if (!empty($info['video']['streams'])) {
[488] Fix | Delete
$info['video'] = self::getDefaultStreamInfo($info['video']['streams']);
[489] Fix | Delete
}
[490] Fix | Delete
if (!empty($info['audio']['streams'])) {
[491] Fix | Delete
$info['audio'] = self::getDefaultStreamInfo($info['audio']['streams']);
[492] Fix | Delete
}
[493] Fix | Delete
}
[494] Fix | Delete
[495] Fix | Delete
// process attachments
[496] Fix | Delete
if (isset($info['matroska']['attachments']) && $this->getid3->option_save_attachments !== getID3::ATTACHMENTS_NONE) {
[497] Fix | Delete
foreach ($info['matroska']['attachments'] as $i => $entry) {
[498] Fix | Delete
if (strpos($entry['FileMimeType'], 'image/') === 0 && !empty($entry['FileData'])) {
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function