[Abcde-users] [abcde] r374 committed - Adds opus encoding support, thanks to Tomasz Golinski for the patch....

abcde at googlecode.com abcde at googlecode.com
Fri Dec 14 12:06:36 GMT 2012


Revision: 374
Author:   andrew at andrews-corner.org
Date:     Fri Dec 14 04:06:15 2012
Log:      Adds opus encoding support, thanks to Tomasz Golinski for the  
patch.
Closes issue 70.

http://code.google.com/p/abcde/source/detail?r=374

Modified:
  /trunk/abcde
  /trunk/abcde.1
  /trunk/abcde.conf
  /trunk/changelog
  /trunk/debian/control

=======================================
--- /trunk/abcde	Thu Dec  6 03:42:29 2012
+++ /trunk/abcde	Fri Dec 14 04:06:15 2012
@@ -51,7 +51,7 @@
  echo "-n     No lookup. Don't query CDDB, just create and use template"
  echo "-N     Noninteractive. Never prompt for anything"
  echo "-o <type1[,type2]...>"
-echo "       Output file type(s) (vorbis,mp3,flac,spx,mpc,wav,m4a).  
Defaults to vorbis"
+echo "       Output file type(s) (vorbis,mp3,flac,spx,mpc,wav,m4a,opus).  
Defaults to vorbis"
  echo "-p     Pad track numbers with 0's (if less than 10 tracks)"
  echo "-P     Use UNIX pipes to read+encode without wav files"
  echo "-q <level>"
@@ -515,6 +515,9 @@
  				vorbis|ogg)
  					OUTPUT=$OGGOUTPUTCONTAINER
  					;;
+				opus)
+					OUTPUT=$OPUSOUTPUTCONTAINER
+					;;
  				flac)
  					OUTPUT=$FLACOUTPUTCONTAINER
  					;;
@@ -898,6 +901,10 @@
  					;;
  			esac
  			;;
+		opus)
+			run_command tagtrack-$OUTPUT-$1 true
+			;;
+
  		flac)
  			(
  			echo ARTIST="$TRACKARTIST"
@@ -1018,6 +1025,9 @@
  			vorbis|ogg)
  				TEMPARG="PIPE_$OGGENCODERSYNTAX"
  				;;
+			opus)
+				TEMPARG="PIPE_$OPUSENCODERSYNTAX"
+				;;
  			flac)
  				TEMPARG="PIPE_$FLACENCODERSYNTAX"
  				;;
@@ -1060,6 +1070,9 @@
  				vorbis|ogg)
  					OUTPUT=$OGGOUTPUTCONTAINER
  					;;
+				opus)
+					OUTPUT=$OPUSOUTPUTCONTAINER
+					;;
  				flac)
  					OUTPUT=$FLACOUTPUTCONTAINER
  					;;
@@ -1111,6 +1124,32 @@
  					esac
  					;;
  				*)
+					$RUN_COMMAND nice $DISTMP3NICE $DISTMP3  
$DISTMP3OPTS "$2" "$IN" "$OUT" >/dev/null 2>&1
+					;;
+				esac
+				;;
+			opus)
+				case "$2" in
+				%local*%)
+					case "$OPUSENCODERSYNTAX" in
+					opusenc)
+
+					    if [ "$(eval echo ${COMMENT})" != "" ]; then
+						case "$COMMENT" in
+						    *=*) ;;
+						     *)   COMMENT="COMMENT=$COMMENT" ;;
+						esac
+					    fi
+					    # Tag the file at encode time, as it can't be done after encoding.
+					    if [ "$DOTAG" = "y" ]; then
+					      $RUN_COMMAND nice $EFFECTIVE_NICE $OPUSENCODER $OPUSENCODEROPTS  
--artist "$TRACKARTIST" --comment album="$DALBUM" --title "$TRACKNAME"  
--comment track="$1" --comment genre="$CDGENRE" --comment year="$CDYEAR"  
${COMMENT:+--comment "$COMMENT"} "$IN" "$OUT"
+					    else
+					      $RUN_COMMAND nice $EFFECTIVE_NICE $OPUSENCODER  
$OPUSENCODEROPTS "$IN" "$OUT"
+					    fi
+					      ;;
+					esac
+					;;
+				*)
  					$RUN_COMMAND nice $DISTMP3NICE $DISTMP3  
