UKC

Listing MP3s by bit rate?

New Topic
This topic has been archived, and won't accept reply postings.
 Thrudge 30 Jul 2013
Well, this one's got me stumped. I've got about 3000 MP3s on my PC. Some are 320kbps, some are not. I want all of them at 320k (please don't try to talk me out of this).

What I need is a list of all files that are less than 320k so I can re-rip the CDs.

Does anyone know how I can generate this list, please?

I know a Win7 search can give me a list which includes bitrate and I can sort the list on bitrate, but that doesn't really help - I need a list I can mess with in a spreadsheet, so I can rip out all the 320k files. That would leave me with the sub-320 ones which I can then set about deleting and re-ripping. Unfortunately, you can't export the contents of the search window to a file, AFAIK.
In reply to Tony Naylor: Is there not a program which will convert to 320 automatically?
 Blue Straggler 31 Jul 2013
In reply to stroppygob:
> (In reply to Tony Naylor) Is there not a program which will convert to 320 automatically?

How can you convert to 320 from a source mp3 at less than 320? Or did you fail to read the OP properly?
 Blue Straggler 31 Jul 2013
In reply to Tony Naylor:

Total guess, but would Mediamonkey help? Just a thought because it seems to have a much more "technical" GUI than a lot of other players and might let you order by bitrate and then deleting all the sub-320 stuff from within the Mediamonkey UI should give you the option to delete them forever.
I couldn't get on with Mediamonkey and reverted to iTunes though!
KevinD 31 Jul 2013
In reply to Tony Naylor:

amended since i screwed up the comparison and had <= rather than <.

ok, this needs powershell installed, if you havent used it before.
For windows 7 it should be installed by default.
Various ways to run it. Easiest is to go to Accessories/powershell then the ISE. To use paste the script into the bottom part of the window.

script partly nicked from here
http://stackoverflow.com/questions/1153819/get-list-of-files-recursively-by...


You will need to alter the directory and also may need to add a few more file extensions.
this will lose the backslashes when displayed on the forum so you will need to correct both the directory and also the out-file. Doesnt look like anything else gets changed though.
the minimumbitrate is a misleading name since the original code found those larger and I just reversed it.
It will write to badmusic.txt in the c:temp folder.

function Get-Mp3Files( [string]$directory = "D:MusicMusic", [int]$minimumBitrate = 320 ) {
$shellObject = New-Object -ComObject Shell.Application
$bitrateAttribute = 0
$results = @()
# Find all mp3 files under the given directory
$mp3Files = Get-ChildItem $directory -recurse * -include *.mp3,*.m4a
foreach( $file in $mp3Files ) {
# Get a shell object to retrieve file metadata.
$directoryObject = $shellObject.NameSpace( $file.Directory.FullName )
$fileObject = $directoryObject.ParseName( $file.Name )

# Find the index of the bit rate attribute, if necessary.
for( $index = 5; -not $bitrateAttribute; ++$index ) {
$name = $directoryObject.GetDetailsOf( $directoryObject.Items, $index )
if( $name -eq 'Bit rate' ) { $bitrateAttribute = $index }
}

# Get the bit rate of the file.
$bitrateString = $directoryObject.GetDetailsOf( $fileObject, $bitrateAttribute )
if( $bitrateString -match 'd+' ) { [int]$bitrate = $matches[0] }
else { $bitrate = -1 }

# If the file has the desired bit rate, include it in the results.
if( $bitrate -lt $minimumBitrate ) {$results += $file }
}
$results | Out-File C:tempbadmusic.txt
}

Get-Mp3Files
OP Thrudge 31 Jul 2013
In reply to dissonance:
That works. You're a gent, sir, thank you very much
KevinD 31 Jul 2013
In reply to Tony Naylor:

np. The stack overflow script did most of the work (i did think about building from scratch but since powershell is not my thing figured stack overflow would have it covered it to a reasonably close match).
In reply to Blue Straggler:
> (In reply to stroppygob)
> [...]
>
> How can you convert to 320 from a source mp3 at less than 320? Or did you fail to read the OP properly?

Nope it was just my ignorance of the technicalities.
Removed User 31 Jul 2013
In reply to Tony Naylor: Check out MP3Tag, http://www.mp3tag.de/en/ which will enable you to list 'and edit' all you medta data. You should be able to filter by bitrate and then sort by album title.
OP Thrudge 31 Jul 2013
In reply to Removed User:
Cheers, I'll give that a look.
John1923 31 Jul 2013
In reply to Tony Naylor:

On Linux I type

find . -type f -name '*.mp3' | perl -n -e ' chomp $_; print "file "$_"n"' | sh > MusicQuality.csv

It will create a file called MusicQuality.csv which contains info about every mp3, including the bitrate. MusicQuality.csv can be opened with Open Office / Excel. The command took 30 sec to run through my 5000 mp3s.

The easiest way of running that command is to boot an ubuntu live cd, open a terminal, then navigate to the root of your music folder and run the command in the terminal.

Cygwin is a way of running linux commands on windows, but it is aimed at linux power users, so is a pain to set up.
John1923 31 Jul 2013
In reply to dissonance:

Wow, the equivalent BASH command is so much simpler!
 Milesy 31 Jul 2013
Much easier way on Windows.

Go into the directory/ies with all the files.
Select View > Details.
On the column headers at the top right click, and tick "Bit Rate" then you can just sort the directory ascending or descending.

If you are re ripping stuff then why not just do it in a lossless format? Lossy compression is on the way out.
In reply to Tony Naylor:

> I want all of them at 320k (please don't try to talk me out of this).

If you're going through the pain of re-ripping, for heaven's sake, re-rip to FLAC or some other lossless format. If you need lossy compressed formats for portable devices, then transcode them...



Oh, and MediaMonkey will make all of this easy...
KevinD 31 Jul 2013
In reply to John1923:
> (In reply to dissonance)
>
> Wow, the equivalent BASH command is so much simpler!

powershell is a tad verbose although may be simpler way of doing it. I aint sys admin so use it rarely and even then tend to resort to bat files since whilst i have access to powershell most of the people i am giving scripts to dont.
In reply to Milesy:

> On the column headers at the top right click, and tick "Bit Rate" then you can just sort the directory ascending or descending.

That was going to be my suggestion, but then I thought about how painful it would be to do it for a hierarchical CD collection; you'd have to step down into every album. Not fun, so the scripting solutions (or a decent media manager tool like MM) is the answer.

3000 MP3s? Pah! A piffling collection...
KevinD 31 Jul 2013
In reply to captain paranoia:

> That was going to be my suggestion, but then I thought about how painful it would be to do it for a hierarchical CD collection; you'd have to step down into every album.

actually thinking on it could do it this way.
Open up search against the top level music folder and chose * as the search term. This will then list all the files contained in it and its subfolders. Edit the view to include bitrate and sort by that.

New Topic
This topic has been archived, and won't accept reply postings.
Loading Notifications...