shithub: opus-tools

Download patch

ref: fa46e9c1c130623dd6a8703946e20b0521a0434e
parent: bc605841f7ca9d43a70f6baf60aa91ad44121f8b
author: Mark Harris <mark.hsj@gmail.com>
date: Wed Sep 30 21:58:42 EDT 2015

opusenc: Clean up help

Clearly indicate which options require a parameter and its usual
format.  Use imperative verb form consistently.  Minor rearrangement
to improve logical ordering.  Move diagnostic options to the end.
Move verbose --picture details to --help-picture so that basic usage
information has a chance of fitting on one screen.  Change use of
obsolete term "MIME type" to "media type".  Update man page to match.

--- a/man/opusenc.1
+++ b/man/opusenc.1
@@ -13,6 +13,8 @@
 ] [
 .B -V
 ] [
+.B --help-picture
+] [
 .B --quiet
 ] [
 .B --bitrate
@@ -40,32 +42,23 @@
 .B --max-delay
 .I ms
 ] [
-.B --serial
-.I serial number
+.B --title
+.I 'track title'
 ] [
-.B --save-range
-.I file
-] [
-.B --set-ctl-int
-.I ctl=value
-] [
-.B --comment
-.I tag=value
-] [
 .B --artist
 .I author
 ] [
-.B --title
-.I 'track title'
-] [
 .B --album
 .I 'album title'
 ] [
+.B --genre
+.I genre
+] [
 .B --date
 .I YYYY-MM-DD
 ] [
-.B --genre
-.I genre
+.B --comment
+.I tag=value
 ] [
 .B --picture
 .IB filename | specification
@@ -92,6 +85,15 @@
 .I flag
 ] [
 .B --ignorelength
+] [
+.B --serial
+.I serial number
+] [
+.B --save-range
+.I file
+] [
+.B --set-ctl-int
+.I ctl=value
 ]
 .I input.wav
 .I output.opus
@@ -98,9 +100,10 @@
 
 .SH DESCRIPTION
 .B opusenc
-reads audio data in either raw, Wave, or AIFF format and encodes it into an
+reads audio data in Wave, AIFF, FLAC, Ogg/FLAC,
+or raw PCM format and encodes it into an Ogg
 Opus stream. If the input file is "-" audio data is read from stdin.
-Likewise, if the output file is "-" opus data is written to stdout.
+Likewise, if the output file is "-" the Ogg Opus stream is written to stdout.
 
 Unless quieted
 .B opusenc
@@ -107,14 +110,19 @@
 displays fancy statistics about the encoding progress.
 
 .SH OPTIONS
+.SS "General options"
 .IP "-h, --help"
 Show command help
 .IP "-V, --version"
 Show the version number
+.IP "--help-picture"
+Show help on attaching album art
 .IP "--quiet"
-Quiet mode. No messages are displayed.
+Enable quiet mode. No messages are displayed.
+
+.SS "Encoding options"
 .IP "--bitrate N.nnn"
-Target bitrate in kbit/sec (6-256 per channel)
+Set target bitrate in kbit/sec (6-256 per channel)
 
 In VBR mode this specifies the average rate for a large and diverse
 collection of audio. In CVBR and Hard-CBR mode it specifies the specific
@@ -121,18 +129,15 @@
 output bitrate.
 
 Default for >=44.1kHz input is 64kbps per mono stream, 96kbps per coupled pair.
-
 .IP "--vbr"
 Use variable bitrate encoding (default)
-
 In VBR mode the bitrate may go up and down freely depending on the content
 to achieve more consistent quality.
-
 .IP "--cvbr"
 Use constrained variable bitrate encoding.
 
 Outputs to a specific bitrate. This mode is analogous to CBR in AAC/MP3
-encoders and managed mode in vorbis coders. This delivers less consistent
+encoders and managed mode in Vorbis coders. This delivers less consistent
 quality than VBR mode but consistent bitrate.
 .IP "--hard-cbr"
 Use hard constant bitrate encoding.
@@ -139,14 +144,14 @@
 
 With hard-cbr every frame will be exactly the same size, similar to how
 speech codecs work. This delivers lower overall quality but is useful
- where bitrate changes might leak data in encrypted channels or on
+where bitrate changes might leak data in encrypted channels or on
 synchronous transports.
 .IP "--comp N"