$DISTMP3OPTS "$2" "$IN" "$OUT" >/dev/null 2>&1
  					;;
  				esac
@@ -1397,6 +1436,9 @@
  				vorbis|ogg)
  					OUTPUT=$OGGOUTPUTCONTAINER
  					;;
+				opus)
+					OUTPUT=$OPUSOUTPUTCONTAINER
+					;;
  				flac)
  					OUTPUT=$FLACOUTPUTCONTAINER
  					;;
@@ -1478,6 +1520,9 @@
  			vorbis|ogg)
  				OUTPUT=$OGGOUTPUTCONTAINER
  				;;
+			opus)
+				OUTPUT=$OPUSOUTPUTCONTAINER
+				;;
  			flac)
  				OUTPUT=$FLACOUTPUTCONTAINER
  				;;
@@ -3149,6 +3194,7 @@

  MP3ENCODERSYNTAX=default
  OGGENCODERSYNTAX=default
+OPUSENCODERSYNTAX=default
  FLACENCODERSYNTAX=default
  SPEEXENCODERSYNTAX=default
  MPCENCODERSYNTAX=default
@@ -3199,6 +3245,8 @@
  # ogg
  VORBIZE=vorbize
  OGGENC=oggenc
+#opus
+OPUSENC=opusenc
  # flac
  FLAC=flac
  # speex
@@ -3249,6 +3297,8 @@
  VORBIZEOPTS=
  OGGENCOPTS=
  VORBISGAINOPTS="--album"
+#opus
+OPUSENCOPTS=
  # flac
  FLACOPTS=
  FLACGAINOPTS="--add-replay-gain"
@@ -3285,7 +3335,7 @@

  # This option is basically for Debian package dependencies:
  # List of preferred outputs - by default, run with whatever we have in the  
path
-DEFAULT_OUTPUT_BINARIES=vorbis:oggenc,flac:flac,mp3:toolame,mp3:lame,mp3:bladeenc,spx:speex,m4a:faac
+DEFAULT_OUTPUT_BINARIES=vorbis:oggenc,flac:flac,mp3:toolame,mp3:lame,mp3:bladeenc,spx:speex,m4a:faac:opus

  # List of preferred cdromreaders - by default, run whichever we have in  
the path
  DEFAULT_CDROMREADERS="cdparanoia icedax cdda2wav"
@@ -3730,6 +3780,7 @@
  	for OUTPUT in "$(echo "$OUTPUTTYPE" | tr \  \|| tr , \ | tr \| \ )"; do
  		case "$OUTPUT" in
  			vorbis:*|ogg:*)	OGGENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;;
+			opus:*)	OPUSENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;;
  			mp3:*)	MP3ENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;;
  			flac:*)	FLACENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;;
  			spx:*)	SPEEXENCODEROPTSCLI="$( echo $OUTPUT | cut -d: -f2- )" ;;
@@ -3757,6 +3808,10 @@
  			[ "$DOREPLAYGAIN" = "y" ] && NEEDVORBISGAIN=y
  			OGGOUTPUTCONTAINER=ogg
  			;;
+		opus)
+			[ "$OPUSENCODERSYNTAX" = "default" ] && OPUSENCODERSYNTAX=opusenc
+			OPUSOUTPUTCONTAINER=opus
+			;;
  		mp3)
  			[ "$MP3ENCODERSYNTAX" = "default" ] && MP3ENCODERSYNTAX=lame
  			[ "$DOTAG" = "y" ] && NEEDTAGGER=y
@@ -3832,6 +3887,12 @@
  		OGGENCODEROPTS="${OGGENCODEROPTSCLI:-$OGGENCOPTS}"
  		OGGENCODER="$OGGENC"
  		;;
+esac
+case "$OPUSENCODERSYNTAX" in
+	opusenc)
+		OPUSENCODEROPTS="${OPUSENCODEROPTSCLI:-$OPUSENCOPTS}"
+		OPUSENCODER="$OPUSENC"
+		;;
  esac
  case "$FLACENCODERSYNTAX" in
  	flac)
@@ -3965,6 +4026,7 @@
  PIPE_lame="-"
  PIPE_bladeenc="-"
  PIPE_oggenc="-"
+PIPE_opusenc="-"
  PIPE_flac="-"

  # Figure out if we can use pipes with the ripper/encoder combination
