
Transcogg
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
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.
11 years ago
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)
11 years ago
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)
ellocogato
12 years ago
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.)
Report
zezinho
12 years ago
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...
Report
zhick
12 years ago
I'd be very glad if you could fix this. :)
Report
zezinho
12 years ago
I'd like to help, but I'm just no good at that. If anyone has a clue?
Report
zezinho
12 years ago
Report
zhick
12 years ago
Report
zezinho
12 years ago
Report
Grunty
13 years ago
Report
Grunty
13 years ago
--- 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
Report
zezinho
13 years ago
Report
H00K
13 years ago
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?
Report
zezinho
13 years ago
Report
artrasa
13 years ago
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
Report
zezinho
13 years ago
Report
frodrigo
13 years ago
Report
zezinho
13 years ago
Report