• I_like_cats
    link
    fedilink
    arrow-up
    22
    ·
    1 year ago

    Opus is the best. Anyone still using mp3s in 2023 is living in the past. Some users can still hear a difference between 256kbit/s mp3 audio and uncompressed audio while Opus reaches transparency at about 120kbit/s.

    In the realm of compression transparency is when the compressed medium is indistinguishable from the source audio by a human

    • etuomaala@sopuli.xyz
      link
      fedilink
      arrow-up
      5
      ·
      1 year ago

      That and you can just download opus from youtube using yt-dlp lol. It’s 100% great. Anybody transcoding youtube audio to mp3 is definitely doing it wrong lol

      • Willer@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Thats why most of my yotuube downloads is .mka I found that matroska has better support than webm or ogg lol

        • etuomaala@sopuli.xyz
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago
          I download opus .webm s,
              then use ffmpeg to convert to .opus,
              which I'm pretty sure is just ogg.
          IDK, works great in quodlibet.
          .webm can't be tagged, though.
          Tagging is critical, especially replay_gain tags.
          
          Here is my script:
          #!/usr/bin/env python
          
          # Youtube actually hosts audio-only opus tracks, but you can only get them
          # in the webm container, which many music players, including quodlibet, don't
          # know what to do with. This script downloads the track, then converts it with
          # zero loss to the opus container using ffmpeg's `-acodec copy` feature.
          
          import sys
          from subprocess import call
          from os.path import splitext
          from os import remove, walk, listdir
          from tempfile import TemporaryDirectory
          from shutil import move
          
          urls = sys.argv[1:]
          
          with TemporaryDirectory(prefix='yta-') as tempdir:
              # Do not raise exceptions, because yt-dlp counts failure of a single
              # download in the list as an overall failure, exit code wise.
              call(['env', '-C', tempdir, 'yt-dlp', '-if', 'bestaudio',
                  '-o', '%(artist)s - %(title)s - %(id)s.%(ext)s', '--'] + urls)
          
              for tempdir, dirs, files in walk(tempdir):
                  for fn in files:
                      path = tempdir+'/'+fn
                      name, ext = splitext(path)
                      if ext == '.webm':
                          if call([
                              'ffmpeg', '-hide_banner',
                              '-i', path,
                              '-acodec', 'copy',
                              name+'.opus'
                          ]) == 0:
                              remove(path)
          
              for node in listdir(tempdir):
                  move(tempdir+'/'+node, '.')
          
          
    • headmetwall@lemmy.dbzer0.com
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Huh, I was wondering why that was becoming the default everywhare. Time to Re-encode my library so I can carry more of it on my pocket computer. Tech is awesome.

      • Willer@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        Under 100 kbps it sounds significantly better. I have decided that i dont want to choose on the least shitty lossy option tho, when i can have flac.