[xiph-cvs] cvs commit: vorbis-tools/ogginfo ogginfo.1 ogginfo.c

Stan Seibert volsung at xiph.org
Mon Jul 30 17:19:55 PDT 2001



volsung     01/07/30 17:19:55

  Modified:    ogginfo  ogginfo.1 ogginfo.c
  Log:
  Added patch from Hongli Lai <hongli at telekabel.nl> to display bitrate
  information.  Spruced up to print "none" if any of the attributes is not
  set.  Also modified man page to reflect changes and fix DOS-style
  newlines.

Revision  Changes    Path
1.3       +183 -175  vorbis-tools/ogginfo/ogginfo.1

Index: ogginfo.1
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogginfo/ogginfo.1,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ogginfo.1	2001/07/09 02:01:33	1.2
+++ ogginfo.1	2001/07/31 00:19:54	1.3
@@ -1,175 +1,183 @@
-.\" Process this file with
-.\" groff -man -Tascii ogginfo.1
-.\"
-.TH ogginfo 1 "July 8, 2001" "" "Vorbis Tools"
-
-.SH NAME
-ogginfo \- gives information about Ogg files.
-
-.SH SYNOPSIS
-.B ogginfo
-.I file1.ogg
-.B ...
-.I fileN.ogg
-
-.SH DESCRIPTION
-.B ogginfo
-reads one or more Ogg files and decodes the comments contained within, writing
-them to standard output, in a "attribute=value" format, one per line.
-The first attribute printed will always be the
-.B filename
-of the stream. 
-.B ogginfo
-cannot accept URLs. 
-.B ogginfo
-will also print the following file attributes:
-.RS
-.IP header_integrity
-"pass" if the header is intact, and "fail" if it is corrupted.
-.IP stream_integrity
-"pass" if the stream contains no bad packets or holes (not counting the last 
-packet), and "fail" otherwise.
-.IP file_truncated
-"true" if the last good packet in the stream is not marked as the last packet
-and "false" if the stream is complete.
-.IP length
-Length of of the file in seconds.
-.IP playtime
-Playing time in a humanly-readable MM:SS format.
-.RE
-
-.SH OPTIONS
-None.
-
-.SH EXAMPLES
-
-The
-.B ogginfo
-command line accepts as many filenames as your shell will allow.
-
-.PP
-Information about one file:
-.RS
-.B ogginfo track14.ogg
-.RE
-
-
-
-Will print:
-
-.RS
-.br
-.B
-filename=track14.ogg
-.br
-.B
-header_integrity=pass
-.br
-.B
-stream_integrity=pass
-.br
-.B
-file_truncated=false
-.br
-.B
-title=If I Had $1000000
-.br
-.B
-artist=Barenaked Ladies 
-.br
-.B
-album=Gordon
-.br
-.B
-tracknumber=14
-.br
-.B
-length=267.040000
-.br
-.B
-playtime=4:27
-.RE
-
-.PP
-Information on multiple files:
-.RS
-.B ogginfo track1.ogg track2.ogg
-.RE
-
-.PP
-Will print:
-
-.RS
-.br
-.B
-filename=track1.ogg
-.br
-.B
-header_integrity=pass
-.br
-.B
-stream_integrity=pass
-.br
-.B
-file_truncated=false
-.br
-.B
-title=The Vorbis Theme
-.br
-.B
-artist=Monty and The Wet Trouts
-.br
-.B
-album=Musical Penguins 3
-.br
-.B
-tracknumber=1
-.br
-.B
-length=67.38383
-.br
-.B
-playtime=1:07
-.br
-.B
-filename=track2.ogg
-.br
-.B
-header_integrity=pass
-.br
-.B
-stream_integrity=pass
-.br
-.B
-file_truncated=false
-.br
-.B
-title=Being for the Benefit of Mr. Fish
-.br
-.B
-artist=Monty and The Wet Trouts
-.br
-.B
-album=Musical Penguins 3
-.br
-.B
-tracknumber=2
-.br
-.B
-length=449.0000
-.br
-.B
-playtime=7:29
-.RE
-
-.SH BUGS
-
-.B ogginfo
-only checks the first bitstream in a file.
-
-.SH AUTHORS
-
-.br
-JAmes Atwill <ogg at linuxstuff.org>
-.br
-Stan Seibert <indigo at aztec.asu.edu>
+.\" Process this file with
+.\" groff -man -Tascii ogginfo.1
+.\"
+.TH ogginfo 1 "July 8, 2001" "" "Vorbis Tools"
+
+.SH NAME
+ogginfo \- gives information about Ogg files.
+
+.SH SYNOPSIS
+.B ogginfo
+.I file1.ogg
+.B ...
+.I fileN.ogg
+
+.SH DESCRIPTION
+.B ogginfo
+reads one or more Ogg files and decodes the comments contained within, writing
+them to standard output, in a "attribute=value" format, one per line.
+The first attribute printed will always be the
+.B filename
+of the stream. 
+.B ogginfo
+cannot accept URLs. 
+.B ogginfo
+will also print the following file attributes:
+.RS
+.IP header_integrity
+"pass" if the header is intact, and "fail" if it is corrupted.
+.IP stream_integrity
+"pass" if the stream contains no bad packets or holes (not counting the last 
+packet), and "fail" otherwise.
+.IP file_truncated
+"true" if the last good packet in the stream is not marked as the last packet
+and "false" if the stream is complete.
+.IP bitrate_upper
+The upper bitrate limit of the file, or "none" if not set.
+.IP bitrate_nominal
+The "target" bitrate of the file, or "none" if not set.
+.IP bitrate_lower
+The lower bitrate limit of the file, or "none" if not set.
+.IP bitrate_average
+The average bitrate of the file.
+.IP length
+Length of of the file in seconds.
+.IP playtime
+Playing time in a humanly-readable MM:SS format.
+.RE
+
+.SH OPTIONS
+None.
+
+.SH EXAMPLES
+
+The
+.B ogginfo
+command line accepts as many filenames as your shell will allow.
+
+.PP
+Information about one file:
+.RS
+.B ogginfo track14.ogg
+.RE
+
+
+
+Will print:
+
+.RS
+.br
+.B
+filename=track14.ogg
+.br
+.B
+header_integrity=pass
+.br
+.B
+stream_integrity=pass
+.br
+.B
+file_truncated=false
+.br
+.B
+title=If I Had $1000000
+.br
+.B
+artist=Barenaked Ladies 
+.br
+.B
+album=Gordon
+.br
+.B
+tracknumber=14
+.br
+.B
+length=267.040000
+.br
+.B
+playtime=4:27
+.RE
+
+.PP
+Information on multiple files:
+.RS
+.B ogginfo track1.ogg track2.ogg
+.RE
+
+.PP
+Will print:
+
+.RS
+.br
+.B
+filename=track1.ogg
+.br
+.B
+header_integrity=pass
+.br
+.B
+stream_integrity=pass
+.br
+.B
+file_truncated=false
+.br
+.B
+title=The Vorbis Theme
+.br
+.B
+artist=Monty and The Wet Trouts
+.br
+.B
+album=Musical Penguins 3
+.br
+.B
+tracknumber=1
+.br
+.B
+length=67.38383
+.br
+.B
+playtime=1:07
+.br
+.B
+filename=track2.ogg
+.br
+.B
+header_integrity=pass
+.br
+.B
+stream_integrity=pass
+.br
+.B
+file_truncated=false
+.br
+.B
+title=Being for the Benefit of Mr. Fish
+.br
+.B
+artist=Monty and The Wet Trouts
+.br
+.B
+album=Musical Penguins 3
+.br
+.B
+tracknumber=2
+.br
+.B
+length=449.0000
+.br
+.B
+playtime=7:29
+.RE
+
+.SH BUGS
+
+.B ogginfo
+only checks the first bitstream in a file.
+
+.SH AUTHORS
+
+.br
+JAmes Atwill <ogg at linuxstuff.org>
+.br
+Stan Seibert <indigo at aztec.asu.edu>

