home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / gfx / misc / mpeg_stat_2_2a.lha / mpeg_stat / src / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-21  |  16.7 KB  |  585 lines

  1. /* MPEGSTAT - analyzing tool for MPEG-I video streams
  2.  * Most recently by Steve Smoot (see man page for history)
  3.  *
  4.  *  Copyright (c) 1995 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * Tcl interface by Keving Gong
  8.  *
  9.  * Copyright (c) 1995 The Regents of the University of California.
  10.  * 
  11.  * Technical University of Berlin, Germany, Dept. of Computer Science
  12.  * Tom Pfeifer - Multimedia systems project - pfeifer@fokus.gmd.de
  13.  *
  14.  * Jens Brettin, Harald Masche, Alexander Schulze, Dirk Schubert
  15.  *
  16.  * This program uses parts of the source code of the Berkeley MPEG player
  17.  *
  18.  * ---------------------------
  19.  *
  20.  * Copyright (c) 1993 Technical University of Berlin, Germany
  21.  *
  22.  * for the parts of the Berkeley player used:
  23.  *
  24.  * Copyright (c) 1992 The Regents of the University of California.
  25.  * All rights reserved.
  26.  *
  27.  * ---------------------------
  28.  *
  29.  * Permission to use, copy, modify, and distribute this software and its
  30.  * documentation for any purpose, without fee, and without written agreement is
  31.  * hereby granted, provided that the above copyright notices and the following
  32.  * two paragraphs appear in all copies of this software.
  33.  * 
  34.  * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA 
  35.  * or the Technical University of Berlin BE LIABLE TO ANY PARTY FOR
  36.  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
  37.  * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  38.  * CALIFORNIA or the Technical University of Berlin HAS BEEN ADVISED OF THE 
  39.  * POSSIBILITY OF SUCH DAMAGE.
  40.  * 
  41.  * THE UNIVERSITY OF CALIFORNIA and the Technical University of Berlin 
  42.  * SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
  43.  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  44.  * PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE 
  45.  * UNIVERSITY OF CALIFORNIA and the Technical University of Berlin HAVE NO 
  46.  * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, 
  47.  * OR MODIFICATIONS.
  48.  */
  49.  
  50. /* MAIN.C CHANGED FOR MPEG ANALYZER, 1993 */
  51.  
  52. #include "video.h"
  53. #include "proto.h"
  54. #include <sys/types.h>
  55. #include <signal.h>
  56. #include <string.h>
  57. #include <stdlib.h>
  58. #include <netinet/in.h>
  59.  
  60. #include "util.h"
  61. #include "opts.h"
  62.  
  63. /* VERSION */
  64. #define VERSION "2.2b"
  65.  
  66. /* Define buffer length. */
  67.  
  68. #define BUF_LENGTH 80000
  69.  
  70. /* External declaration of main decoding call. */
  71.  
  72. extern VidStream *mpegVidRsrc();
  73. extern VidStream *NewVidStream();
  74.  
  75. /* Declaration of global variable to hold dither info. */
  76.  
  77. int ditherType;
  78.  
  79. /* Global file pointer to incoming data. */
  80. FILE *input;
  81.  
  82. /* global options state */
  83. int opts = LOUD;
  84. int start_opt = -1;
  85. int end_opt = -1;
  86. int rate_frames = 0;
  87. int COLLECTING;
  88. FILE *block_fp;
  89. FILE *qscale_fp;
  90. FILE *size_fp;
  91. FILE *offs_fp;
  92. FILE *rate_fp;
  93. FILE *syslogOutput;
  94. FILE *hist_fp;
  95. FILE *userdat_fp;
  96.  
  97. /* End of File flag. */
  98. int EOF_flag = 0;
  99.  
  100. /* The video stream */
  101. static VidStream *theStream;
  102.  
  103. /* Error returning */
  104.  
  105. int buggy = 0;
  106.  
  107. /* Amiga binary version ID */
  108.  
  109. static char version[]="$VER: mpeg_stat v2.2a Amiga rev I\n";
  110.  
  111. /*
  112.  *--------------------------------------------------------------
  113.  *
  114.  * int_handler --
  115.  *
  116.  *    Handles Cntl-C interupts..
  117.  *      (Two copies, to handle different signal types)
  118.  *
  119.  * Results:
  120.  *    None.
  121.  *
  122.  * Side effects:
  123.  *    None.
  124.  *
  125.  *--------------------------------------------------------------
  126.  */
  127. #ifndef SIG_ONE_PARAM
  128. void int_quit(){exit(1);}
  129. void
  130. int_handler()
  131. {
  132.   fprintf(stderr,"\nBreak!\n");
  133.   signal(SIGINT, int_quit);
  134.   /* If we havent done much, just exit */
  135.   if ((theStream==NULL) || (theStream->past == NULL)) exit(1);
  136.   fprintf(stderr,"Warning, some stats may not make sense with incomplete data!\n");
  137.   PrintAllStats();
  138.   if (curVidStream != NULL)
  139.     DestroyVidStream(curVidStream);
  140.   exit(1);
  141. }
  142. #else
  143. void int_quit(signum)int signum;{exit(1);}
  144. void int_handler(signum)
  145. int signum;
  146. {
  147.   fprintf(stderr,"\nBreak!\n");
  148.   signal(SIGINT, int_quit);
  149.   /* If we havent done much, just exit */
  150.   if ((theStream==NULL) || (theStream->past == NULL)) exit(1);
  151.   fprintf(stderr,"Warning, some stats may not make sense with incomplete data!\n");
  152.   PrintAllStats();
  153.   if (curVidStream != NULL)
  154.     DestroyVidStream(curVidStream);
  155.   exit(1);
  156. }
  157. #endif
  158.  
  159. /*
  160.  *--------------------------------------------------------------
  161.  *
  162.  * main --
  163.  *
  164.  *    Parses command line, starts decoding and displaying.
  165.  *
  166.  * Results:
  167.  *    None.
  168.  *
  169.  * Side effects:
  170.  *    None.
  171.  *
  172.  *--------------------------------------------------------------
  173.  */
  174.  
  175. int
  176. main(int argc, char **argv)
  177. {
  178.  
  179.   char *name;
  180.   char tmpstr[256];
  181.   int mark=1;
  182.   int i,index;
  183.  
  184.   input = stdin;
  185.   name = "<stdin>";
  186.   ditherType = ORDERED2_DITHER;
  187.  
  188.   printf("\n%s -- MPEG Analyzer for MPEG I video streams (version %s)\n\n", 
  189.      argv[0],VERSION);
  190.   if (argc == 1) {
  191.     name = "<stdin>";
  192.     input = stdin;
  193.       }
  194.   else if (argc==2) {
  195.     if (strcmp(argv[1],"-") == 0) {
  196.       input = stdin;
  197.       name = "<stdin>";
  198.     } else {
  199.       input = fopen(argv[1], "r");
  200.       if (input == NULL) {
  201.     if (strcmp(argv[1],"-?") == 0 ||  strcmp(argv[1],"-help") == 0) {
  202.         Usage();
  203.       } else {
  204.         fprintf(stderr, "Could not open MPEG file %s\n", argv[1]);
  205.         Usage();
  206.       }
  207.       }
  208.       name = argv[1];
  209.     }
  210.   } else {
  211.     index = 1;
  212.     while (index<argc) {
  213.       BOOLEAN match;
  214.  
  215.       match=FALSE;
  216.  
  217.       if ( strncmp(argv[index], "-block_info",6) == 0 ) {
  218.     match = TRUE;
  219.     if (strcmp(argv[index+1],"-") == 0) {
  220.       printf("Writing block information to <stdout>\n");
  221.       block_fp=stdout;
  222.     } else if ((block_fp=fopen(argv[index+1],"w"))==NULL) {
  223.       fprintf(stderr,"Could not open block info file:  %s\n",argv[index+1]);
  224.       Usage();
  225.     } else {      
  226.       printf("Writing block information to %s\n",argv[index+1]);
  227.     }
  228.     opts ^= BLOCK_INFO;
  229.     index+=2; continue;
  230.       }
  231.       if ( strncmp(argv[index], "-qscale",5) == 0 ) {
  232.     match = TRUE;
  233.     if (strcmp(argv[index+1],"-") == 0) {
  234.     qscale_fp=stdout;
  235.     printf("Writing qscale information to <stdout>\n");
  236.     } else if ((qscale_fp=fopen(argv[index+1],"w"))==NULL) {
  237.       fprintf(stderr,"Could not open qscale output file:  %s\n",argv[index+1]);
  238.       Usage();
  239.     }  else {      
  240.       printf("Writing qscale information to %s\n",argv[index+1]);
  241.     }
  242.     opts ^= QSCALE_INFO;
  243.     index+=2; continue;
  244.       }
  245.       if ( strncmp(argv[index], "-userdat", 8) == 0 ) {
  246.     match = TRUE;
  247.     if (strcmp(argv[index+1],"-") == 0) {
  248.     userdat_fp = stdout;
  249.     printf("Writing user data information to <stdout>\n");
  250.     } else if ((userdat_fp = fopen(argv[index+1],"w"))==NULL) {
  251.       fprintf(stderr,"Could not open user data output file:  %s\n",argv[index+1]);
  252.       Usage();
  253.     }  else {      
  254.       printf("Writing user data information to %s\n",argv[index+1]);
  255.     }
  256.     opts ^= USERDAT_INFO;
  257.     index+=2; continue;
  258.       }
  259.       if ( strncmp(argv[index], "-offsets",7) == 0 ) {
  260.     match = TRUE;
  261.     if (strcmp(argv[index+1],"-") == 0) {
  262.     offs_fp=stdout;
  263.     printf("Writing offset information to <stdout>\n");
  264.     } else if ((offs_fp=fopen(argv[index+1],"w"))==NULL) {
  265.       fprintf(stderr,"Could not open offset output file:  %s\n",argv[index+1]);
  266.       Usage();
  267.     }  else {      
  268.       printf("Writing offset information to %s\n",argv[index+1]);
  269.     }
  270.     opts ^= OFFS_INFO;
  271.     index+=2; continue;
  272.       }
  273.       if ( strncmp(argv[index], "-size",5) == 0 ) {
  274.     match = TRUE;
  275.     if (strcmp(argv[index+1],"-") == 0) {
  276.       size_fp=stdout;
  277.       printf("Writing size information to <stdout>\n");
  278.     } else if ((size_fp=fopen(argv[index+1],"w"))==NULL) {
  279.       fprintf(stderr,"Could not open size output file:  %s\n",argv[index+1]);
  280.       Usage();
  281.     }  else {      
  282.       printf("Writing size information to %s\n",argv[index+1]);
  283.     }
  284.     opts ^= SIZE_INFO;
  285.     index+=2; continue;
  286.       }
  287.       if (strncmp(argv[index],"-ratelength",6) == 0) {
  288.     match = TRUE;
  289.     opts^=RATE_LENGTH_SET; 
  290.     rate_frames = atoi(argv[index+1]);
  291.     if (rate_frames == 0) Usage();
  292.     index+=2; continue;
  293.       }
  294.       if ( strncmp(argv[index], "-rate",5) == 0 ) {
  295.     match = TRUE;
  296.     if (strcmp(argv[index+1],"-") == 0) {
  297.       rate_fp=stdout;
  298.       printf("Writing rate information to <stdout>\n");
  299.     } else if ((rate_fp=fopen(argv[index+1],"w"))==NULL) {
  300.       fprintf(stderr,"Could not open rate output file:  %s\n",argv[index+1]);
  301.       Usage();
  302.     }  else {      
  303.       printf("Writing rate information to %s\n",argv[index+1]);
  304.     }
  305.     opts ^= RATE_INFO;
  306.     index+=2; continue;
  307.       }
  308.       if ( strncmp(argv[index], "-hist",5) == 0 ) {
  309.     match = TRUE;
  310.     if (strcmp(argv[index+1],"-") == 0) {
  311.       hist_fp=stdout;
  312.       printf("Writing histogram information to <stdout>\n");
  313.     } else if ((hist_fp=fopen(argv[index+1],"w"))==NULL) {
  314.       fprintf(stderr,"Could not open histogram output file:  %s\n",argv[index+1]);
  315.       Usage();
  316.     }  else {      
  317.       printf("Writing histogram information to %s\n",argv[index+1]);
  318.     }
  319.     opts ^= HIST_INFO;
  320.     index+=2; continue;
  321.       }
  322.       if ( strncmp(argv[index], "-syslog",7) == 0 ) {
  323.     match = TRUE;
  324.     if (strcmp(argv[index+1],"-") == 0) {
  325.       syslogOutput=stdout;
  326.       printf("Writing system layer information to <stdout>\n");
  327.     } else if ((syslogOutput=fopen(argv[index+1],"w"))==NULL) {
  328.       fprintf(stderr,"Could not open system layer output file:  %s\n",argv[index+1]);
  329.       Usage();
  330.     }  else {      
  331.       printf("Writing system layer information to %s\n",argv[index+1]);
  332.     }
  333.     opts ^= SYSLAYER_LOG;
  334.     index+=2; continue;
  335.       }
  336.       if ( strcmp(argv[index], "-all") == 0 ) {
  337.     match = TRUE;
  338.     if (strcmp(argv[index+1],"-") == 0) {
  339.       printf("Writing all information to <stdout>\n");
  340.       printf("Writing qscale information to <stdout>\n");
  341.       printf("Writing offset information to <stdout>\n");
  342.       printf("Writing size information to <stdout>\n");
  343.       printf("Writing rate information to <stdout>\n");
  344.       printf("Writing histogram information to <stdout>\n");
  345.       printf("Writing user data information to <stdout>\n");
  346.       offs_fp = stdout;
  347.       size_fp = stdout;
  348.       block_fp = stdout;
  349.       qscale_fp = stdout;
  350.       rate_fp = stdout;
  351.       hist_fp = stdout;
  352.       userdat_fp = stdout;
  353.       index++;
  354.     } else {
  355.       index++;
  356.       sprintf(tmpstr,"%s.blk",argv[index]);
  357.       if ((block_fp=fopen(tmpstr,"w")) == NULL) {
  358.         fprintf(stderr,"Could not open block info file:  %s\n",tmpstr);
  359.         Usage();
  360.       } else {      
  361.         printf("Writing block information to %s\n",tmpstr);
  362.       }
  363.       sprintf(tmpstr,"%s.qs",argv[index]);
  364.       if ((qscale_fp=fopen(tmpstr,"w")) == NULL) {
  365.         fprintf(stderr,"Could not open qscale output file:  %s\n",tmpstr);
  366.         Usage();
  367.       }  else {      
  368.         printf("Writing qscale information to %s\n",tmpstr);
  369.       }
  370.       sprintf(tmpstr,"%s.off",argv[index]);
  371.       if ((offs_fp=fopen(tmpstr,"w"))==NULL) {
  372.         fprintf(stderr,"Could not open offset output file:  %s\n",tmpstr);
  373.         Usage();
  374.       }  else {      
  375.         printf("Writing offset information to %s\n",tmpstr);
  376.       }
  377.       sprintf(tmpstr,"%s.sz",argv[index]);
  378.       if ((size_fp=fopen(tmpstr,"w"))==NULL) {
  379.         fprintf(stderr,"Could not open size output file:  %s\n",tmpstr);
  380.         Usage();
  381.       }  else {      
  382.         printf("Writing size information to %s\n",tmpstr);
  383.       }
  384.       sprintf(tmpstr,"%s.hist",argv[index]);
  385.       if ((hist_fp=fopen(tmpstr,"w"))==NULL) {
  386.         fprintf(stderr,"Could not open histogram output file:  %s\n",tmpstr);
  387.         Usage();
  388.       }  else {      
  389.         printf("Writing histogram information to %s\n",tmpstr);
  390.       }
  391.       sprintf(tmpstr,"%s.ud",argv[index]);
  392.       if ((userdat_fp=fopen(tmpstr,"w"))==NULL) {
  393.         fprintf(stderr,"Could not open user data output file:  %s\n",tmpstr);
  394.         Usage();
  395.       }  else {      
  396.         printf("Writing user data information to %s\n",tmpstr);
  397.       }
  398.       sprintf(tmpstr,"%s.rt",argv[index]);
  399.       if ((rate_fp=fopen(tmpstr,"w"))==NULL) {
  400.         fprintf(stderr,"Could not open rate output file:  %s\n",tmpstr);
  401.         Usage();
  402.       }  else {      
  403.         printf("Writing rate information to %s\n",tmpstr);
  404.       }
  405.     }
  406.     index++;
  407.     opts ^= SIZE_INFO;
  408.     opts ^= QSCALE_INFO;
  409.     opts ^= BLOCK_INFO;
  410.     opts ^= OFFS_INFO;
  411.     opts ^= RATE_INFO;
  412.     opts ^= HIST_INFO;
  413.     opts ^= USERDAT_INFO;
  414.     continue;
  415.       }
  416.       
  417.       if (strcmp(argv[index],"-quiet") == 0) {
  418.     match = TRUE;
  419.     opts ^= LOUD;
  420.     index++; continue;
  421.       }
  422.       if (strcmp(argv[index],"-dct") == 0) {
  423.     match = TRUE;
  424.     opts ^= DCT_INFO;
  425.     index++; continue;
  426.       }
  427.       if (strcmp(argv[index],"-aswan") == 0) {
  428.     /* Dont ask */
  429.     match = TRUE;
  430.     opts ^= BITS_INFO;
  431.     index++; continue;
  432.       }
  433.       if (strncmp(argv[index],"-verif",6) == 0) {
  434.     match = TRUE;
  435.     opts ^= VERIFY;
  436.     index++; continue;
  437.       }
  438.       if (strcmp(argv[index],"-time") == 0) {
  439.     match = TRUE;
  440.     opts ^= TIME_MEASURE;
  441.     index++; continue;
  442.       }
  443.       if (strcmp(argv[index],"-start") == 0) {
  444.     match = TRUE;
  445.     opts^=START_F; 
  446.     start_opt = atoi(argv[index+1]);
  447.     if (start_opt == 0) Usage();
  448.     index+=2; continue;
  449.       }
  450.       if (strcmp(argv[index],"-end") == 0) {
  451.     match = TRUE;
  452.     opts ^= END_F; 
  453.     end_opt = atoi(argv[index+1]);
  454.     if (end_opt == 0) Usage();
  455.     index+=2; continue;
  456.       }
  457.       if (index == argc-1) {
  458.     match = TRUE;
  459.     if (strcmp(argv[index],"-") == 0) {
  460.       input = stdin;
  461.       name = "<stdin>";
  462.       index++;
  463.     } else {
  464.       input = fopen(argv[index], "r");
  465.       name = argv[index];
  466.       if (input == NULL) {
  467.         fprintf(stderr, "Could not open MPEG file:  %s\n", argv[index]);
  468.         Usage();
  469.       }
  470.       index++;
  471.     }} else {
  472.       input = stdin;
  473.       name = "<stdin>";
  474.     }
  475.       if (!match) {
  476.     fprintf(stderr,"Invalid argument %s\n",argv[index]);
  477.     Usage();
  478.       }
  479.     }}
  480.  
  481.   /* Check options for sanity */
  482.   if ((opts&END_F) && (end_opt<start_opt)) Usage();
  483.   if (start_opt<=1) COLLECTING=COLLECT_ON;
  484.   else COLLECTING=COLLECT_OFF;
  485.  
  486.   if ((RATE_LENGTH_SET&opts) && !(opts&RATE_INFO)){
  487.     fprintf(stderr,"You set ratelength, but no rate file.\n");
  488.     fprintf(stderr,"Tossing rate information, hope thats ok.\n");
  489.     opts^=RATE_INFO;
  490.     rate_fp=fopen("/dev/null","w");
  491.   }
  492.  
  493.   if ((opts&DCT_INFO) & !(opts&BLOCK_INFO)) {
  494.     fprintf(stderr, "DCT information is collected into Block file\n");
  495.     fprintf(stderr, "So -dct requires -block_info file (or -all file)\n");
  496.     exit(1);
  497.   }
  498.  
  499.   /* Ok, done parsing, lets go! */
  500.   
  501.   printf("Reading %s\n\n", name);
  502.  
  503.   if ((opts&START_F) || (opts&END_F)) {
  504.     sprintf(tmpstr,"output from %s (%d to ",
  505.         name,(start_opt>0)?start_opt:1);
  506.     if (end_opt>0) {sprintf(tmpstr,"%s%d) */\n",strdup(tmpstr),end_opt);}
  507.     else sprintf(tmpstr,"%send */\n",tmpstr);
  508.   } else {sprintf(tmpstr,"output from %s */\n",name);}
  509.  
  510.   if (opts&SIZE_INFO)   fprintf(size_fp,"/* Size file %s",tmpstr);
  511.   if (opts&QSCALE_INFO) fprintf(qscale_fp,"/* Qscale file %s",tmpstr);
  512.   if (opts&BLOCK_INFO)  fprintf(block_fp,"/* Block file %s",tmpstr);
  513.   if (opts&OFFS_INFO)   fprintf(offs_fp,"/* Offset file %s",tmpstr);
  514.   if (opts&USERDAT_INFO) fprintf(userdat_fp,"/* User data file %s",tmpstr);
  515.   if (opts&RATE_INFO)   fprintf(rate_fp,"/* Rate file %s",tmpstr); /*HI*/
  516.     
  517.   if ((opts&START_F) || (opts&END_F)) {
  518.     printf("Collecting statistics from frame %d to ",(start_opt>0)?start_opt:1);
  519.     if (end_opt>0) {printf("%d.\n",end_opt);} else {printf("end.\n");}
  520.   }
  521.   
  522.   if (opts&SIZE_INFO) fprintf(size_fp,"Num\tType\tSize\n");
  523.  
  524.   signal(SIGINT, int_handler);
  525.  
  526.   init_tables();
  527.   
  528.   EOF_flag = 0;
  529.   curBits = 0;
  530.   bitOffset = 0;
  531.   bufLength = 0;
  532.   bitBuffer = NULL;
  533.   totNumFrames = 0;
  534.  
  535.   theStream = NewVidStream(BUF_LENGTH);
  536.   if (theStream==NULL) {
  537.     fprintf(stderr,"Could not create Video Stream Object!\n");
  538.     exit(1);
  539.   }
  540.  
  541.   realTimeStart = ReadSysClock();
  542.   mpegVidRsrc(0, theStream);
  543. }
  544.  
  545.  
  546. /*
  547.  *--------------------------------------------------------------
  548.  *
  549.  * Usage --
  550.  *
  551.  *    Gives message describing options
  552.  *
  553.  * Results:
  554.  *    None.
  555.  *
  556.  * Side effects:
  557.  *    None.
  558.  *
  559.  *--------------------------------------------------------------
  560.  */
  561. void
  562. Usage()
  563. {
  564.     fprintf(stderr, "\nUsage:  mpeg_stat [options] [mpeg_file]\n");
  565.     fprintf(stderr, "Options:\n");
  566.     fprintf(stderr, "  -quiet: \t\t Turn off output of frame types/matricies as encountered\n");
  567.     fprintf(stderr, "  -verify: \t\t Do more work to help assure the validity of the stream\n\t\t\t (slows processing somewhat)\n");
  568.     fprintf(stderr, "  -start N: \t\t Begin collection at frame N (first frame is 1)\n");
  569.     fprintf(stderr, "  -end N: \t\t End collection at frame N (end >= start)\n");
  570.     fprintf(stderr, "  -histogram file:\t Put detailed histograms into file\n");
  571.     fprintf(stderr, "  -qscale file: \t Put qscale information into file\n");
  572.     fprintf(stderr, "  -size file: \t\t Write individual frame type and size into file\n");
  573.     fprintf(stderr, "  -offsets file: \t Write high level header offsets into file\n");
  574.     fprintf(stderr, "  -block_info file:\t Put macroblock usage into file\n");
  575.     fprintf(stderr, "  -dct \t\t\t Puts decoded DCT info into block file\n");
  576.     fprintf(stderr, "  -rate file: \t\t Put instantaneous rate information in file\n");
  577.     fprintf(stderr, "  -ratelength N: \t Measure bitrate per N frames, not one second's worth\n");
  578.     fprintf(stderr, "  -syslog file: \t Store parsing of systerm layer into file\n");
  579.     fprintf(stderr, "  -userdata file: \t Store user data information into file\n");
  580.     fprintf(stderr, "  -time: \t\t Measure time to decode frames\n");
  581.     fprintf(stderr, "  -all file: \t\t Put all information into files with basename file\n");
  582.     fprintf(stderr, "\nA single dash (-) may be used to denote standard in/out in place of a filename.\n");
  583.     exit(1);
  584. }
  585.