-Encoding computational complexity (0-10, default: 10). Zero gives the
+Set encoding computational complexity (0-10, default: 10). Zero gives the
 fastest encodes but lower quality, while 10 gives the highest quality
 but slower encoding.
 .IP "--framesize N"
-Maximum frame size in milliseconds (2.5, 5, 10, 20, 40, 60, default: 20)
+Set maximum frame size in milliseconds (2.5, 5, 10, 20, 40, 60, default: 20)
 .br
 Smaller framesizes achieve lower latency but less quality at a given
 bitrate.
@@ -154,49 +159,40 @@
 Sizes greater than 20ms are only interesting at fairly low
 bitrates.
 .IP "--expect-loss N"
-Percentage packet loss to expect (default: 0)
+Set expected packet loss in percent (default: 0)
 .IP "--downmix-mono"
 Downmix to mono
 .IP "--downmix-stereo"
 Downmix to stereo (if >2 channels input)
 .IP "--max-delay N"
-Maximum container delay in milliseconds (0-1000, default: 1000)
-.IP "--serial n"
-Forces the stream serial number to a specified value (instead of being random).
-This is used to make the encoder deterministic for testing and is not generally recommended.
-.IP "--save-range file"
-Saves check values for every frame to a file
-.IP "--set-ctl-int x=y"
-Pass the encoder control x with value y (advanced)
-Preface with s: to direct the ctl to multistream s
-.br
-This may be used multiple times
+Set maximum container delay in milliseconds (0-1000, default: 1000)
 
-.IP "--comment tag=value"
-Add an extra comment.  This may be used multiple times, and all
-instances will be added to each of the input files specified. The argument
-should be in the form "tag=value".
-See the vorbis-comment specification for well known tag names:
-http://www.xiph.org/vorbis/doc/v-comment.html
+.SS "Metadata options"
+.IP "--title title"
+Set the track title comment field to
+.I title
 .IP "--artist artist"
 Set the artist comment field to
 .I artist.
 This may be used multiple times to list contributing artists individually.
 Note that some playback software does not display multiple artists gracefully.
-.IP "--title title"
-Set the track title comment field to
-.I title
 .IP "--album album"
 Set the album or collection title field to
 .I album
 .IP "--date YYYY-MM-DD"
 Set the date comment field to
-.I YYYY-MM-DD
+.I YYYY-MM-DD.
+This may be shortened to YYYY-MM or YYYY.
 .IP "--genre genre"
 Set the genre comment field to
 .I genre.
 This option may be specified multiple times to tag a track with
 multiple overlapping genres.
+.IP "--comment tag=value"
+Add an extra comment.  This may be used multiple times.  The argument
+should be in the form "tag=value".
+See the vorbis-comment specification for well known tag names:
+http://www.xiph.org/vorbis/doc/v-comment.html
 .IP "--picture filename|specification"
 Attach album art for the track.
 
@@ -218,7 +214,7 @@
 
 The format of
 .I specification
-is [\fBtype\fR]|[\fBmime-type\fR]|[\fBdescription\fR]|[\fBwidth\fRx\fBheight\fRx\fBdepth\fR[/\fBcolors\fR]]|\fBfilename\fR
+is [\fBtype\fR]|[\fBmedia-type\fR]|[\fBdescription\fR]|[\fBwidth\fRx\fBheight\fRx\fBdepth\fR[/\fBcolors\fR]]|\fBfilename\fR
 
 .I type
 is an optional number describing the nature of the picture.
@@ -270,25 +266,26 @@
 More than one --picture option can be specified to attach multiple pictures.
 There may only be one picture each of type 1 and 2 in a file.
 
-.I mime-type
+.I media-type
 is optional. If left blank, it will be detected from the file. For
 best compatibility with players, use pictures with a
-.I mime-type
+.I media-type
 of image/jpeg or image/png. The
-.I mime-type
+.I media-type
 can also be "-->" to mean that
 .I filename
 is actually a URL to an image, though this use is discouraged.
 The file at the URL will not be fetched.
-The URL itself is stored in the comment field.
+The URL itself is stored in the metadata.
 
 .I description
 is optional. The default is an empty string.
 
 The next part specifies the resolution and color information. If the