@@ -3976,6 +4038,8 @@
  			PIPEENCODERSVARCHECK="PIPE_$MP3ENCODERSYNTAX" ;;
  		vorbis|ogg)
  			PIPEENCODERSVARCHECK="PIPE_$OGGENCODERSYNTAX" ;;
+		opus)
+			PIPEENCODERSVARCHECK="PIPE_$OPUSENCODERSYNTAX" ;;
  		flac)
  			PIPEENCODERSVARCHECK="PIPE_$FLACENCODERSYNTAX" ;;
  		spx)
@@ -4003,7 +4067,7 @@

  # Make sure a buncha things exist
  for X in $CDROMREADER $CDDISCID ${NEEDTAGGER+$TAGGER} $MP3ENCODER \
-	$OGGENCODER $FLACENCODER $SPEEXENCODER $MPCENCODER \
+	$OGGENCODER $OPUSENCODER $FLACENCODER $SPEEXENCODER $MPCENCODER \
  	$AACENCODER $CDDBTOOL \
  	${NEEDATOMICPARSLEY+$ATOMICPARSLEY} \
  	${NEEDHTTPGET+$HTTPGET} ${NEEDDISTMP3+$DISTMP3} \
=======================================
--- /trunk/abcde.1	Sat Dec  8 19:18:15 2012
+++ /trunk/abcde.1	Fri Dec 14 04:06:15 2012
@@ -10,7 +10,7 @@
  .BR abcde
  is designed to automate this. It will take an entire CD and convert it into
  a compressed audio format - Ogg/Vorbis, MPEG Audio Layer III, Free Lossless
-Audio Codec (FLAC), Ogg/Speex, MPP/MP+(Musepack) and/or M4A (AAC)  
format(s).
+Audio Codec (FLAC), Ogg/Speex, MPP/MP+(Musepack), M4A (AAC) or Opus  
format(s).
  With one command, it will:
  .TP
  .B *
@@ -23,7 +23,7 @@
  Normalize the volume of the individual file (or the album as a single unit)
  .TP
  .B *
-Compress to Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+(Musepack) and/or M4A  
format(s), all in one CD read
+Compress to Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+(Musepack), M4A  
and/or Opus format(s), all in one CD read
  .TP
  .B *
  Comment or ID3/ID3v2 tag
@@ -136,8 +136,8 @@
  .TP
  .B \-o [filetype][:filetypeoptions]
  Select output type. Can be "vorbis"  
(or "ogg"), "mp3", "flac", "spx", "mpc",
-"m4a" or "wav".  Specify a comma-delimited list of output types to obtain  
all
-specified types.  See the OUTPUTTYPE configuration variable. One can pass
+"m4a", "wav" or "opus".  Specify a comma-delimited list of output types to  
obtain
+all specified types.  See the OUTPUTTYPE configuration variable. One can  
pass
  options to the encoder for a specific filetype on the command line  
separating
  them with a colon. The options must be escaped with double-quotes.
  .TP
@@ -214,11 +214,11 @@
  will process the entire CD. Accepts ranges of track numbers -
  "abcde 1-5 7 9" will process tracks 1, 2, 3, 4, 5, 7, and 9.
  .SH OUTPUT
-Each track is, by default, placed in a separate file named after the track
-in a subdirectory named after the artist under the current directory.
-This can be modified using the OUTPUTFORMAT and VAOUTPUTFORMAT
-variables in your \fIabcde.conf\fR. Each file is given an extension  
identifying
-its compression format, 'vorbis'  
for '.ogg', '.mp3', '.flac', '.spx', '.mpc', '.aac' or '.wav'.
+Each track is, by default, placed in a separate file named after the track  
in a
+subdirectory named after the artist under the current directory. This can  
be
+modified using the OUTPUTFORMAT and VAOUTPUTFORMAT variables in your
+\fIabcde.conf\fR. Each file is given an extension identifying  its  
compression
+format, 'vorbis'  
for '.ogg', '.mp3', '.flac', '.spx', '.mpc', '.aac', '.wav' or '.opus'.
  .SH CONFIGURATION
  \fBabcde\fR sources two configuration files on startup -  
\fI/etc/abcde.conf\fR and
  \fI$HOME/.abcde.conf\fR, in that order.
@@ -321,6 +321,10 @@
  Specifies the style of encoder to use for M4A (AAC) encoder. We support  
