You are not logged in.
Pages: 1
I've got an older laptop that I use Arch on, using it mostly as the home DJ box. However, the hard drive on it is pretty small, and now I often find myself going through ~/ and searching for things (old source tarballs and such) that are just taking up space on the partition.
Then, it hit me. A good chunk of my music is encoded @ 320 kbps, making the files larger than they need to be. 192 kbps would be a high enough quality for what I need, while respecting the need for a space constraint.
The problem, however, is that my music folder is well sorted (artist, album, disc), and going through each individual folder doing this would be an all-day thing. I need a solution that's automated (so I can start it when I go to bed) and recursive from ~/Music/
Any ideas? I'm somewhat competent with bash scripting if need be, but a GUI program would be rather nice.
TL;DR: Need to change 320 kbps songs into 192 kbps songs in one folder that consists of many subfolders, with many sub-subfolders.
Offline
I would define a function/script that wraps ffmpeg or mencoder and then gets called by "find -exec ...".
find ~/Music -type f -regex ".*\.ogg" -exec oggsquasher {} \;#! /bin/bash
# oggsquasher: re-encodes an ogg at 192kbps.
dir=$(dirname "$@")
name=$(basename "$@")
[[ "x$(file \"$name\" | awk -F': ' '{print $2}')" = "xOgg data, FLAC audio" ]] \
&& ffmpeg -i "$@" -ab 192k /tmp/"$name" \
&& mv /tmp/"$name" "$dir"... or the like.
Edit: parallelisation is also possible, but there is small incentive and some disincentive. It's only small incentive because I suppose all the music is on the one drive, so you will face a bottleneck of read/write speeds no matter how many cpus you have. There is some disincentive because looping over files that may contain spaces in their names makes it easy to introduce bugs. Dealing with files one at a time lets you not worry too much if files have spaces in their names.
Last edited by /dev/zero (2012-05-19 23:47:10)
Offline
Of course you're going to compress already compressed files if you do this. You won't end up with the 192 kbps version like if you were working off of the original source material. The sound quality may diminish significantly.
Offline
Of course you're going to compress already compressed files if you do this. You won't end up with the 192 kbps version like if you were working off of the original source material. The sound quality may diminish significantly.
I did a test, converting an ogg at 452kbps to 192kbps, and the two files sound exactly the same to my (non-audiophillic) ears.
Offline
skottish wrote:Of course you're going to compress already compressed files if you do this. You won't end up with the 192 kbps version like if you were working off of the original source material. The sound quality may diminish significantly.
I did a test, converting an ogg at 452kbps to 192kbps, and the two files sound exactly the same to my (non-audiophillic) ears.
If one is sticking with the same format, then the troubles get minimized quite a bit as it's the same algorithm used to do the work. Transcoding between formats is quite destructive and when the source is already highly compressed, it can make the quality much worse. The main thing that happens is that files get degraded enough where the audio starts to become either distorted, muffled, or 'thin' sounding. This is most evident with good amplifiers and speakers at a decent volume. On the other hand, many people don't hear the difference and really don't care.
Offline
Any ideas? I'm somewhat competent with bash scripting if need be, but a GUI program would be rather nice.
Install soundconverter from [community], change the settings to how you want them to be, dump all your songs into it, press the Convert button, go to sleep, wake up, and enjoy your new collection.
Please don't write your own solution. It's already been done so many times. There are so many other things in life to enjoy besides rewritting the same programs for Linux over and over. Like, enjoying an avocado. Or going swimming. You can't really listen to your newly converted music while swimming, but I suppose you could while eating an avocado...
Offline
Thanks much. I'll try soundconverter. Will mark as solved if it works.
Oh, and I could totally listen to my newly converted music while swimming.
Of course, it helps if I could actually swim first. I suppose I could just get some SCUBA gear and chill out at the bottom of a pool for a few hours instead.
Last edited by songandsilence (2012-05-20 04:21:26)
Offline
@op - to avoid the issue of transcoding lossy --> lossy you could change your music storage paradigm and do you initial rips to flac (a lossless format), Then use one of many flac-->whatever scripts to produce "portable" copies to whatever format/bitrate you wish without the quality losses others have already mentioned. For example, flac2all.
Offline
Pages: 1