-.I mime-type
-is image/jpeg, image/png, or image/gif, you can usually leave this empty and
-they can be detected from the file. Otherwise, you must specify the width in
+.I media-type
+is image/jpeg, image/png, or image/gif, this can usually be left empty
+and the information will be read from the file.
+Otherwise, you must specify the width in
 pixels, height in pixels, and color depth in bits-per-pixel. If the image has
 indexed colors you should also specify the number of colors used. If possible,
 these are checked against the file for accuracy.
@@ -295,8 +292,8 @@
 
 .I filename
 is the path to the picture file to be imported, or the URL if the
-.I mime-type
-is -->.
+.I media-type
+is "-->".
 .IP "--padding n"
 Reserve
 .I n
@@ -307,8 +304,9 @@
 .IP "--discard-pictures"
 Don't propagate pictures or art from the input file.
 
+.SS "Input options"
 .IP "--raw"
-Raw (headerless) PCM input
+Interpret input as raw PCM data without headers
 .IP "--raw-bits N"
 Set bits/sample for raw input (default: 16)
 .IP "--raw-rate N"
@@ -316,11 +314,23 @@
 .IP "--raw-chan N"
 Set number of channels for raw input (default: 2)
 .IP "--raw-endianness [0/1]"
-Set the endianness for raw input: 1 for bigendian, 0 for little (defaults to 0)
+Set the endianness for raw input: 1 for big endian, 0 for little (default: 0)
 .IP "--ignorelength"
-Always ignore the datalength in Wave headers. Opusenc automatically ignores
+Ignore the data length in Wave headers. Opusenc automatically ignores
 the length when its implausible (very small or very large) but some STDIN
 usage may still need this option to avoid truncation.
+
+.SS "Diagnostic options"
+.IP "--serial n"
+Force use of a specific stream serial number, rather than one that is randomly generated.
+This is used to make the encoder deterministic for testing and is not generally recommended.
+.IP "--save-range file"
+Save check values for every frame to a file
+.IP "--set-ctl-int x=y"
+Pass the encoder control x with value y (advanced).
+Preface with s: to direct the ctl to multistream s
+.br
+This may be used multiple times
 
 .SH EXAMPLES
 