\'faac\'
  as \'default\' but support is there for neroAacEnc as well.
  .TP
+.B OPUSENCODERSYNTAX
+Specifies the style of encoder to use for the Opus encoder. At this point  
only
+\'opusenc\' is available for Opus encoding.
+.TP
  .B NORMALIZERSYNTAX
  Specifies the style of normalizer to use.  Valid options are \'default\'
  and \'normalize'\ (and both run \'normalize-audio\'), since we only  
support it,
@@ -357,7 +361,7 @@
  .B PATHNAMES
  The following configuration file options specify the pathnames of their
  respective utilities: LAME, TOOLAME, GOGO, BLADEENC, L3ENC, XINGMP3ENC,  
MP3ENC,
-VORBIZE, OGGENC, FLAC, SPEEXENC, MPCENC, AACENC, ID3, EYED3, METAFLAC,
+VORBIZE, OGGENC, FLAC, SPEEXENC, MPCENC, AACENC, OPUSENC, ID3, EYED3,  
METAFLAC,
  CDPARANOIA, CDDA2WAV, CDDAFS, CDDISCID, CDDBTOOL, EJECT, MD5SUM, DISTMP3,
  VORBISCOMMENT, NORMALIZE, CDSPEED, MP3GAIN, VORBISGAIN, MPPGAIN, MKCUE,  
MKTOC,
  CUE2DISCID (see option "\-X"), DIFF and HTTPGET.
@@ -366,9 +370,9 @@
  If you wish to specify command-line options to any of the programs  
\fBabcde\fR uses,
  set the following configuration file options: LAMEOPTS, TOOLAMEOPTS,  
GOGOOPTS,
  BLADEENCOPTS, L3ENCOPTS, XINGMP3ENCOPTS, MP3ENCOPTS, VORBIZEOPTS,  
OGGENCOPTS,
-FLACOPTS, SPEEXENCOPTS, MPCENCOPTS, AACENCOPTS, ID3OPTS, EYED3OPTS,  
MP3GAINOPTS,
-CDPARANOIAOPTS, CDDA2WAVOPTS, CDDAFSOPTS, CDDBTOOLOPTS, EJECTOPTS,  
DISTMP3OPTS,
-NORMALIZEOPTS, CDSPEEDOPTS, MKCUEOPTS, VORBISCOMMMENTOPTS, METAFLACOPTS,
+FLACOPTS, SPEEXENCOPTS, MPCENCOPTS, AACENCOPTS, OPUSENCOPTS, ID3OPTS,  
EYED3OPTS,
+MP3GAINOPTS, CDPARANOIAOPTS, CDDA2WAVOPTS, CDDAFSOPTS, CDDBTOOLOPTS,  
EJECTOPTS,
+DISTMP3OPTS, NORMALIZEOPTS, CDSPEEDOPTS, MKCUEOPTS, VORBISCOMMMENTOPTS,  
METAFLACOPTS,
  DIFFOPTS, FLACGAINOPTS, VORBISGAINOPTS and HTTPGETOPTS.
  .TP
  .B CDSPEEDVALUE
@@ -400,9 +404,9 @@
  Specifies the encoding format to output, as well as the default extension  
and
  encoder. Defaults to "vorbis". Valid settings are "vorbis" (or "ogg")
  (Ogg/Vorbis), "mp3" (MPEG-1 Audio Layer III), "flac" (Free Lossless Audio
-Codec), "spx" (Ogg/Speex), "mpc" (MPP/MP+ (Musepack)), "m4a" (for M4A  
(AAC)) or
-"wav" (Microsoft Waveform). Values like "vorbis,mp3" encode the tracks in  
both
-Ogg/Vorbis and MP3 formats. For example
+Codec), "spx" (Ogg/Speex), "mpc" (MPP/MP+ (Musepack)), "m4a" (for M4A  
(AAC)),
+"wav" (Microsoft Waveform) or "opus" (Opus Interactive Audio Codec). Values
+like "vorbis,mp3" encode the tracks in both Ogg/Vorbis and MP3 formats.  
For example
  .br
  OUTPUTTYPE=vorbis,flac
  .br
@@ -551,7 +555,7 @@
  \fBabcde\fR requires the following backend tools to work:
  .TP
  .B *
