HomePage
WikiBlog
RecentChanges
LikePages
BackLinks
FindPage

Blog entries

2010-02-16: RSS-Feeds für ricardo.ch-Suchergebnisse

2010-02-15_spam: Disabling public editing

2010-02-15: Show Processes waiting for I/O in Linux

2010-02-13: Sony Vaio P in der Schweiz...

2009-06-17: Wie man plötzlich zum Mörder wird (weil's einfach besser 'rüberkommt!)

2008-05-18: Recreating SSL keys for stunnel, lighttpd and dovecot following the Debian-OpenSSL debacle

2008-02-12: Patch for aoeserver in Kernel 2.6.24

2008-02-07: Usage of open-iscsi on Linux

2008-02-05: Linux and Windows working in harmony with iSCSI

2008-01-19: Linksys PAP2 FXS Port Impedance

< July, 2010 >
Sun Mon Tue Wed Thu Fri Sat
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Grip Multiple Encode

Introduction

Ever wanted to make lossy (e.g. MP3) and lossless (e.g. FLAC) versions of the same CD without having to rip the cd twice? And still keep the correct id3 tags? Or do you want to have two different lossy versions (e.g. one with 256kbit/s and one with 128kbit/s)?

I had the same problem and solved it using Grip and a shell script.

Requirements

You need:

  • Grip
  • LAME
  • FLAC
  • id3v2

If you run Debian, you can do this:

apt-get install grip lame flac id3v2

And you should be set... :)

Shell script encode.sh

#!/bin/bash

# author: nicola fankhauser (nicola.fankhauser@variant.ch)
# date: 09.11.2003
# license: GPL
#
# about: encodes one wavefile to multiple versions
#        (here to MP3 and FLAC)
#

# Command line arguments (first is $1, second $2 etc.)
WAVSOURCE=$1
DESTINATION=$2
TITLE=$3
ARTIST=$4
ALBUM=$5
YEAR=$6
TRACK=$7
GENRE=$8

echo $WAVSOURCE > ~/wavsource
echo $DESTINATION > ~/destination

# MP3 encoding
MP3ENC="lame -q0 -b 256 -V0 - -"

echo $MP3ENC

cat "$WAVSOURCE" | $MP3ENC > "$DESTINATION.mp3" 2> ~/lame_error

# set id3 tag
id3v2 --song "$TITLE" --artist "$ARTIST" \
      --album "$ALBUM" --year $YEAR \
      --track $TRACK --genre "$GENRE" "$DESTINATION.mp3"


# FLAC encoding
FLACENC="flac --best - "

echo $FLACENC

cat "$WAVSOURCE" | $FLACENC > "$DESTINATION.flac" 2> ~/flac_error

# set id3 tag
id3v2 --song "$TITLE" --artist "$ARTIST" \
      --album "$ALBUM" --year $YEAR \
      --track $TRACK --genre "$GENRE" "$DESTINATION.flac"

Grip configuration

Now you have to configure Grip: Go to Config->Encode and select other as encoder. Set the fields below:

  • Encoder executable: /path/to/encode.sh
  • Encoder command-line: "%w" "%m" %n %a %d %y %t %g
  • Encode file format: /path/to/music/files/%A/%d/%t - %n

How to use it

You only need to rip the CD like you are used to - Grip and encode.sh do the rest! In case it does not work correctly, you can inspect these logfiles created by encode.sh:

~/wavsource
~/destination
~/lame_error
~/flac_error

Alternatively, you can start encode.sh on the shell to see what it is doing.

If you have any comments on this script, please contact me!


Last edited on 10.11.2003 11:42.


Edit | PageHistory | Diff | PageInfo

© Copyright 2004 - 2006 Nicola Fankhauser. All Rights Reserved.