this post was submitted on 02 Apr 2024
28 points (88.9% liked)

Asklemmy

45391 readers
1023 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy πŸ”

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_[email protected]~

founded 5 years ago
MODERATORS
 

i have a bunch of .m4a files in one folder, 1000s. can i automate their conversion somehow?

all 14 comments
sorted by: hot top controversial new old
[–] [email protected] 22 points 11 months ago* (last edited 11 months ago) (2 children)

No as both are lossy codecs you will always lose quality doing so. You can do it with ffmpeg.

parallel ffmpeg -i {} {.}.opus ::: *.m4a

You may want to tweak parameters for bitrate, etc. But this is not needed at all, as AAC had patents that are now expired.

If you get .flac, .wav or similar lossless music, you should encode that with opus. But lossy to lossy makes nearly no sense (apart from specific players not supporting them)

[–] [email protected] 5 points 11 months ago (1 children)

GNU Parallel works well for this kind of thing. A lot of audio stuff is single threaded, so unlike video transcoding running multiple conversions simultaneously is a useful thing to do. The command is simpler, too:

parallel ffmpeg -i {} {.}.opus ::: *.m4a
[–] [email protected] 3 points 11 months ago

Thanks, learning is always good, changed it

[–] [email protected] 3 points 11 months ago (2 children)

If you get .flac, .wav or similar lossless music, you ~~should~~ could encode that with opus.

Fixed.

Unless you have a strong stance against people storing lossless files of their music? But I don't think that's quite what you meant :)

[–] [email protected] 2 points 11 months ago* (last edited 11 months ago)

"If you get .flac, .wav or similar lossless music, you should encode that with opus."

I am looking forward to similarly useful discussions XD

[–] [email protected] 1 points 11 months ago

it's my music and i dont like proprietary formats

[–] [email protected] 11 points 11 months ago

Unless the m4a files are ALAC-encoded, you shouldn't do it. m4a files tend to hold AAC-encoded audio, which is a lossy format. Opus is also a lossy format, so you'll only lose sound quality, basically. You should only convert lossless to lossy.

[–] [email protected] 3 points 11 months ago* (last edited 11 months ago) (1 children)

You can use the find command to do the stuff other commenters have posted recursive

[–] [email protected] 3 points 11 months ago
[–] [email protected] 2 points 11 months ago (2 children)

What platform do you have to work with?

[–] [email protected] 9 points 11 months ago (1 children)

Disregard. The answer is 'no'. Opus is a lossy format, so there is no way to losslessly convert to it, regardless of the tools available to you.

[–] [email protected] 2 points 11 months ago
[–] [email protected] 1 points 11 months ago

Opus is lossy, so no. But they’re already stored in a lossy format, so you probably won’t notice a difference if you use the same bitrate.