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

Download transcoded files #215

Closed
endervad opened this issue Apr 12, 2022 · 14 comments
Closed

Download transcoded files #215

endervad opened this issue Apr 12, 2022 · 14 comments
Labels
redesign-beta Issues related to the beta/redsigned version of Finamp

Comments

@endervad
Copy link

I see that this feature was mentioned to be added in the future if possible in 0.3.0 changelog but I still wanted to highlight as an issue since it turned out to be a dealbreaker for me. Feel free to delete this issue if it's already on roadmap :)
My library consists of very fat FLACs where some of the albums take up to 9Gb. While I have enough space on my phone for songs that I might want to have at the moment (not everyone would), sometimes I want to download some more on the road.

@axelsimon
Copy link

Related to #213.

@jeremyswright
Copy link

I have the same request. Over the last few years I've been buying fat FLACs but I don't really want them on my phone which means I can download some albums but not others, and even the 320kbps MP3s are a bit bulky really. (My phone's a reliable old clunker.) Transcoding downloads would be the ideal solution.

I've read the notes on issue 213. If there's anything I can do to help, please let me know.

@jmshrv
Copy link
Owner

jmshrv commented Feb 9, 2023

I've been working on this, and have a pretty good first implementation. On Android, files are downloaded with OPUS, on iOS it's a bit messier:

The main issue I've run into here are some bugs in Jellyfin's audio transcoding. Basically, most file formats won't be correctly sent by Jellyfin as when transcoding, ffmpeg (the underlying tool used for transcoding) "goes back" to write header data that is required to play the files. For some formats, there are flags that you can give to fix this behaviour. I have submitted fixes to Jellyfin for M4A/AAC files: jellyfin/jellyfin#9249

There was also an issue where specifying a codec didn't actually apply, which I fixed at jellyfin/jellyfin#9192

Luckily, both of these issues are irrelevant for Android, since OGG doesn't have any weird header stuff (as noted in #151), and .opus is a valid file name extension, so we can still ask Jellyfin for an OPUS encoded OGG file (I think ffmpeg defaults to Vorbis for OGG).

On iOS, those two fixes will be required for transcoding to M4A/AAC. M4A/AAC is fine, but there's one last fix I want to make to get CAF/OPUS working. CAF is Apple's own container that can carry OPUS - they don't support OGG/OPUS like everyone else. This will need my audio codec fix, as CAF defaults to PCM with ffmpeg. The fix is basically "add an option to wait for ffmpeg to end", which hopefully shouldn't be too hard to add.

Depending on how long it takes to get these fixes released by Jellyfin, I may release transcoded downloads for Android first, and iOS later (maybe as a hidden switch - I doubt many people want to start compiling their own Jellyfin and I don't want to encourage people to brick their servers by running unstable software).

Anyway, here's a screenshot :)

Screenshot showing the new transcoded download options

TL;DR: It's basically done, I'm just cleaning it up a bit and waiting on some required Jellyfin fixes to be put in a release

@axelsimon
Copy link

This looks very cool, thanks @jmshrv both for the work and the explanation!

@jmshrv
Copy link
Owner

jmshrv commented Apr 24, 2023

That release didn't include my changes, they'll be in 10.9:

Screenshot of message from Anthony Lavado: New Feature? Next "major" release. After a main tag goes out, only fixes go to that tag. So your PR would be 10.9

I could release the current implementation for Android since that can play .opus files, which aren't affected by the fixed issues.

My number one priority right now is the new download implementation (#213), as the current implementation is very janky.

@Chaphasilor
Copy link
Collaborator

We have a new downloading system currently being finalized, once that is done we can probably add the transcoded downloads on top. There is a draft PR for trancoded downloads using the old system which is almost done, so it hopefully shouldn't be too much work.

But it will be part of the redesign beta for now, not part of the stable version.

@Chaphasilor
Copy link
Collaborator

It's currently soon™, but it should be ready by the end of this month if all goes well. The downloads rewrite and Android Auto PRs need to be merged in first, and then we can submit to Google Play and Testflight for review :)

@Chaphasilor
Copy link
Collaborator

Update: Seems like @Komodo5197 overheard our conversation, because they just added support for transcoded downloads in their PR a few hours ago! Already tested it and it's working well on Android :)
It will still be part of the beta, but from the start.

@Chaphasilor
Copy link
Collaborator

@TheGloriousDuck you can downloaded the preliminary APK from here: https://gofile.io/d/dcsOfb

You'll have to uninstall the old version first, since this new APK is signed by me instead of James, and Android will (rightfully) complain about it.

@Chaphasilor
Copy link
Collaborator

This has been part of the beta for a few weeks now and seems to be working well. You should use the beta if you want this feature.

@Chaphasilor Chaphasilor added the redesign-beta Issues related to the beta/redsigned version of Finamp label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
redesign-beta Issues related to the beta/redsigned version of Finamp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@axelsimon @jeremyswright @endervad @Chaphasilor @jmshrv and others