--- a/src/opusenc.c
+++ b/src/opusenc.c
@@ -110,125 +110,121 @@
 {
   printf("Usage: opusenc [options] input_file output_file.opus\n");
   printf("\n");
-  printf("Encodes input_file using Opus.\n");
+  printf("Encode audio using Opus.\n");
 #if defined(HAVE_LIBFLAC)
-  printf("It can read the WAV, AIFF, FLAC, Ogg/FLAC, or raw files.\n");
+  printf("The input format can be Wave, AIFF, FLAC, Ogg/FLAC, or raw PCM.\n");
 #else
-  printf("It can read the WAV, AIFF, or raw files.\n");
+  printf("The input format can be Wave, AIFF, or raw PCM.\n");
 #endif
-  printf("\nGeneral options:\n");
-  printf(" -h, --help         This help\n");
-  printf(" -V, --version      Version information\n");
-  printf(" --quiet            Quiet mode\n");
-  printf("\n");
-  printf("input_file can be:\n");
+  printf("\ninput_file can be:\n");
   printf("  filename.wav      file\n");
   printf("  -                 stdin\n");
-  printf("\n");
-  printf("output_file can be:\n");
+  printf("\noutput_file can be:\n");
   printf("  filename.opus     compressed file\n");
   printf("  -                 stdout\n");
+  printf("\nGeneral options:\n");
+  printf(" -h, --help         Show this help\n");
+  printf(" -V, --version      Show version information\n");
+  printf(" --help-picture     Show help on attaching album art\n");
+  printf(" --quiet            Enable quiet mode\n");
   printf("\nEncoding options:\n");
-  printf(" --bitrate n.nnn    Target bitrate in kbit/sec (6-256/channel)\n");
+  printf(" --bitrate n.nnn    Set target bitrate in kbit/sec (6-256/channel)\n");
   printf(" --vbr              Use variable bitrate encoding (default)\n");
   printf(" --cvbr             Use constrained variable bitrate encoding\n");
   printf(" --hard-cbr         Use hard constant bitrate encoding\n");
-  printf(" --comp n           Encoding complexity (0-10, default: 10 (slowest))\n");
-  printf(" --framesize n      Maximum frame size in milliseconds\n");
+  printf(" --comp n           Set encoding complexity (0-10, default: 10 (slowest))\n");
+  printf(" --framesize n      Set maximum frame size in milliseconds\n");
   printf("                      (2.5, 5, 10, 20, 40, 60, default: 20)\n");
-  printf(" --expect-loss      Percentage packet loss to expect (default: 0)\n");
+  printf(" --expect-loss      Set expected packet loss in percent (default: 0)\n");
   printf(" --downmix-mono     Downmix to mono\n");
   printf(" --downmix-stereo   Downmix to stereo (if >2 channels)\n");
-  printf(" --max-delay n      Maximum container delay in milliseconds\n");
+  printf(" --max-delay n      Set maximum container delay in milliseconds\n");
   printf("                      (0-1000, default: 1000)\n");
+  printf("\nMetadata options:\n");
+  printf(" --title title      Set track title\n");
+  printf(" --artist artist    Set artist or author, may be used multiple times\n");
+  printf(" --album album      Set album or collection\n");
+  printf(" --genre genre      Set genre, may be used multiple times\n");
+  printf(" --date YYYY-MM-DD  Set date of track (YYYY, YYYY-MM, or YYYY-MM-DD)\n");
+  printf(" --comment tag=val  Add the given string as an extra comment\n");
+  printf("                      This may be used multiple times\n");
+  printf(" --picture file     Attach album art (see --help-picture)\n");
+  printf("                      This may be used multiple times\n");
+  printf(" --padding n        Reserve n extra bytes for metadata (default: 512)\n");
+  printf(" --discard-comments Don't keep metadata when transcoding\n");
+  printf(" --discard-pictures Don't keep pictures when transcoding\n");
+  printf("\nInput options:\n");
+  printf(" --raw              Interpret input as raw PCM data without headers\n");
+  printf(" --raw-bits n       Set bits/sample for raw input (default: 16)\n");
+  printf(" --raw-rate n       Set sampling rate for raw input (default: 48000)\n");
+  printf(" --raw-chan n       Set number of channels for raw input (default: 2)\n");
+  printf(" --raw-endianness n 1 for big endian, 0 for little (default: 0)\n");
+  printf(" --ignorelength     Ignore the data length in Wave headers\n");
   printf("\nDiagnostic options:\n");
-  printf(" --serial n         Forces a specific stream serial number\n");
-  printf(" --save-range file  Saves check values for every frame to a file\n");
+  printf(" --serial n         Force use of a specific stream serial number\n");
+  printf(" --save-range file  Save check values for every frame to a file\n");
   printf(" --set-ctl-int x=y  Pass the encoder control x with value y (advanced)\n");
   printf("                      Preface with s: to direct the ctl to multistream s\n");
   printf("                      This may be used multiple times\n");
-  printf("\nMetadata options:\n");
-  printf(" --comment          Add the given string as an extra comment\n");
-  printf("                      This may be used multiple times\n");
-  printf(" --artist           Author of this track\n");
-  printf(" --title            Title for this track\n");
-  printf(" --album            Album or collection this track belongs to\n");
-  printf(" --date             Date for this track\n");
-  printf(" --genre            Genre for this track\n");
-  printf(" --picture          Album art for this track\n");
-  printf("                      More than one --picture option can be specified.\n");
-  printf("                      Either a FILENAME for the picture file or a more\n");
-  printf("                      complete SPECIFICATION form can be used. The\n");
-  printf("                      SPECIFICATION is a string whose parts are\n");
-  printf("                      separated by | (pipe) characters. Some parts may\n");
-  printf("                      be left empty to invoke default values. A\n");
-  printf("                      FILENAME is just shorthand for \"||||FILENAME\".\n");
-  printf("                      The format of SPECIFICATION is\n");
+}
+
+void help_picture(void)
+{
+  printf("  The --picture option can be used with a FILENAME, naming a JPEG,\n");
+  printf("  PNG, or GIF image file, or a more complete SPECIFICATION. The\n");
+  printf("  SPECIFICATION is a string whose parts are separated by | (pipe)\n");
+  printf("  characters. Some parts may be left empty to invoke default values.\n");
+  printf("  A plain FILENAME is just shorthand for \"||||FILENAME\".\n");
   printf("\n");
-  printf("                      [TYPE]|[MIME-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHT\n");
-  printf("                      xDEPTH[/COLORS]]|FILENAME\n");
+  printf("  The format of SPECIFICATION is:\n");
+  printf("  [TYPE]|[MEDIA-TYPE]|[DESCRIPTION]|[WIDTHxHEIGHTxDEPTH[/COLORS]]|FILENAME\n");
   printf("\n");
-  printf("                      TYPE is an optional number from one of:\n");
-  printf("                      0: Other\n");
-  printf("                      1: 32x32 pixel 'file icon' (PNG only)\n");
-  printf("                      2: Other file icon\n");
-  printf("                      3: Cover (front)\n");
-  printf("                      4: Cover (back)\n");
-  printf("                      5: Leaflet page\n");
-  printf("                      6: Media (e.g., label side of a CD)\n");
-  printf("                      7: Lead artist/lead performer/soloist\n");
-  printf("                      8: Artist/performer\n");
-  printf("                      9: Conductor\n");
-  printf("                      10: Band/Orchestra\n");
-  printf("                      11: Composer\n");
-  printf("                      12: Lyricist/text writer\n");
-  printf("                      13: Recording location\n");
-  printf("                      14: During recording\n");
-  printf("                      15: During performance\n");
-  printf("                      16: Movie/video screen capture\n");
-  printf("                      17: A bright colored fish\n");
-  printf("                      18: Illustration\n");
-  printf("                      19: Band/artist logotype\n");
-  printf("                      20: Publisher/studio logotype\n");
+  printf("  TYPE is an optional number from one of:\n");
+  printf("     0: Other\n");
+  printf("     1: 32x32 pixel 'file icon' (PNG only)\n");
+  printf("     2: Other file icon\n");
+  printf("     3: Cover (front)\n");
+  printf("     4: Cover (back)\n");
+  printf("     5: Leaflet page\n");
+  printf("     6: Media (e.g., label side of a CD)\n");
+  printf("     7: Lead artist/lead performer/soloist\n");
+  printf("     8: Artist/performer\n");
+  printf("     9: Conductor\n");
+  printf("    10: Band/Orchestra\n");
+  printf("    11: Composer\n");
+  printf("    12: Lyricist/text writer\n");
+  printf("    13: Recording location\n");
+  printf("    14: During recording\n");
+  printf("    15: During performance\n");
+  printf("    16: Movie/video screen capture\n");
+  printf("    17: A bright colored fish\n");
+  printf("    18: Illustration\n");
+  printf("    19: Band/artist logotype\n");
+  printf("    20: Publisher/studio logotype\n");
   printf("\n");
-  printf("                      The default is 3 (front cover). There may only be\n");
-  printf("                      one picture each of type 1 and 2 in a file.\n");
+  printf("  The default is 3 (front cover). More than one --picture option can\n");
+  printf("  be specified to attach multiple pictures. There may only be one\n");
+  printf("  picture each of type 1 and 2 in a file.\n");
   printf("\n");
-  printf("                      MIME-TYPE is optional. If left blank, it will be\n");
-  printf("                      detected from the file. For best compatibility\n");
-  printf("                      with players, use pictures with a MIME-TYPE of\n");
-  printf("                      image/jpeg or image/png. The MIME-TYPE can also\n");
-  printf("                      be --> to mean that FILENAME is actually a URL to\n");
-  printf("                      an image, though this use is discouraged. The\n");
-  printf("                      file at the URL will not be fetched. The URL\n");
-  printf("                      itself is stored in the metadata.\n");
+  printf("  MEDIA-TYPE is optional. If left blank, it will be detected from the\n");
+  printf("  file. For best compatibility with players, use pictures with a\n");
+  printf("  MEDIA-TYPE of image/jpeg or image/png. The MEDIA-TYPE can also be\n");
+  printf("  \"-->\" to mean that FILENAME is actually a URL to an image, though\n");
+  printf("  this use is discouraged. The file at the URL will not be fetched.\n");
+  printf("  The URL itself is stored in the metadata.\n");
   printf("\n");
-  printf("                      DESCRIPTION is optional. The default is an empty\n");
-  printf("                      string.\n");
+  printf("  DESCRIPTION is optional. The default is an empty string.\n");
   printf("\n");
-  printf("                      The next part specifies the resolution and color\n");
-  printf("                      information. If the MIME-TYPE is image/jpeg,\n");
-  printf("                      image/png, or image/gif, you can usually leave\n");
-  printf("                      this empty and they can be detected from the\n");
-  printf("                      file. Otherwise, you must specify the width in\n");
-  printf("                      pixels, height in pixels, and color depth in\n");
-  printf("                      bits-per-pixel. If the image has indexed colors\n");
-  printf("                      you should also specify the number of colors\n");
-  printf("                      used. If possible, these are checked against the\n");
-  printf("                      file for accuracy.\n");
+  printf("  The next part specifies the resolution and color information. If\n");
+  printf("  the MEDIA-TYPE is image/jpeg, image/png, or image/gif, this can\n");
+  printf("  usually be left empty and the information will be read from the\n");
+  printf("  file.  Otherwise, you must specify the width in pixels, height in\n");
+  printf("  pixels, and color depth in bits-per-pixel. If the image has indexed\n");
+  printf("  colors you should also specify the number of colors used. If possible,\n");
+  printf("  these are checked against the file for accuracy.\n");
   printf("\n");
-  printf("                      FILENAME is the path to the picture file to be\n");
-  printf("                      imported, or the URL if the MIME-TYPE is -->.\n");
-  printf(" --padding n        Extra bytes to reserve for metadata (default: 512)\n");
-  printf(" --discard-comments Don't keep metadata when transcoding\n");
-  printf(" --discard-pictures Don't keep pictures when transcoding\n");
-  printf("\nInput options:\n");
-  printf(" --raw              Raw input\n");
-  printf(" --raw-bits n       Set bits/sample for raw input (default: 16)\n");
-  printf(" --raw-rate n       Set sampling rate for raw input (default: 48000)\n");
-  printf(" --raw-chan n       Set number of channels for raw input (default: 2)\n");
-  printf(" --raw-endianness n 1 for bigendian, 0 for little (defaults to 0)\n");
-  printf(" --ignorelength     Always ignore the datalength in Wave headers\n");
+  printf("  FILENAME is the path to the picture file to be imported, or the URL\n");
+  printf("  if the MEDIA-TYPE is \"-->\".\n");
 }
 
 static inline void print_time(double seconds)