-An Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+(Musepack) or M4A encoder  
(oggenc, vorbize, lame, gogo, bladeenc, l3enc, mp3enc, flac, speexenc,  
mpcenc, faac, neroAacEnc)
+An Ogg/Vorbis, MP3, FLAC, Ogg/Speex, MPP/MP+(Musepack), M4A encoder or  
Opus encoder (oggenc, vorbize, lame, gogo, bladeenc, l3enc, mp3enc, flac,  
speexenc, mpcenc, faac, neroAacEnc, opusenc).
  .TP
  .B *
  An audio CD reading utility (cdparanoia, icedax, cdda2wav, dagrab)
=======================================
--- /trunk/abcde.conf	Thu Dec  6 03:53:39 2012
+++ /trunk/abcde.conf	Fri Dec 14 04:06:15 2012
@@ -61,7 +61,8 @@
  # speexenc - the only encoder for SPEEXENCODERSYNTAX
  # mpcenc - encoder for MPCENCODERSYNTAX
  # faac, neroAacEnc - for AACENCODER
-# default is a valid option for oggenc, lame, flac, speexenc, mpcenc and  
faac.
+# opusenc - for OPUSENCODER
+# default is a valid option for oggenc, lame, flac, speexenc, mpcenc, faac  
and opus.
  # Currently this affects the default location of the binary, the variable
  # to pick encoder command-line options from, and where the options are
  # given.
@@ -71,6 +72,7 @@
  #SPEEXENCODERSYNTAX=default
  #MPCENCODERSYNTAX=default
  #AACENCODERSYNTAX=default
+#OPUSENCODERSYNTAX=default

  # Specify the syntax of the normalize binary here - so far only 'normalize'
  # is supported.
@@ -129,6 +131,7 @@
  #SPEEXENC=speexenc
  #MPCENC=mpcenc
  #AACENC=faac
+#OPUSENC=opusenc

  #ID3=id3
  #EYED3=eyeD3
@@ -196,6 +199,10 @@
  #OUTPUTTYPE="m4a"
  #ATOMICPARSLEY='AtomicParsley'

+# OPUS
+# For the encoder options look at: opusenc -h.
+#OPUSENCOPTS='--bitrate 128'
+
  #ID3OPTS=
  #EYED3OPTS="--set-encoding=utf16-LE"
  #CDPARANOIAOPTS=
@@ -245,7 +252,7 @@
  # you can specify that here
  #WAVOUTPUTDIR=`pwd`

-# OUTPUTTYPE can be either "ogg", "mp3", "flac" or "spx", or a combination
+# OUTPUTTYPE can be either "ogg", "mp3", "flac", "spx", "opus" or a  
combination
  # of them separated with ",": "ogg,mp3".
  #OUTPUTTYPE=ogg

=======================================
--- /trunk/changelog	Thu Dec  6 03:53:39 2012
+++ /trunk/changelog	Fri Dec 14 04:06:15 2012
@@ -12,6 +12,8 @@
      patch.
    * Allow aac encoding with neroAacEnc. Thanks to atheren for the patch.
      Closes issue 8.
+  * Allow opus encoding with opusenc. Thanks to Tomasz Golinski for the
+    patch. Closes issue 70.

   -- Steve McIntyre <93sam at debian.org>  Tue, 27 Nov 2012 17:34:55 +0000

=======================================
--- /trunk/debian/control	Tue Nov 27 09:36:08 2012
+++ /trunk/debian/control	Fri Dec 14 04:06:15 2012
@@ -10,7 +10,7 @@

  Package: abcde
  Architecture: all
-Depends: ${misc:Depends}, cd-discid, wget, cdparanoia | icedax,  
vorbis-tools (>= 1.0beta4-1) | lame | flac | bladeenc | speex |  
musepack-tools
+Depends: ${misc:Depends}, cd-discid, wget, cdparanoia | icedax,  
vorbis-tools (>= 1.0beta4-1) | lame | flac | bladeenc | speex |  
musepack-tools | opus-tools
  Recommends: vorbis-tools, libmusicbrainz-discid-perl,  
libwebservice-musicbrainz-perl, libdigest-sha-perl, mailx
  Suggests: eject, distmp3, id3 (>= 0.12), id3v2, eyed3, normalize-audio,  
vorbisgain, mkcue, mp3gain, atomicparsley
  Description: A Better CD Encoder



More information about the Abcde-users mailing list