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

  • rollingflower@lemmy.kde.social
    link
    fedilink
    arrow-up
    22
    ·
    edit-2
    8 months ago

    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)

    • zurohki@aussie.zone
      link
      fedilink
      English
      arrow-up
      5
      ·
      8 months ago

      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
      
    • Otherbarry@lemmy.zip
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 months ago

      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 :)

  • M. Orange@beehaw.org
    link
    fedilink
    arrow-up
    11
    ·
    8 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.

  • hperrin@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 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.