On 2003.11.16 10:38, Syd Hancock wrote:
Next problem: say I want to have a second set of music files encoded at a different bit-rate.
As well as the built-in command lines for the encoders grip supports it also allows you to specify any command of your choosing as the encoder.
You can make use of this by specifying a shell script as the encoder - the shell script whould look something like this:
--------------- #! /bin/sh
filename="$1"; shift
# Encode at fixed 128 kbits lame -b 128 "$@" ${filename}_128.mp3
# Encode again using VBR (standard) preset. lame --preset standard "$@" ${filename}_vbr.mp3 ---------------
This will expect the output filename as the first argument and pass all other arguments on to lame (or whatever encoder you choose to specify) unchanged. All you need to do now is make sure grip calls this script in the required way so you would go to Config/Encode and change the "Encoder executable" field to point to your shell script and the "Encoder command line" to read:
%m %w
i.e. we don't pass the bit-rate from the grip configuration to the encoder but let the shell script do that. The other thing you would want to do is to remove the file extension from the "Encode file format" field as the shell script adds it.
The same technique would be applicable if you wanted to encode into more than one format - you'd write a shell script that called each of the encoders and then tell grip to call the shell script.
One further issue is that now there are two encoded files neither of which is called what grip expects, grip will not be able to add ID3 tags to the files. Many encoders can do this anyway so the answer would be to add whatever options your encoder uses for this to the command line grip calls the shell script with, so for lame this would be:
--tt %*n --ta %*a --tl %*d --ty %*y --tn %t --tg %G
Back to you original idea of writing a file to drive an encoder that already knows how to encode batches of files, you could write a shell script like this:
--------------- #! /bin/sh echo "$@" >> batch_file ---------------
you can then vary the format of the lines in the file by changing the "Encoder command line" field from within grip. The disadvantage of this approach is that ripping and encoding no longer happen in parallel.
HTH, Steve.