Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opus/Vorbis/OGG doesn't work on iOS (+ discussion on new player backends) #177

Open
Ember-ruby opened this issue Jan 15, 2022 · 38 comments
Open

Comments

@Ember-ruby
Copy link

iphone 8, ios 13

@Maxplosion
Copy link

logs from finamp?
does it work in on other clients and if yes which?
jellyfin server logs?
are you transcoding?
see a pattern here...?

@Ember-ruby
Copy link
Author

Finamp logs: https://paste.gg/p/anonymous/c238f1a4142447909d5abae177e9166e
Finamp audio logs: https://paste.gg/p/anonymous/4ab3e8c877bb41bdbcdb6dd737de7c0e
Jellyfin logs: https://paste.gg/p/anonymous/3c221e7311fe4066a5346fe36e81b27a

It works on Jellyfin web client and ios client, i don't have and android phone to try Finamp on

not transcoding, audio plays if i turn it on

@jmshrv
Copy link
Owner

jmshrv commented Jan 15, 2022

What codec is your audio? OPUS and Vorbis aren't supported yet on iOS as iOS doesn't natively support those formats (it's dumb I know)

@MikePadge
Copy link

@UnicornsOnLSD thanks for your work on this app, I love it

I'm not super familiar with Flutter, but this might be a solution
https://github.com/EPNW/opus_flutter/tree/master/opus_flutter

@jmshrv
Copy link
Owner

jmshrv commented May 1, 2022

That's a really interesting looking package, I'll do some testing with it :)

@Ember-ruby
Copy link
Author