1.5       +29 -0     vorbis-tools/ogginfo/ogginfo.c

Index: ogginfo.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis-tools/ogginfo/ogginfo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ogginfo.c	2001/07/12 02:27:36	1.4
+++ ogginfo.c	2001/07/31 00:19:54	1.5
@@ -48,6 +48,7 @@
   OggVorbis_File vf;
   int rc,i;
   vorbis_comment *vc;
+  vorbis_info *vi;
   double playtime;
   long playmin,playsec;
 
@@ -72,6 +73,34 @@
 
   for (i=0; i < vc->comments; i++) {
     printf("%s\n",vc->user_comments[i]);
+  }
+
+  vi = ov_info(&vf,-1);
+  if (vi)
+  {
+    printf("version=%d\n"
+           "channels=%d\n",
+           vi->version, vi->channels);
+    
+    printf("bitrate_upper=");
+    if (vi->bitrate_upper == -1) 
+      printf("none\n");
+    else 
+      printf("%d\n", vi->bitrate_upper);
+
+    printf("bitrate_nominal=");
+    if (vi->bitrate_nominal == -1) 
+      printf("none\n");
+    else 
+      printf("%d\n", vi->bitrate_nominal);
+
+    printf("bitrate_lower=");
+    if (vi->bitrate_lower == -1) 
+      printf("none\n");
+    else 
+      printf("%d\n", vi->bitrate_lower);
+
+    printf("bitrate_average=%ld\n", ov_bitrate(&vf,-1));
   }
 
   playtime = ov_time_total(&vf,-1);

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list