Installing PACPL in Ubuntu
PACPL is a Perl based script for converting audio files in Linux (http://pacpl.sourceforge.net//). It is extremely powerful and is capable of encoding/decoding a large array of formats (aac, ac3, avi, divx, flac, m4a, mp3, mp4, mpeg, ogg, raw, shn, vcd, vob, wav, wma, wmv and many more). Installing the program itself is fairly easy but it does require a number of dependencies – this is what causes most people problems. This tutorial will show how to install PACPL, the dependencies, codecs, how to use PACPL from the command line and how to integrate it into Amarok and Konqueror.
To start, make sure that you have all the repositories and codecs installed.
1.0 Install the Medibuntu repository
Open a terminal (Alt + f2) and type or copy/paste the following command for your Ubuntu-release
(if you use a older release please go to Medibuntu Repository Howto)
Ubuntu 8.04 "Hardy Heron":
Code:
sudo wget http://www.medibuntu.org/sources.list.d/hardy.list --output-document=/etc/apt/sources.list.d/medibuntu.list
Ubuntu 8.10 "Intrepid Ibex":
Code:
sudo wget http://www.medibuntu.org/sources.list.d/intrepid.list --output-document=/etc/apt/sources.list.d/medibuntu.list
Ubuntu 9.04 "Jaunty Jackalope":
Code:
sudo wget http://www.medibuntu.org/sources.list.d/jaunty.list --output-document=/etc/apt/sources.list.d/medibuntu.list
Then, add the GPG Key:
Code:
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
You may be asked to accept this package even though it cannot be authenticated. This is normal; typing "Yes" means you trust Medibuntu.
1.2 Install Ubuntu Restricted Extras and build-essential
Note that there is also xubuntu-restricted-extras (for Xubuntu) and kubuntu-restricted-extras (for Kubuntu.)
Code:
sudo apt-get install ubuntu-restricted-extras build-essential
** Note: PACPL does have a very simple GUI that can be used in gnome or kde. It requires you have Kommander installed so if you want to use the simple GUI then install Kommander prior to installing PACPL. Kommander is a kde package, so if you are in Gnome installing Kommander will also install a full kde desktop. If you don't want that, then do not install Kommander and either use PACPL with Amarok or from the command line.
1.3 Now you are ready to install PACPL
Download PACPL sources
Code:
wget http://dfn.dl.sourceforge.net/sourceforge/pacpl/pacpl-4.0.4.tar.bz2
Unpack it:
Code:
tar xvf pacpl-4.0.4.tar.bz2
Change the working directory to the source directory:
Code:
cd pacpl-4.0.4/extra
Next run the script that will install all the dependencies.
Code:
./mod-install-kubuntu.sh
Once that is finished change directories again to /pacpl-4.0.4:
Compiling it: This generates the necessary files, and checks your system:
Then compile:
Install it:
That's it.
Now you have a few options, 1. start using pacpl from the command line, or 2. if you are using kde, you can run pacpl via a GUI or integrated into Amarok, Konqueror, Dolphin or d3lphin. For all other desktop systems (gnome, xfce etc) the only option is to run pacpl from the command line.
1.4 Using the Kommander GUI:
To use the simple GUI that comes in the pacpl package, you first install Kommander from Synaptic (see note above).
Launch the gui using this command in a terminal.
1.5 To integrate pacpl into Amarok:
Create the directory /usr/share/apps/amarok/scripts/pacx/
Code:
mkdir /usr/share/apps/amarok/scripts/pacx/
Move the script pacx from /pacpl4.0.4/plugins/amarok/pacx to /usr/share/apps/amarok/scripts/pacx/
Code:
cp pacpl4.0.4/plugins/amarok/pacx /usr/share/apps/amarok/scripts/pacx/
Now when you have a file loaded into Amarok simply right click and the option to convert with pacpl should be available.
1.6 To integrate into Konqueror/d3lphin/dolphin:
pacpl.desktop (~/pacpl-4.0.4/plugins/konqueror) can be placed in either /usr/share/apps/konqueror/servicemenus or in your home directory (~/.kde/share/apps/konqueror/servicemenus).
Code:
cp pacpl-4.0.4/plugins/konqueror/pacpl.desktop /usr/share/apps/konqueror/servicemenus
Code:
cp pacpl-4.0.4/plugins/konqueror/pacpl.desktop .kde/share/apps/konqueror/servicemenus
pacpl.desktop can be used for d3lphin or dolphin the same as konqueror by using the same directory as above. Just replace the blue marked konqueror with d3lphin/dolphin...the rest is the same.
2.0 How to use pacpl in command line:
This command will display the list of commands available and instructions for using PACPL.
Display the list of available codecs for encoder and decoder
Some explanations, as usual
In general, the commands are written in the following structure
Code:
pacpl --to <format> <options> directories/files
Some examples
Replace "musig" with your name and change the location.
2.1 Simple convert
Open a terminal and go to the directory containing the files you want to convert. In the following example a folder named "flacMusic" in the home directory of the user"musig" .This will put the converted files into the same folder. If there are other files in the folder than the supported formats you have to specify the "from" file type. with *.mp3, for example, or use the --only option (see 2.5)
Code:
cd /home/musig/flacMusic
pacpl -t mp3 *.flac
Instead of using a wildcard (*) you can specify one or more files
Code:
cd /home/musig/flacMusic
pacpl -t mp3 fortunate_son.flac bad_moon_rising.flac
To convert files in subdirectories, use the option --recursive.
Code:
cd /home/musig/flacMusic
pacpl -t mp3 -r *.flac
If you don't want to keep the original (or if you only want to change the bitrate), use --overwrite
Code:
cd /home/musig/flacMusic
pacpl -t mp3 --overwrite *.flac
2.2 Output from and to a specified directory
In this case from the folder aacMusic to the folder mp3Music, both in the home directory of "user musig"
Code:
pacpl -t mp3 --outdir /home/musig/mp3Music /home/musig/aacMusic
You have to create the output folder first, PACPL will tell you
Code:
mkdir /home/musig/mp3Music
If you use --recursive and want to keep the directories structure, add --preserve
Code:
pacpl -t mp3 -r -p --outdir /home/musig/mp3Music /home/musig/aacMusic
To keep files already matching the destination extension and copy to the output directory, use --keep
Code:
pacpl -t mp3 -k --outdir /home/musig/mp3Music /home/musig/aacMusic
2.3 Set bitrate with option --bitrate (default 128 )
-Have not found out yet if this option makes a CBR or VBR (default). There are other options like --mpcqual described in the --longhelp which obviously make a VBR...
Code:
pacpl -t mp3 --bitrate 320 --outdir /home/musig/Desktop/auflegen2 /home/musig/Desktop/auflegen
2.4 Set Frequency with option --freq (default 44100)
Here with bitrate option, makes not much sense without...
Code:
pacpl -t mp3 --bitrate 320 --freq 48000 --outdir /home/musig/Desktop/auflegen2 /home/musig/Desktop/auflegen
2.5 Specify "from" file type
With the option --only, all other file types are excluded
Code:
pacpl -t mp3 -o aac --outdir /home/musig/mp3Music /home/musig/aacMusic
This is an update from the previous tutorial. All the credit for this goes to my friend from Zurich ti-mo. if you find this tutorial helpful please thank ti-mo (see post 53) also.
Enjoy!
Bookmarks