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

Finamp does not transcode when the song's bitrate is below the transcoding bitrate #269

Closed
rawkhopper opened this issue Jul 12, 2022 · 18 comments

Comments

@rawkhopper
Copy link

So, I already saw that OPUS is not suported on iOS but even with transcoding on the files will not play. I can play the file on my iPhone with Jellyfin app and with Web app on Firefox and Brave without transcoding. In Finamp the files will not play with or without transcoding.

The files I have are 192kbps. Does the bitrate on the transcoding section have to be below the encoded bitrate to work?

Is there any chance that the app will use another player, instead of Apple's built in one, so that OPUS will work? If not I am starting to think it would be best to just stick with the Jellyfin app.

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

Could you check your Jellyfin logs for any transcoding errors? Discussion on new players is happening here: #177

@rawkhopper
Copy link
Author

No errors seen.

I just switch the bitrate in the app to 160kbps and it worked. That doesn't seem like a very viable solution. I have to re-encode all my OPUS files to a higher bitrate than the bitrate I would like to listen to in order to try to avoid the artifacts generated by reencoding. If I do that I may as well switch the format so that I can use Finamp.

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

I'll do some testing then, my guess is that Finamp is giving some incompatible transcoding option. Just wondering, how are you running Jellyfin? (Docker, Debian, Windows etc)

@rawkhopper
Copy link
Author

I am using Docker on Ubuntu Server 22.04 LTS.

@rawkhopper
Copy link
Author

I just tried using FLAC and it direct plays even with transcoding turned on. This could suck up some bandwidth. Any idea what I might be doing wrong?

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

Is the file downloaded? I haven't heard any reports of that.

@rawkhopper
Copy link
Author

No, just uploaded it to the server.

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

How are you checking that the file is being direct played/transcoded?

@rawkhopper
Copy link
Author

The dashboard page on the server says it is compatible and direct playing.

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

I think I never really got that reporting working properly, you can check if a file is being direct played or transcoded via the test in the bottom left of the player screen.

image

@rawkhopper
Copy link
Author

Bottom left of app says streaming transcode. Which one is correct?

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

Finamp is correct. You can verify this by checking for a transcode log in your server's logs menu.

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

I think I've narrowed it down to this line: https://github.com/UnicornsOnLSD/finamp/blob/1ea614d9d55f7408ae14518351b055000d0c91d5/lib/services/music_player_background_task.dart#L532

The way Finamp tells Jellyfin to transcode is to set the max bitrate to the user settings. This works for FLACs, which are usually much higher than 320kbps, but for your OPUS music it doesn't. This also explains why it works when you drop the transcoding bitrate.

A bandaid solution to this would be to set the max bitrate to the slightly below the song's bitrate when it's lower than the setting, but then you could lose out on quality as 160kbps AAC isn't great.

As far as I know, this is the only way to enable transcoding with Jellyfin. I'll have a look to see if there's any other way, and if not, I may try adding an extra parameter to force transcoding at a specific bitrate.

@jmshrv jmshrv changed the title OPUS files do not seem to work with Finamp iOS Finamp does not transcode when the song's bitrate is below the transcoding bitrate Jul 12, 2022
@rawkhopper
Copy link
Author

Thanks for the help. I am sorting through trying to understand the logs. Does jellyfin store transcoded files? I see some transcode logs but they only seem to be once for each file. If I start the songs again no knew file is created. Or is it Finamp storing a cached version of the song?

@jmshrv
Copy link
Owner

jmshrv commented Jul 12, 2022

I'm pretty sure Jellyfin caches transcodes for a bit, Finamp doesn't cache songs yet.

@rawkhopper
Copy link
Author

Gotcha. Thanks!

@mishaturnbull
Copy link

mishaturnbull commented Nov 5, 2022

Hey there, seconding this issue on an iOS client and a Debian-based (non-docker) server instance. Reading through this issue and 177 it seems that there's no immediate golden fix-all -- but I did wonder about something else. I'm also pretty new to the world of quality audio, so forgive me if this is a dumb question - but is there some program I could run on the actual audio files server-side to basically bump up their bitrate? This would make Finamp think the song needs to be transcoded, and do so, regardless of what I started out with for audio bitrate.

EDIT: more food for thought.

The Jellyfin official 'app' can, in fact, play my OPUS files without hesitation (I say 'app', because I think it's really just a wrapper around the web interface). When I check the Jellyfin activity dashboard, it shows that the music is being transcoded to AAC. However, when I play the same file with Finamp and it is transcoded (via setting the bitrate slider in app all the way down), the server still reports no transcoding. See attached file for what the server says about the Jellyfin client -- I wonder if it'd be possible to detect what type of file it is, and if it's not supported on platform, report that to the server?
Screenshot from 2022-11-05 17-37-06

Thanks for all the work you've put into this!

@jmshrv
Copy link
Owner

jmshrv commented Feb 10, 2023

Fixed in 5316250

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

3 participants