Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
This Amarok plugin shrinks (reduce the size) your files (MP3, OGG and FLAC) before tranfering them to your devices, to put more music in them. It also normalizes the volume of ReplayGain tagged files.

You need a device that plays the patent free Ogg/Vorbis format to benefit of this script.

Translations are welcome, contact me if you want to add your language to existing translations (english, français, português, español, deutsch).

This script loves multi-core machines, as it uses 3 threads to decode, normalize and encode.

FAQ:
1. My OGG files are not reencoded, only MP3 ones are converted to OGG?
-You have to ask Amarok to convert file "if possible" if you want the OGG files to be reduced, as this is a OGG to OGG conversion.

2. Amarok only transfers the first file at each transfer?
-Ask Amarok also to delete the converted file, or you won't be able to transfer more than one file.
Last changelog:

3.3 : fix a bug with mono and/or not 44100Hz mp3 files

3.2 : sometimes mp3 files are recognised as 'application/octet-stream'

...(watch changelog to know older changes)


Ratings & Comments

16 Comments

ellocogato

transcogg is great. But I have an issue with MIME types. For some reason this only seems to happen with MP3 files, but I can get a number of different MIME types from 'file -bi' on .mp3 files: audio/mpeg audio/mpeg audio/mpeg (yes, twice) audio/x-wav application/octet-stream Obviously transcogg fails to encode on anything other than audio/mpeg. But the problem is that when a .mp3 file that has any MIME type other than audio/mpeg is found, the whole script hangs until I cancel the Amarok transfer process. (If I remove "return 1" from the default case in get_decoder, the script doesn't hang any more. But this is just a hack.)

zezinho

Well, the fact that the script hangs can be good, as it has alerted you about the problem. Now, I've never found such a file, so I think the better would be that you send me some example files, or a list of lines to add to the get decoder function...

zhick

I'm loving your Script, but there's a little bug concernig "umlauts". When the name of/the path to the file contain a umlaut like Ä, Ö, Ü (only tested Ä but I have no doubt it also applies to others) and letters with a `, °, ... ontop of the it can't be transcogged. I'd be very glad if you could fix this. :)

zezinho

Well, I don't have such filenames, sticking to ASCII to filenames is easier when transporting them across filesystems, etc. I'd like to help, but I'm just no good at that. If anyone has a clue?

zezinho

I just tried the "Quick and Dirty Transcoder" way to do this, and it seems to work. If someone can test, replace a Transcogg 2.0 file by this one http://jjorge.free.fr/divers/transcogg

zhick

http://jjorge.free.fr/divers/transcogg works like a charm for me, thanks. :D

zezinho

Ok, so I can keep 2.1 released ;-)

Grunty

Thanks, for adding my patch:)

Grunty

I have added flac input support to the script. Heres a diff, take it or leave it... --- 63121-transcogg 2007-08-09 14:00:27.000000000 +0100 +++ transcogg 2007-12-25 23:25:16.000000000 +0000 @@ -83,6 +83,17 @@ ogg2ogg() rm $tmpfile } +flac2ogg() +{ + out=$1 + in=`uri_to_file "$2"` + tmpfile='/tmp/flac2ogg' + flac -d --silent --stdout "$in" | oggenc -q 0 -Q -r -o "$out" - 2>&1 + metaflac --list "$in" | grep comment | grep -v -e "^.*comments: [0-99]" | sed 's/^.*\[[0-99]\]: //g' > $tmpfile + vorbiscomment -w -c "$tmpfile" "$out" + rm $tmpfile +} + get_decoder() { uri=`uri_to_file $1` @@ -90,6 +101,7 @@ get_decoder() case $format in audio/mpeg) echo mp32ogg;; application/ogg) echo ogg2ogg;; + audio/x-flac) echo flac2ogg;; *) error $uri "Unsupported format \"$format\"" return 1;; esac @@ -130,6 +142,8 @@ transcode() outfile='/tmp/transcogg.ogg' if [ $decoder = "mp32ogg" ]; then error=`mp32ogg --quality=0 --rename="$outfile" "$file" 2>&1` + elif [ $decoder = "flac2ogg" ]; then + error=`flac2ogg "$outfile" "$file" 2>&1` else error=`ogg2ogg "$outfile" "$file" 2>&1` fi

zezinho

Of course I take it! I'll release a new version with it.

H00K

It would be great if the user could choose the desired quality in the Amarok Scripts interface. Otherwise I like it a lot :] p.s. AFAIK frodrigo is right. Maybe if you would just use parts of the script that is mp32ogg and modify them?

zezinho

I just replied him. Original mp32ogg is unmaintained. If your favourite distribution doesn't carry the version with --quality setting, please fill a bug to it, asking to sync with Debian patched version.

artrasa

Hi, I'm experiencing some problems with transcogg. When I drag'n'drop music files (MP3) into the "Devices" queue list, the converting-process starts. But on every song except the first one, it always ends with the following error. Failed to copy track into media device: /tmp/transcogg.ogg Also, Amarok crashes every time it thinks it is done converting and transferring the list of files. My DAP is Samsung YP-J3. MTP device with 2GB memory. It is able to play back Ogg files. OggEnc v1.0.2 AmaRok 1.4.7 Kubuntu Gutsy

zezinho

I don't have an MTP device to test, so I can't help you much more. I someone has an old MTP device to throw away, I'll correct the problem.

frodrigo

Transcogg use mp32ogg. But standard version of mp3ogg (http://faceprint.com/code/) haven't option --quality . So from where come you version of mp32ogg ?

zezinho

Debian package has a patch adding this functionality. It was also brought to Mandriva. I don't know for other distros.

Pling
0 Affiliates
Details
license
version 3.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

Other Amarok 1.x Scripts:

Gnome Play Video in Totem
mwheatland
last update date: 19 years ago

Score 5.0

editLyrics-gnome
ZeeD
last update date: 19 years ago

Score 5.0

amarok Alarm
aroth
last update date: 16 years ago

Score 5.0

amaroK Web Collection V xmms
pti-jean
last update date: 16 years ago

Score 5.0

SongLogger
lucatnt
last update date: 17 years ago

Score 5.0

amaroK Web Collection
pti-jean
last update date: 16 years ago

Score 5.0



System Tags