jellyfin-archive / jellyfin-android-original

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

No transcoding - HEVC - video not playing. #228

Open wrong1man opened 4 years ago

wrong1man commented 4 years ago

Edit: for clarity i really do not want to use transcoding. and have turned it off in the user settings.

The local device is a oneplus 6T running whichever latest android version that runs. It can decode h265 just fine. h265 files play fine when stored locally on the device or when streamed via KODI connected to the (same) server via FTP/SFTP. edit2: files also play via plex with no transcoding (and yes i am sure)

Server System:

When playing the HEVC files via jellyfin i only get sound (XVID; H264 work just fine!).

JustAMan commented 4 years ago

This looks like Android issue, so transferred. Should be covered by ExoPlayer implementation @vitorsemeano did, so you may want to have a conversation on how to enable and beta-test his works.

vitorsemeano commented 4 years ago

I have a op3 and hardware decoding works on the go with exoplayer. But the interface and track selection is not done yet. There's just a simple interface (the default one of exoplayer) with play pause, seek. It's already saving progress and it also marks a file as viewed when near finished. The problem is that I am really not comfortable with Android UI (I don't have much experience with it). It should be easy to activate the player as stated previously in other issues.

Stampede10343 commented 4 years ago

@vitorsemeano I'm looking into building up the ExoPlayer interface, just trying to get comfortable with the web interface and a better handle on ExoPlayer itself. This is what I got so far, trying to figure out how to implement the subtitle and stream switching, but the UI should be fairly straightforward, although I'm not exactly sure how we want it to be done. Player Player options expanded

vitorsemeano commented 4 years ago

Hi, thanks for your interest in helping out. I believe we want to keep the UI similar to the current one when using the web player. So you should base the Android UI on that.

I think the best approach to modify the UI will be to extend the exoplayer view that is already present. They explain the process in more detail here: https://exoplayer.dev/ui-components.html

From there, you could add the necessary buttons and objects to it.

The subtitles is a little tricky, because the player doesn't know if there is subtitles that are present in the server. It can only recognise the ones that are present in the file that's playing. I have a commented implementation that grabs the endpoint for each of these subtitles and add it to the exoplayer, so it can be used later on. Initially i was using index basing to select a track, but that doesn't work properly. The right way to pre select a subtitle is to specify a preferred language for subtitles, as described here: https://exoplayer.dev/track-selection.html

The exoplayer will read the file and their tracks, and an event will be fired notifying that there is new tracks available to choose from. My approach to this would be to when the user clicks on the track selection for audio or subtitle or even video, you go direct to the exoplayer instance being played and fetch all tracks available in that moment, presenting a list of tracks like a popup. I believe they have some classes for that but i find it a little confusing. Something like this: https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/ui/TrackSelectionDialogBuilder.html

I also detected that for mkv containers that encrypt subtitles with zlib or something similar is not supported by exoplayer, generating an error. For these edge cases we will need to force transcoding, but only after the exoplayer gives this type of error. But this can be dealt later on.

I can assist with this implementation regarding the inner logic of fetching tracks and so on. If you would like to build the UI similar to the current one, i would be thankful.

@dkanada Can also give is opinion on the pretended UI we want to make as also is feedback regarding tracks selection and other things that needs to be done.

And by the way, happy new year :)

Stampede10343 commented 4 years ago

Happy new year, I went for a little closer to the web interface. I appreciate the info, it should help out. I'm seeing an issue currently if I pick a movie with subtitles and choose a subtitle before launching the player it gets a 404, but selecting no subtitle works fine.

Screenshot_20200102-185749 Screenshot_20200102-185842

dkanada commented 4 years ago

If you plan on adding some advanced features I would also look at the NewPipe video player. It has stuff like speed, aspect ratio, and orientation lock hidden behind a drop down menu. It also has inline playlist support which would be amazing for queueing episodes. Maybe a mix of the two interfaces would work, I think the current interface would also be great though.

Stampede10343 commented 4 years ago

Yeah the NewPipe player is pretty nuts, I was looking through the code a bit.. its a couple thousand lines of custom stuff, I'm going to try and get the basic stuff working at first but definitely have that under the pillow as a reference.

vitorsemeano commented 4 years ago

If you want any help linking the UI with the server I can help you out.

My main issue was the UI, since you can work in that, I could complement the other, so if anything, I am here.

Stampede10343 commented 4 years ago

Alright, I'm getting pretty close to being in a state where it's ready to push up. Not having a ton of luck with the captions piece. I'll let you know when it's out there.

Stampede10343 commented 4 years ago

Lost some motivation with this lately but I will start looking back into this soon. You can watch PR #238

nshtg commented 4 years ago

Emby App supports this perfectly. Dashboard shows "DirectPlay" but the picture just stays black-

JustAMan commented 4 years ago

Emby App supports this perfectly.

This means nothing. In terms of what source we had at fork we effectively parted at around 2016 (newer code was never published). So direct play of HEVC would be possible when ExoPlayer lands in.

Protektor-Desura commented 4 years ago

Also on Android TV, the Second Generation Amazon Firestick will play HEVC/H.265 but only 8bit. Amazon Firestick 4K will play all HEVC/H.265 files including 10bit files. First Generation of Amazon Firestick will NOT play HEVC/H.265 at all. Amazon Fire Cube will also play all HEVC/H.265 files including 10bit files.