What codec is your audio? OPUS and Vorbis aren't supported yet on iOS as iOS doesn't natively support those formats (it's dumb I know)

Not even transcoding it?? Also I’m kinda having this issue again, but now it only shows songs I’ve hearted on jellyfin web/iOS app, and yeah nothing opus is playing, annoying given that the vast majority of my music is opus

@jmshrv
Copy link
Owner

jmshrv commented May 30, 2022

Transcoding should work since Jellyfin will then serve it as AAC, which is supported. As I said, this is an iOS issue so it isn't likely to get fixed in the future. I believe the libopus package that was sent here was for when you want to encode Opus audio in your app, so it won't be useful here.

As for only showing favourite content, you can disable the favourite view by clicking on the star in the top right.

@jmshrv jmshrv changed the title Music is playing but there is no audio Opus/Vorbis/OGG doesn't work on iOS Jun 6, 2022
@jmshrv
Copy link
Owner

jmshrv commented Jul 5, 2022

Just noting here a comment I left on a duplicate issue - #236 (comment)

As said there, it would be interesting to see if it would be possible to use just_audio_mpv. In theory it should be possible, but there has been a lot of discussion in just_audio regarding whether or not bundling MPV in apps is legal. I'd assume that the MPV guys aren't too bothered based on mpv-android

The developer of just_audio gave a very good explanation on why MPV may not be possible in this comment - ryanheise/just_audio#178 (comment)

@proline
Copy link

proline commented Jul 5, 2022

Apparently you can implement this by yourself I don't know it is complicated.
http://iosdeveloperzone.com/2012/08/07/precompiled-ogg-vorbis-libraries-for-ios/
The post is a little bit old. It could be a solution but if I understand you need to implement your own player.

@jmshrv
Copy link
Owner

jmshrv commented Jul 5, 2022

Yeah the libraries would only let me encode/decode those files directly, you can't plug them into Apple's player.

@fuomag9
Copy link

fuomag9 commented Mar 14, 2023

Maybe https://github.com/leinelissen/jellyfin-audio-player can be used for how to implement this? It's MIT and they have implemented opus playback

@jmshrv
Copy link
Owner

jmshrv commented Mar 14, 2023

On iOS? It looks like they have the same issue - leinelissen/jellyfin-audio-player#97

I've looked further into MPV, it'll probably be possible as it's LGPL2 (some bits are GPL only but we can safely ignore them). The concerns around legality come from GPL3's Tivoization-prevention stuff.

@fuomag9
Copy link

fuomag9 commented Mar 14, 2023

On iOS? It looks like they have the same issue - leinelissen/jellyfin-audio-player#97

I've looked further into MPV, it'll probably be possible as it's LGPL2 (some bits are GPL only but we can safely ignore them). The concerns around legality come from GPL3's Tivoization-prevention stuff.

In my case I can successfully play opus files (maybe it's transcoding?)
With finamp I couldn't even with transcoding enabled in the app

@jmshrv
Copy link
Owner

jmshrv commented Mar 15, 2023

With finamp I couldn't even with transcoding enabled in the app

You're probably running into #269, which was fixed a while ago (but causes more issues in the form of #414 lol). It's not in a release yet thankfully.

@fuomag9
Copy link

fuomag9 commented Mar 15, 2023

With finamp I couldn't even with transcoding enabled in the app

You're probably running into #269, which was fixed a while ago (but causes more issues in the form of #414 lol). It's not in a release yet thankfully.

Is that fixed in the AppStore version? I tried again but still couldn’t play music :(

@jmshrv
Copy link
Owner

jmshrv commented Mar 15, 2023

It's not out yet, hopefully it will be soon. As I said, it breaks direct play at the moment so its probably a good thing that I was slow to publish it lol

@Chaphasilor
Copy link
Collaborator

@fuomag9 it should be out now. You can also try out the beta version which has support for transcoded downloads! :)

@gummykage
Copy link

gummykage commented Jun 14, 2024

Is it normal for OGG files to crackle and skip a bit while transcoding is on?

@Chaphasilor
Copy link
Collaborator

I honestly don't know, but probably not. I guess this is on iOS? Does it also happen if you download them as a transcoded version?

@felix920506
Copy link

@gummykage I noticed the same issue and reported in #600

@willisplummer
Copy link

I'm running into this issue as well on ios

@felix920506
Copy link

felix920506 commented Dec 14, 2024

Idk if anyone has tried this, but I got finamp to direct play opus on macos, installed as an ios app
I am on macos14.5 running finamp beta from testflight.

Update:
Just to be sure, I tried with an actual iOS client, in this case iOS 18.1.1 and it is direct playing without issues

I was told by someone that this is limited to mono or stereo audio, but I have not verified this myself.

Steps are as follows:

  1. If you already have the audio in opus codec, remux them to mp4 containers:
    ffmpeg -i something.opus -vn -c:a copy something.mp4
    Or from webm container: ffmpeg -i something.webm -vn -c:a copy something.mp4

Alternatively, you can transcode other codecs to opus if desired, not recommended if source is lossy:
ffmpeg -i something.flac -vn -c:a libopus something.mp4

  1. Rename the file to have .m4a extension. For example, something.mp4 -> something.m4a. Straight rename is enough, no need to remux/transcode.

  2. Place the resulting .m4a files on Jellyfin and rescan

  3. Profit

@jmshrv jmshrv mentioned this issue Dec 30, 2024
@sortedcord
Copy link

sortedcord commented Jan 22, 2025

What codec is your audio? OPUS and Vorbis aren't supported yet on iOS as iOS doesn't natively support those formats (it's dumb I know)

Hi there, I apologize if this is dumb but how come the Jellyfin iOS client can direct play Vorbis while finamp cannot? If this is a iOS compatibility issue then it shouldn't work for the official client and other streaming services as well (spotify uses VORBIS). I suppose I'm missing something, but I would be very grateful if I can get come clarity on this..

(Using iphone 8, ios 16)

@felix920506
Copy link

@sortedcord It is not direct playing Vorbis. The server is transcoding it to something else.

@Chaphasilor
Copy link
Collaborator

@felix920506 only just saw your comment, so essentially iOS/macOS can play OPUS as long as it's in a m4a container?

@felix920506
Copy link

@Chaphasilor As long as it's in mp4/m4a and stereo/mono above I think 17.4(not sure) and .caf on some older versions

@Chaphasilor
Copy link
Collaborator

Neat. I guess then we could use some sort of "direct streaming", letting the server repackage to m4a on the fly? Telling everyone to manually repackage their entire library doesn't seem like a great solution, and audiophiles tend to hate transcoding...

@willisplummer
Copy link

Using the beta, I enabled transcoding (Settings > Transcoding > Enable Transcoding). I also enabled it for downloads. Everything plays for me (though occasionally there is a long lag before a song starts - presumably because the server is underpowered). I don't think this issue needs to remain open, but I do think that the error messaging when a song can't be played because transcoding is disabled and it's an unsupported format could be improved. In the beta, I got an error but I think it was the generic "Could not play this track" or something to that effect

@Chaphasilor
Copy link
Collaborator

@willisplummer yeah, it is possible to play (and download) almost everything through transcoding. Before closing this issue I'd like to offer some sort of automatic transcoding, that transcodes (or repackages, if sufficient) the audio automatically if its in an unsupported format (or has a high bitrate). That feature is long overdue.

@felix920506
Copy link

@Chaphasilor by that point we are probably better of switching to the UniversalAudio endpoint on the server side since it automatically handles whether to direct play, remux or transcode when provided a list of supported codecs and containers.

@sortedcord
Copy link

sortedcord commented Jan 22, 2025

@felix920506 do you have any suggestions as to what I should do? My library is predominantly OGG vorbis, if there is anything I can do apart from just re-encoding them to aac then that would be a life saver...

@Chaphasilor
Copy link
Collaborator

@felix920506 yeah that's definitely one valid approach. If there aren't any unforseen issues with that endpoint I see no reason why we wouldn't support it. We just haven't implemented it yet.

@felix920506
Copy link

@sortedcord turn on transcoding on your phone and forget about it. Let the server transcode to aac on the fly when you play.

@sortedcord
Copy link

@felix920506 I have a few playlists that contain both ogg vorbis and flac files. When I download them (without transcoding) the ogg tracks also get downloaded so some of the tracks are not playable anymore and I don't want to transcode my flacs. Is it possible to make it so that it forces transcoding for ogg tracks when they are downloaded?

@felix920506
Copy link

@sortedcord i think downloads are always transcodes

@sortedcord
Copy link

@sortedcord i think downloads are always transcodes

Apparently not, we have the option to choose to download the original files or the transcoded aac files.

@Chaphasilor
Copy link
Collaborator

@sortedcord it's currently not possible. You could download the OGG files one-by-one (using the track menu / long-pressing), and then afterwards download the entire playlist without transcoding. That should achieve your result.
Or do it the other way around, download playlist transcoded first, and then use the "Always keep on device" options for all FLAC tracks, and choose untranscoded download.

@sortedcord
Copy link

I suppose that could work out, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests