jellyfin / jellyfin-android

Android Client for Jellyfin
https://jellyfin.org
GNU General Public License v2.0
1.47k stars 244 forks source link

Bitrate limits in client settings are ignored by ExoPlayer #564

Open Elaws opened 2 years ago

Elaws commented 2 years ago

Describe the bug

  1. Set Internet streaming limit to 1 Mbs (either through Dashboard > Users, or Playback > Streaming, or through quality settings of client, or both).
  2. Jellyfin should transcode if video stream exceeds 1 Mbps.
  3. Jellyfin does not transcode, and direcplays the video. Thus, video is constantly stuttering.

Logs

No response

Application version

2.4.0

Where did you install the app from?

Google Play

Device information

Samsung Galaxy S20FE 5G

Android version

Android 11

Jellyfin server version

10.7.7

Which video player implementations does this bug apply to?

Elaws commented 2 years ago

Well, it seems the problem happens only with ExoPlayer, not with web player.

For unknown reasons, any internet speed limit or quality settings that you can set in the app is absolutely not at all taken into account when using ExoPlayer. No transcoding occurs when you set limits.

Maxr1998 commented 2 years ago

Yes, known issue, I mentioned it the other day in #563. The tracking issue for this is also #24 (in addition to user-selectable bitrate limits), some work has already been done on #535.

naimo commented 2 years ago

By the way, the exoplayer (and I believe the external player option as well, with VLC for example) also ignores the server "Internet streaming bitrate limit" If that helps

galmok commented 1 year ago

This issue is still a problem and it is exacerbated by the fact the the web player doesn't work (freeze frame unless constantly touched). As such, there exists no player on Android with bitrate limiting (transcoding) applied.

Elaws commented 1 year ago

I can confirm that the issue is still happening. Has there been any progress concerning this issue reported 17 months ago ?

extrange commented 1 year ago

This is still happening with Jellyfin on Android, with both the integrated player and external player (VLC).

Maxr1998 commented 1 year ago

ExoPlayer now supports manually applied bitrate limits through the quality selector. The user provided limits will be supported in the future.

shaino commented 1 year ago

Actually, it's not difficult. in app/src/main/java/org/jellyfin/mobile/player/interaction/playoptions.kt line 134,add code... for example: viewModal.changeBitrate(6000000)

But To be precise, it is necessary to obtain locally set parameters to assist.

shaino commented 1 year ago

If the developer has not yet completed it, they can use it urgently: step 1 In file: app/src/main/java/org/jellyfin/mobile/player/ui/PlayerFragment.kt add code in fun onCreate(savedInstanceState: Bundle?) line 135 var currentExoBitrate:Int = 4000000 val cachPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath val fileName = cachPath + File.separator + "jellyexoplayer.rate" val cfgFile = File(fileName) if(cfgFile.exists()){ val rateStrin = File(fileName).readText() currentExoBitrate = rateStrin.toInt() } if(currentExoBitrate > 120000000 || currentExoBitrate < 0) { currentExoBitrate = 0 } viewModel.changeBitrate(currentExoBitrate)

step 2 in file: app/src/main/java/org/jellyfin/mobile/player/playerViewModel.kt add code in fun chageBitrate(bitrate: Int?): Boolean line 444 val cachPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).absolutePath val fileName = cachPath + File.separator + "jellyexoplayer.rate" val cfgFile = File(fileName) File(fileName).writeText(bitrate.toString()) Note: Add before the following line return queueManager.changBitrate(bitrate)

Of course, both kt files need to be added to import import java.io.File import android.os.Environment

Wishing everyone a pleasant day

nielsvanvelzen commented 1 year ago

Feel free to open a pull request

J3m5 commented 10 months ago

Are there any updates on this issue?

Maxr1998 commented 10 months ago

Unfortunately not. I'm still in the middle of the player UI rewrite without much progress recently since I have been pretty busy.