finamp icon indicating copy to clipboard operation
finamp copied to clipboard

[Feature Request] Opus Transcoding

Open phip123 opened this issue 2 years ago • 4 comments
trafficstars

Hi, I have not found much to add a feature that enables server-side transcoding into Opus, actually only found this PR which wants to add support for Vorbis.

Is it somehow possible to enable Opus transcoding in the future or is it planned? In Symfonium it possible and works pretty flawless with Jellyfin.

Thanks!

phip123 avatar Apr 10 '23 16:04 phip123

It's something that I want to do, but there will be some requirements to get it working perfectly:

  • Being able to stream OPUS on both platforms - Apple only support OPUS in CAF containers because they like to be annoying. From my testing, you can't just throw CAF through the internet as it's being transcoded, which is what the linked PR does for Vorbis/OGG
  • DASH streaming - asking for the transcoded file directly causes issues with audio playback, namely causing seeking to be very inconsistent. Finamp currently uses HLS for transcoding, which works on both platforms and is supported by Jellyfin. The downside of this is that HLS only supports AAC (and MP3, but that's irrelevant since we can just use AAC). Fro, what I've read, DASH should allow us to stream any codec, including OPUS. DASH is not supported on the Jellyfin server, so that'd be something that I'd have to add there.
  • Player backend rewrite - to solve the lack of support on iOS, I want to switch to something like MPV for the player backend. This should solve every issue around playback in Finamp, since MPV is awesome compared to the OS libraries. That's being tracked at #177.

I've been messing around with transcoded downloads at #215, which has fixed bugs in Jellyfin related to transcoding different formats. In theory, I could add an option to transcode OPUS on Android once the next release of Jellyfin comes out, which is kind of what the linked PR wanted to do.

jmshrv avatar Apr 10 '23 17:04 jmshrv

Thanks for the quick reponse and exhaustive explanation!

I hope that this will the fixes will be released sooner than later to pave the way for Opus.

phip123 avatar Apr 10 '23 18:04 phip123

Hopefully this issue isn't lost to time. I was wondering why I could download but not stream these alternate formats. The obvious solution is if iOS doesn't want you to stream Ogg or Opus then disable those features in iOS releases. There should not be any reason to hold one platform back because of an arbitrary rule on another.

texneus avatar Jun 15 '24 20:06 texneus

Downloading transcoded stuff doesn't depend on DASH streaming, although based on discussion in #151, it may not actually be required. It'll be Android (+ Linux, probably Windows?) only, but it's something that could be looked into

jmshrv avatar Jun 22 '24 20:06 jmshrv

@jmshrv newer versions of iOS should support stereo opus in mp4 containers, and also works over HLS. I tried it yesterday using a modified version of finamp in Xcode simulator and it did play just fine.

felix920506 avatar Mar 27 '25 19:03 felix920506

@felix920506 that's great news! If you have working code, would you mind opening a PR? :)

Chaphasilor avatar Mar 27 '25 20:03 Chaphasilor

@Chaphasilor idk how I should implement it since I have basically 0 experience with flutter (or mobile app development in general) but I did post my work in the #general-discussion channel in the Finamp discord.

If anyone wants to guide me through how I would implement it properly or take it up I'd be happy to participate.

felix920506 avatar Mar 27 '25 20:03 felix920506

Added in beta update 0.9.16!

Chaphasilor avatar Apr 23 '25 06:04 Chaphasilor