const char info_names[23][4]={ "IARL","IART","ICMS","ICMT","ICOP","ICRD","ICRP","IDIM","IDPI","IENG", "IGNR","IKEY","ILGT","IMED","INAM","IPLT","IPRD","ISBJ","ISFT","ISHP", "ISRC","ISRF","ITCH"}; const char *info_desc[23]={"Archival Location","Artist","Commissioned", "Comments","Copyright","Creation Date","Cropped","Dimensions","Dot Pre Inch", "Engineer","Genre","Keywords","Lightness","Medium","Name","Plette Setting", "Product","Subject","Software","Sharpness","Source","Source Form","Technician"}; #define FLAG_NUMBER 6 const struct { int signature; char *define; char *description; } flag_info[FLAG_NUMBER]={ { 0x00000010, "AVIF_HASINDEX","Indicates the AVI file has an index."}, { 0x00000020,"AVIF_MUSTUSEINDEX","Indicates that application should use the index, rather than the physical ordering of the chunks in the file, to determine the order of presentation of the data. For example, this flag could be used to create a list of frames for editing."}, { 0x00000100,"AVIF_ISINTERLEAVED","Indicates the AVI file is interleaved."}, { 0x00000800,"AVIF_TRUSTCKTYPE", "Use CKType to find key frames?"}, { 0x00010000,"AVIF_WASCAPTUREFILE","Indicates the AVI file is a specially allocated file used for capturing real-time video. Applications should warn the user before writing over a file with this flag set because the user probably defragmented this file."}, { 0x00020000,"AVIF_COPYRIGHTED","Indicates the AVI file contains copyrighted data and software. When this flag is used, software should not permit the data to be duplicated."} }; #define PREDEFINED_NUMBER 11 const char error_parsing_string[]="*** error reading and parsing file %s, error #%d.\n"; char *predefined[PREDEFINED_NUMBER][3]={ {"list","^J: ^s ^xx^y/&vb^E ^dkHz/&ab ^l\n",""}, {"short","%`^Q%` ^xx^y, ^l @o $]@b - $]\n",""}, {"far","^n (^s) Non-AVI data (wasted): &W%%, &w b\n\n\ ***********************\n\ * resolution: %xx%y * video: %z (%v/%V), &vb/&b\n\ * fps: %f * audio: %P ^.5D Hz %c, &ab\n\ * length: %l *\n\ *********************** streams: %t\n\ \n\ Description:\n\ @a#: $\n]@b#: $\n]@c#: $\n]@d#: $\n]@e#: $\n]@f#: $\n]@g#: $\n]@h#: $\n]@i#: $\n]@j#: $\n]@k#: $\n]@l#: $\n]@m#: $\n]@n#: $\n]@o#: $\n]@p#: $\n]@r#: $\n]@s#: $\n]@t#: $\n]@u#: $\n]@v#: $\n]@w#: $\n]\ \nVideo codec information:\n\ Signature: %v (%V)\n\ Name: %z\n\ Download URL: %u\n\ Author: %Z, Site: %U\n\ Comment: %p\n\n\ Audio codec information:\n\ Signatire: %w\t\tName: %P\n\ AVInfo 0.7.4 \n",""}, {"struct-report","Struct report\n\n\ Filename: ^n\n\ Size: ^S (^s)\n\ Usefull size: &ts b, wasted space (JUNKs, index, etc): &w (&W%%)\n\n\ Description (if list-type INFO avalible):\n\n\ @a#(*): $\\]@b#(*): $\\]@c#(*): $\\]@d#(*): $\\]@e#(*): $\\]@f#(*): $\\]@g#(*): $\\]@h#(*): $\\]@i#(*): $\\]@j#(*): $\\]@k#(*): $\\]@l#(*): $\\]@m#(*): $\\]@n#(*): $\\]@o#(*): $\\]@p#(*): $\\]@r#(*): $\\]@s#(*): $\\]@t#(*): $]@u#(*): $]@v#(*): $]@w#(*): $]\n\ Video:\n\ bits-per-pixel: &b\n\ bitrate: &vb\n\ keyframes: &Vn\n\ codec information:\n\ Signature: %v (%V)\n\ Name: %z \n\ url: %u\n\ Author: %Z\n\ url: %U\n\ Comment: %p\n\ \n\n\ Audio: \n\ bitrate: &ab\n\ codec information:\n\ mmreg.h: #define %W %w\n\ Name: %P\n\n\n\ ***********\n\ *AVI header*\n\ ***********\n\ *\n\ *struct{\n\ * \tDWORD dwMicroSecPerFrame = ^F; // FPS = ^f \n\ * \tDWORD dwMaxBytesPerSec = ^M;\n\ * \tDWORD dwReserved1 = ^R;\n\ * \tDWORD dwFlags = ( ^g ) ^G;\n\ * \tDWORD dwTotalFrames = ^T; //movie length = ^l \n\ * \tDWORD dwInitialFrames = ^I;\n\ * \tDWORD dwStreams = ^t;\n\ * \tDWORD dwSuggestedBufferSize = ^b;\n\ * \tDWORD dwWidth = ^x;\n\ * \tDWORD dwHeight = ^y;\n\ * \tDWORD dwScale = ^r;\n\ * \tDWORD dwRate = ^a;\n\ * \tDWORD dwStart = ^A;\n\ * \tDWORD dwLength = ^N;\n\ *} MainAVIHeader;\n\ *\n\ *\n\ \n\ Stream data (repeat ^t time(s) - for each stream)\n", "\ *****************\n\ *Stream ##$n ($f)*\n\ *****************\n\ *frames: &n\t\tkeyframes: &N\n\ *bitrate: &b\tk/f bitrate: &B\n\ *max frame size: &M\t\tk/f max size: &K\n\ *min frame size: &m\t\tk/f mix size: &k\n\ *stream size: &s\tk/f size: &S\n\ *\n\ *Stream header: (strh list-type)\n\ *struct{\n\ *\tFOURCC fccType = $f;\n\ *\tFOURCC fccHandler = $h;\t// Video codec\n\ *\tDWORD dwFlags = $F;\n\ *\tDWORD dwReserved1 = $R;\n\ *\tDWORD dwInitialFrames = $i;\n\ *\tDWORD dwScale = $c;\n\ *\tDWORD dwRate = $r;\n\ *\tDWORD dwStart = $s;\n\ *\tDWORD dwLength = $l;\n\ *\tDWORD dwSuggestedBufferSize = $b;\n\ *\tDWORD dwQuality = $q;\n\ *\tDWORD dwSampleSize = $S;\n\ *} AVIStreamHeader;\n\ *\n\ *Stream format (strf list-type)\n\ *\n\ *union{\n\ *\tstruct{\t\t// video , empty if audio stream\n\ *\t*\tDWORD biSize = #s;\n\ *\t*\tLONG biWidth = #w;\n\ *\t*\tLONG biHeight = #h;\n\ *\t*\tWORD biPlanes = #p;\n\ *\t*\tWORD biBitCount = #c;\n\ *\t*\tDWORD biCompression = #C;\n\ *\t*\tDWORD biSizeImage = #S;\n\ *\t*\tLONG biXPelsPerMeter = #X\n\ *\t*\tLONG biYPelsPerMeter = #Y;\n\ *\t*\tDWORD biClrUsed = #u;\n\ *\t*\tDWORD biClrImportant = #i;\n\ *\t} BITMAPINFOHEADER;\n\ *\n\ *\tstruct{\t\t// audio, empty if video stream\n\ *\t*\tWORD wFormatTag = #f;\t//audio codec\n\ *\t*\tWORD nChannels = #H;\n\ *\t*\tDWORD nSamplesPerSec = #p;\n\ *\t*\tDWORD nAvgBytesPerSec = #a;\n\ *\t*\tWORD nBlockAlign = #b;\n\ *\t*\tWORD wBitsPerSample = #B;\n\ *\t*\tWORD cbSize = #z;\n\ *\t} WAVEFORMATEX;\n\ *};\n\ (end. Generated by AVInfo 0.7.4)\n\ \n"}, {"description","%`^Q^` ^xx^y/^v &vb/&b ^.5DHz/&ab^!",""}, {"html","^Q ^s ^xx^y/^v &vb/&b ^.5DHz/&ab^!",""}, {"html-css","^Q ^s, ^xx^y/^v &vb/&b^.5DHz/&ab^!",""}, {"html-b","^Q ^s, ^xx^y/^v &vb/&b ^.5DHz/&ab^!",""}, {"ogg","^J: ^s ^x x ^y, ^v, ^ffps^!", ""}, {"ogg-html","^Q^s, ^xx^y, ^v, ^f fps^!", ""}, {"far-40", "\n AVInfo 0.7.4 \n\n\ resolution:\t%xx%y\n\ fps:\t\t%f\n\ length:\t\t%l\n\ streams:\t\t%t\n\n\ video: %v/&vb/&b\n\ codec: %z\n\ audio: ^.5D Hz %Cch, &ab\n\ codec: %P\n\n\ filname: %n\n\ filesize: %s\ \n\n\ @a #: $\n]@b #: $\n]@c #: $\n]@d #: $\n]@e #: $\n]@f #: $\n]@g #: $\n]@h #: $\n]@i #: $\n]@j #: $\n]@k #: $\n]@l #: $\n]@m #: $\n]@n #: $\n]@o #: $\n]@p #: $\n]@r #: $\n]@s #: $\n]@t #: $\n]@u #: $\n]@v #: $\n]@w #: $\n]\ \n\ ",""}, }; const char help_message[] = "AVInfo v 0.7.4\n\ Usage: avinfo [params] file.avi [\"template1\"][\"template2\"]\n\ (c) George Shuklin, 2003. Home page: http://shounen.ru/soft/avinfo/\n\ AVInfo is a utility for displaying AVI header information. It returns the\n\ length of a clip, FPS, resolution, codec, sound parametrs, and the number\n\ and type of streams, including detailed information for each.\n\ \n\ Sample of usage:\n\ \"just output\": avinfo movie.avi\n\ \"FAR output\": edit:< avinfo movie.avi --far \n\ \t\t (FAR - File Archive Manager by E. Roshal - 4 win only)\n\ \n\ Usage:\n\ \n\ avinfo [-params] file.avi [--mode] [template1] [template2] \n\ \n\ avaible params:\n\ \n\ \n-f[ixs8]\n\ i - turn off info reading (LIST-INFO)\n\ I - turn on info reading\n\ s - turn off streams reading (and displaying second template)\n\ S - turn on stream reading\n\ x - turn off index data (bitrate, waste space, etc)\n\ X - turn on index data\n\ 7 - 7-bits output\n\ 8 - full, 8-bits output\n\ a - m.... to heavy to explain. (see sources)\n\ Roughly speaking, \"crop\" garbage from output, (instead ~134Mb - 123Mb,\n\ 00:34:33 - 34m, etc).\n\ Especially affected to the --description.\n\ \n\ -e[imse]\n\ m - turn on error messages\n\ s - turn off error messages (silence mode)\n\ i - ignore errors, try to dispay information anywere. \n\ (may be usefull, but dangerous - program may crash)\n\ e - exit @ error.\n\ \n\ Predefined templates:\n\ \n\ --description line for descript.ion\n\ --short short line for descript.ion\n\ --far output for FAR manager (use edit:< avinfo \"!.!\" --far)\n\ --far-40 output for FAR (for quick view panel)\n\ --list for list generating (see samples/filelist.bat)\n\ --struct-report programmers output (all data)\n\ --html, --html-css, --html-b - for HTML report\n\ "; char *default_template[2] ={ "\ ^s, ^l\n\ video: ^xx^y, ^f fps, ^v (^V), &vb\n\ audio: ^D, ^c, %P, &ab\n\ @a#: $\\]@b#: $\\]@c#: $\\]@d#: $\\]@e#: $\\]@f#: $\\]@g#: $\\]@h#: $\\]@i#: $\\]@j#: $\\]@k#: $\\]@l#: $\\]@m#: $\\]@n#: $\\]@o#: $\\]@p#: $\\]@r#: $\\]@s#: $]@t#: $]@u#: $]@v#: $]@w#: $]\n\ Codec information:\n\ Signature: %v (%V)\n\ Name: %z\n\ Download URL: %u\n\ Author: %Z\n\ Site: %U\n\ Comment: %p\n", ""};