Git Product home page Git Product logo

Comments (14)

 avatar commented on August 15, 2024 1

I suggest to comment on or try to get these PRs merged: https://android-review.googlesource.com/q/owner:aykevanlaethem%2540gmail.com

If enough people make comments on the issue they will be forced sooner or later to merge it, they're ignoring it because they don't really care that much and most people don't even know what Opus is, hence they get currently away with it. It's such a small issue and the PR is already open almost a year, that says a lot about the state of Google.

from shuttle.

 avatar commented on August 15, 2024

I use x-opus+ogg files for my library. Rhythmbox sync works around this issue by naming all copied files .ogg, but they're not reencoded so treating them as ogg should work fine.

from shuttle.

 avatar commented on August 15, 2024

Since the PR doesn't seem to work as intended, here might be some more info:

https://code.google.com/p/android/issues/detail?id=80729

from shuttle.

Daykod avatar Daykod commented on August 15, 2024

I think this might have to be part of the plans @timusus makes for weaning off MediaStore as he mentioned in the readme.

from shuttle.

timusus avatar timusus commented on August 15, 2024

As far as I know, the Android platform has supported the codec since 5.0.

No, Opus files are not yet supported. Google claimed to add support in Lollipop. They made some very minor changes, but AFAIK, they never actually added support - the MediaScanner doesn't add Opus to the MediaStore and the MediaPlayer doesn't play Opus.

from shuttle.

bobobo1618 avatar bobobo1618 commented on August 15, 2024

I actually managed to get Opus working.

Device: Google Pixel, running Android 7.1.1

Files: The result of running ffmpeg -i <input> -c:a libopus -b:a 192k -vn -y <output>.opus.ogg

I found however that ffmpeg, which I suspect most people are using, by default transcodes the album art as a Theora video stream. When album art is present, the file fails to play, when the album art is omitted (the -vn argument), the album is added to MediaStore and Shuttle is able to read its metadata and play it (and Shuttle also somehow gets album art?).

from shuttle.

timusus avatar timusus commented on August 15, 2024

While I find this interesting, none of it is relevant to Shuttle's ability to play Opus files. Either Google actually add support for Opus via the MediaScanner, MediaStore and MediaPlayer, or Shuttle replaces these with custom/3rd party components.

from shuttle.

bobobo1618 avatar bobobo1618 commented on August 15, 2024

What I'm saying is that Shuttle is currently able to play Opus files. Google has added support for Opus via the MediaScanner, MediaStore and MediaPlayer.

I currently have ~3000 Opus files on my phone, running stock Android. Shuttle has added them all to its internal library and I'm able to view and play them inside Shuttle, as if they were any other format.

from shuttle.

bobobo1618 avatar bobobo1618 commented on August 15, 2024

It appears that support for Opus in an Ogg container was added specifically in Android 7.0:

  • CDD for 6.0 only requires that Opus be supported in a Matroska container.
  • CDD for 7.0 requires that Opus be supported in both Ogg and Matroska containers.

from shuttle.

timusus avatar timusus commented on August 15, 2024

@bobobo1618 right, well that is good to know.

As far as this issue is concerned though - Shuttle supports Opus only as far as Android does, which is in a very limited fashion at the moment. Very savvy users might be able to encode their files using the appropriate container.

The only solutions I know of to fully support Opus are:

  • Android adds support natively
  • Shuttle moves to a 3rd party playback engine.

from shuttle.

faho avatar faho commented on August 15, 2024

@Daykm: Can you try renaming your files to "*.ogg"? That worked for me, no reencoding necessary.

from shuttle.

bobobo1618 avatar bobobo1618 commented on August 15, 2024

Very savvy users might be able to encode their files using the appropriate container.

As far as I'm aware, Ogg is the only appropriate container. It's the container used by ffmpeg and opusenc when the .opus file extension is selected as well as the one that there's a spec for. There shouldn't be an encoder that outputs it as anything else (unless you're encoding video) so there shouldn't be any particularly hard work other than to make sure there's not a video stream (from embedded album art) and using the .ogg extension.

I actually did some more testing and it seems that Android's fine with there being a video stream in some circumstances.

So the problems remaining as far as I'm aware are:

  • Support Opus on Android < 7.0.
  • Support Opus files with the .opus file extension.
  • Support Opus files with album art erroneously transcoded as a video stream (the Ogg spec has provisions for album art as metadata), though I'd really treat this as as a problem with the encoder rather than the player. I'm still not certain what exactly causes it to fail in some cases.

The first certainly requires a 3rd party playback engine but I'm curious whether there's a way to hack around the second by writing your own scanner (and keeping Android's playback API) and the last by perhaps remuxing before sending to Android's playback API.

This is a lot of effort just to keep Android's playback API but I believe some devices, particularly on the lower end, have hardware audio decoders and I fear switching to software decode may negatively impact them.

from shuttle.

ethanrjones97 avatar ethanrjones97 commented on August 15, 2024

I'm using a Pixel 3 with Android 9 (so way past the 6.0/7.0 minimum) and I think I ran into a regression in Shuttle, but maybe more likely - MediaStore.
Currently Shuffle fails to import my library at all (mostly ogg opus made with opusenc --bitrate 96 --discard-pictures $INPUT $OUTPUT.ogg but there is a couple MP3s in there as well.)
screenshot_20181209-075450
As you can see the files are all "null" (ignore the playing song for a second)
Interacting with them does nothing and forcing a rescan doesn't seem to work.
I've tested in VLC (i.e. not using MediaStore AFAIK) and it plays the files fine. (albeit it doesn't like my preference for Album_Artist vs. Artist)
screenshot_20181209-075729
I also tested in Phonograph which also uses MediaStore and has this bug (not adding the files to the database), but it's file viewer does not display them as "null".
screenshot_20181209-075809
If I select "scan" from the overflow menu, it actually gets added to the database allowing me to play the file in Phonograph and Shuffle - as shown in the first screenshot
screenshot_20181209-075830
Does anyone else have this strange bug?

I'd also just like to point out the fact MediaStore (No fault of Shuttle, Phonograph, etc.) still has these strange bugs is really annoying

from shuttle.

opusforlife2 avatar opusforlife2 commented on August 15, 2024

@timusus Has Android 10 improved in this regard?

from shuttle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.