@@ -268,6 +264,7 @@
     {"save-range", required_argument, NULL, 0},
     {"set-ctl-int", required_argument, NULL, 0},
     {"help", no_argument, NULL, 0},
+    {"help-picture", no_argument, NULL, 0},
     {"raw", no_argument, NULL, 0},
     {"raw-bits", required_argument, NULL, 0},
     {"raw-rate", required_argument, NULL, 0},
@@ -418,6 +415,9 @@
           with_hard_cbr=0;
         }else if(strcmp(long_options[option_index].name,"help")==0){
           usage();
+          exit(0);
+        }else if(strcmp(long_options[option_index].name,"help-picture")==0){
+          help_picture();
           exit(0);
         }else if(strcmp(long_options[option_index].name,"version")==0){
           opustoolsversion(opus_version);
--- a/src/opusinfo.c
+++ b/src/opusinfo.c
@@ -377,7 +377,7 @@
          j += 4;
          mime_type_length = READ_U32_BE(data+j);
          if(mime_type_length > (size_t)data_sz-32) {
-             oi_warn(_("WARNING: Invalid mime type length in "
+             oi_warn(_("WARNING: Invalid media type length in "
                    "METADATA_BLOCK_PICTURE comment %d (stream %d): "
                    "%lu bytes when %i are available\n"), i, stream->num,
                    (long)mime_type_length, data_sz-32);
@@ -386,7 +386,7 @@
          }
          for (j += 4; j < 8+(int)mime_type_length; j++) {
              if(data[j] < 0x20 || data[j] > 0x7E) {
-                 oi_warn(_("WARNING: Invalid character in mime type of "
+                 oi_warn(_("WARNING: Invalid character in media type of "
                        "METADATA_BLOCK_PICTURE comment %d (stream %d): "
                        "0x%02X\n"), i, stream->num, data[j]);
                  broken = 1;
@@ -444,7 +444,7 @@
              if(!is_jpeg(data+j, image_length)) {
                  oi_warn(_("WARNING: Invalid image data in "
                        "METADATA_BLOCK_PICTURE comment %d (stream %d): "
-                       "mime type is %.*s but image does not appear to be "
+                       "media type is %.*s but image does not appear to be "
                        "JPEG\n"), i, stream->num, mime_type_length, data+8);
                  free(data);
                  return;
@@ -457,7 +457,7 @@
              if(!is_png(data+j, image_length)) {
                  oi_warn(_("WARNING: Invalid image data in "
                        "METADATA_BLOCK_PICTURE comment %d (stream %d): "
-                       "mime type is %.*s but image does not appear to be "
+                       "media type is %.*s but image does not appear to be "
                        "PNG\n"), i, stream->num, mime_type_length, data+8);
                  free(data);
                  return;
@@ -470,7 +470,7 @@
              if(!is_gif(data+j, image_length)) {
                  oi_warn(_("WARNING: Invalid image data in "
                        "METADATA_BLOCK_PICTURE comment %d (stream %d): "
-                       "mime type is %.*s but image does not appear to be "
+                       "media type is %.*s but image does not appear to be "
                        "PNG\n"), i, stream->num, mime_type_length, data+8);
                  free(data);
                  return;
@@ -502,7 +502,7 @@
              }
          }
          else {
-             oi_warn(_("WARNING: Unknown mime type in "
+             oi_warn(_("WARNING: Unknown media type in "
                    "METADATA_BLOCK_PICTURE comment %d (stream %d): "
                    "\"%.*s\" may not be well-supported\n"), i, stream->num,
                    mime_type_length, data+8);
--- a/src/picture.c
+++ b/src/picture.c
@@ -290,9 +290,9 @@
       *error_message="invalid picture specification: not enough fields";
       return NULL;
     }
-    /*The mime type must be composed of ASCII printable characters 0x20-0x7E.*/
+    /*The media type must be composed of ASCII printable characters 0x20-0x7E.*/
     for(p=mime_type;p<mime_type_end;p++)if(*p<0x20||*p>0x7E){
-      *error_message="invalid characters in mime type";
+      *error_message="invalid characters in media type";
       return NULL;
     }
     is_url=mime_type_end-mime_type==3
@@ -336,7 +336,7 @@
   }
   /*Buffer size: 8 static 4-byte fields plus 2 dynamic fields, plus the
      file/URL data.
-    We reserve at least 10 bytes for the mime type, in case we still need to
+    We reserve at least 10 bytes for the media type, in case we still need to
      extract it from the file.*/
   data_offset=32+(description_end-description)+IMAX(mime_type_end-mime_type,10);
   buf=NULL;
@@ -355,7 +355,7 @@
     ogg_uint32_t file_colors;
     int          has_palette;
     /*Complicated case: we have a real file.
-      Read it in, attempt to parse the mime type and image dimensions if
+      Read it in, attempt to parse the media type and image dimensions if
        necessary, and validate what the user passed in.*/
     if(picture_file==NULL){
       *error_message="error opening picture file";
@@ -398,7 +398,7 @@
       else cbuf=cbuf<<1|1;
     }
     data_length=nbuf-data_offset;
-    /*If there was no mimetype, try to extract it from the file data.*/
+    /*If there was no media type, try to extract it from the file data.*/
     if(mime_type_end==mime_type){
       if(is_jpeg(buf+data_offset,data_length)){
         mime_type="image/jpeg";
@@ -414,7 +414,7 @@
       }
       else{
         free(buf);
-        *error_message="unable to guess MIME type from file, "
+        *error_message="unable to guess media type from file, "
          "must set it explicitly";
         return NULL;
       }
@@ -466,7 +466,7 @@
   }
   /*Build the METADATA_BLOCK_PICTURE buffer.
     We do this backwards from data_offset, because we didn't necessarily know
-     how big the mime type string was before we read the data in.*/
+     how big the media type string was before we read the data in.*/
   data_offset-=4;
   WRITE_U32_BE(buf+data_offset,(unsigned long)data_length);
   data_offset-=4;