A simple perl script to transcode files (reduce size and quality) when transferring to a portable device. The persistent storage feature allows to save converted files to a user specified directory. Next time Amarok asks for the same file the script will point to the proper location instead of transcoding it again.
Currently the script can transcode: - FLAC to Ogg Vorbis - Ogg Vorbis to Ogg Vorbis - MP3 to Ogg Vorbis
Usage: Simply run this script and select "Transcode before transferring to device" and "Whenever possible" in the Configure Media Device window.
To take advantage of the persistent transcoding feature you have to edit the script and set the source and target variables. For example when you are transcoding ~/audio/collection/Artist/Album/Track.flac and you set:
my $source_dir = $ENV{HOME}."/audio/collection"; my $target_dir = $ENV{HOME}."/audio/portable";
the converted file will be saved as ~/audio/portable/Artist/Album/Track.ogg
If you don't want to store transcoded files for further use simply select "Remove transcoded files after transfer" and leave source/target directory configuration at default values.
Dependencies: You must have: - Perl with URI::Escape and String::ShellQuote modules (on Debian/Ubuntu look for libstring-shellquote-perl and liburi-perl packages) - oggenc (vorbis-tools package)
You might also need: for Ogg Vorbis to Ogg Vorbis conversion: - oggdec - vorbiscomment
for MP3 to Ogg Vorbis conversion: - mp32ogg with --quality option support (transcoding mp3 to ogg)
Inspired by Jose Jorge's Transcogg.
This is my first Perl scripting attempt. You have been warned.Last changelog:
Ratings & Comments
0 Comments