19
submitted 1 year ago* (last edited 1 year ago) by hellfire103@sopuli.xyz to c/foss@beehaw.org

I have a fairly large music collection, which is 9.9 GB in size. It's mainly made up of MP3 files, with some OGG Vorbis files and a handful of WAV and WMA files. I would like to convert the entire library to AAC (or a better format, if there is one) in order to reduce the size of my collection by a considerable amount.

My library is organised using this folder structure:

~/Music/{Artist}/{Album}/{Track}

Can anyone recommend a GUI tool or shellscript which would recursively convert the files, map across the metadata, and dump the files into a different folder with the same directory structure?

EDIT: I have used a script to convert everything to Opus. Problem solved, just working out the kinks now.

top 18 comments
sorted by: hot top controversial new old
[-] aleph@lemm.ee 34 points 1 year ago* (last edited 1 year ago)

Converting from one lossy codec another isn't generally recommended, plus you aren't likely to save that much disk space by converting to AAC.

10 GB is actually pretty small for a local music collection, quite honestly. If I were you, I would try to expand your storage capacity instead of wasting time, and potentially audio quality, by transcoding.

[-] hellfire103@sopuli.xyz 2 points 1 year ago

I have an iPhone. The storage I have is all I've got.

[-] nx2@feddit.de 7 points 1 year ago* (last edited 1 year ago)
  1. Don't buy iPhone

  2. You need ffmpeg

  3. Read this for the exact command

  4. You can use the find command (in console) to list all mp3 files, these you can pipe into ffmpeg.

Just ask ChatGPT to write the shell script for you

[-] hellfire103@sopuli.xyz 4 points 1 year ago

Already did that. Thanks though.

By the way, owning an iPhone is not my choice. I'm 17 and still living with my parents, and my dad is a huge Apple fanboy. Ideally, I'd have either a Pixel with DivestOS, an Xperia with SailfishOS, a PinePhone with PostMarketOS, or an old Nokia 3210; but for now I'm stuck with my second hand iPhone SE.

[-] ericskiff@beehaw.org 6 points 1 year ago

You could consider running a plex server and using Plexamp to stream from that to your phone. It’s free as of a few days ago!

[-] aleph@lemm.ee 4 points 1 year ago* (last edited 1 year ago)

If I were you, I would stick to streaming in that case.

However, if you're dead set on storing files locally and there's no other option but to transcode, then use 128kbps Opus instead of AAC - assuming that iPhones support it (I haven't checked). It's a lot more efficient.

A good converter program to use is fre:ac but don't ask me for an iOS only app because I'm not an Apple guy at all.

[-] mondul@beehaw.org 3 points 1 year ago

Doesn’t support it directly, I can’t add opus files to the iTunes library, so I had to use VLC for them, but it’s not designed to be a music player for the iPhone and the music stops after playing a couple of songs with the screen off

[-] hellfire103@sopuli.xyz 1 points 1 year ago* (last edited 1 year ago)

The app I'm using on my iPhone (foobar2000) supports OGG Opus. ~However, decoding takes about a second, resulting in a noticeable gap between songs.~

EDIT: It seems that HydrogenAudio have fixed the Opus decoding in foobar2000 Mobile.

[-] words_number@programming.dev 8 points 1 year ago* (last edited 1 year ago)

Edit: I agree with other commenters, that it's a bad idea to convert from one lossy codec to another one! If you want to do it anyway (and your files are at least encoded with high bitrates >192k), I'd recommend this:

The best lossy audio codec by far is opus (best perceived quality vs. small file size), which also has the benefit that it's free and has got a great open source reference implementation that is also integrated in ffmpeg. So the conversion can be done with ffmpeg. I would personally use fd-find for multithreaded batch processing (using the -x option).

[-] Hubbelblubbel@kbin.social 7 points 1 year ago

If possible, only convert the wav files to AAC and keep all lossy files as they are.

[-] xoggy@programming.dev 5 points 1 year ago

On Windows, nothing beats foobar for playback, tagging, and conversion support. I use Deadbeef which is like the Foobar of Linux. It has a similar user interface and a playlist format conversion tool as well. VLC also converted audio if I remember correctly?

[-] sin_free_for_00_days@lemmy.one 3 points 1 year ago

That would be a pretty basic bash script, but as others have said, really not recommended.

[-] twistedtxb@lemmy.ca 2 points 1 year ago* (last edited 1 year ago)

Don't do it, but if you decide to do it anyway, use DbPoweramp

[-] aperson@beehaw.org 2 points 1 year ago

Oh man, that's a name I haven't heard since I was a teenager. Spoon admin'd a forum I was a part of back then.

[-] vhstape@beehaw.org 2 points 1 year ago

If you are a Mac users (which I am assuming yes based on your preference toward AAC), the program Pine Player does an excellent job with batch conversion. Otherwise FFMPEG is probably acceptable as well.

[-] hellfire103@sopuli.xyz 2 points 1 year ago

Thanks, but I'm an openSUSE user. I was considering AAC because of a recommendation from MakeUseOf or some other tech news website.

[-] Skyline@lemmy.cafe 2 points 1 year ago

If you have access to a Mac, use the Apple AAC encoder. It will give you better results than libfdk_aac, which itself is much better than the ffmpeg built-in aac encoder.

[-] skycat@beehaw.org 1 points 1 year ago* (last edited 1 year ago)

You can use ffmpeg command line with some loop (for) tricks. If you want to save some space without re converting them, use .flac or .mka container with -copy flags

load more comments
view more: next ›
this post was submitted on 25 Jul 2023
19 points (100.0% liked)

Free and Open Source Software

17550 readers
23 users here now

If it's free and open source and it's also software, it can be discussed here. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS