Comments (7)
You haven't listed your device. Maybe it doesn't support those profiles?
from jellyfin-androidtv.
I tested out the code on Andriod Studio with the emulator. Lots of ways to test it, but I'll try to explain my method.
If this is true (MediaCodecCapabilitiesTest)
fun supportsAVCHigh10(): Boolean = hasDecoder(
MediaFormat.MIMETYPE_VIDEO_AVC,
CodecProfileLevel.AVCProfileHigh10,
CodecProfileLevel.AVCLevel4
)
Then because of this (ProfileHelper) AVC High 10 is supposed to direct play given no other factors, e.g., subtitles, level support, bitrate, etc..
val h264VideoProfileCondition by lazy {
ProfileCondition(
ProfileConditionType.EqualsAny,
ProfileConditionValue.VideoProfile,
listOfNotNull(
"high",
"main",
"baseline",
"constrained baseline",
if (MediaTest.supportsAVCHigh10()) "high 10" else null
).joinToString("|")
)
}
Using current build, play AVC High 10 L4.2 media, no subtitles or audio to eliminate other factors. Notice the video will transcode, reason should be unsupported profile.
Change this
fun supportsAVCHigh10(): Boolean = hasDecoder(
MediaFormat.MIMETYPE_VIDEO_AVC,
CodecProfileLevel.AVCProfileHigh10,
CodecProfileLevel.AVCLevel4
)
to this
fun supportsAVCHigh10(): Boolean = hasDecoder(
MediaFormat.MIMETYPE_VIDEO_AVC,
CodecProfileLevel.AVCProfileMain,
CodecProfileLevel.AVCLevel4
)
Run a new debug build on emulator and notice the file should now direct play without transcoding. HEVC Main will also come back as true. HEVC Main 10 comes back as false causing the video to transcode. You can run similar tests with different conditions to verify that getHevcMain10Level
always comes back false with the getDecoderLevel
function.
Note I also tested out the debug builds on real hardware and had the same results
from jellyfin-androidtv.
This is because the Android emulator doesn't claim support for HEVC Main 10 or AVC High 10:
Media type 'video/avc':
Decoder "OMX.google.h264.decoder" supports
profile/levels: [
65536/65536 (ConstrainedBaseline/5.2),
1/65536 (Baseline/5.2),
2/65536 (Main/5.2),
524288/65536 (ConstrainedHigh/5.2),
8/65536 (High/5.2) ]
...
Media type 'video/hevc':
Decoder "OMX.google.hevc.decoder" supports
profile/levels: [
1/65536 (Main/Main 5.1),
4/65536 (MainStill/Main 5.1) ]
On this system, supportsAVCHigh10
and supportsHevcMain10
should both report false. I don't see what the problem is here. These functions seem to work as intended.
from jellyfin-androidtv.
Ok, thanks for that info. I didn’t realize that the emulators were not reporting AVCHigh10 & HEVCMain10 nor did it dawn on me to check. I assumed that they were b/c in my testing AVCHigh10 would directly play without transcoding in the emulator.
I also tested 2 Amazon devices; the Fire TV Stick 2nd gen and Fire TV Stick 4k 2nd gen, along with my Sony Bravia X90J. They all produced the results as the emulator returning false when checking for AVCHigh10 leading to transcoded video and True for HEVCMain & AVCMain producing direct play.
So my conclusions here are wrong. The main issue, as you pointed out, is that devices are not reporting AVCHigh10, even though they are supported. For example, Amazon's device specifically states “H.264. Hardware accelerated up to 3840x2160p (4K) @ 60 fps, 20 Mbps, High 10 Profile Level 5.2”. Yet reports no such decoder thus rendering the decoder check useless.
Decoder "c2.android.avc.decoder" supports
aliases: [
"OMX.google.h264.decoder" ]
attributes: 0x4: [
encoder: 0,
vendor: 0,
software-only: 1,
hw-accelerated: 0 ]
owner: "codec2::software"
rank: 512
profile/levels: [
65536/65536 (ConstrainedBaseline/5.2),
1/65536 (Baseline/5.2),
2/65536 (Main/5.2),
524288/65536 (ConstrainedHigh/5.2),
8/65536 (High/5.2) ]
colors: [
Well, this still is an issue but not with the hasDecoder
function. It's more like what should be done when devices do not properly report their capabilities.
from jellyfin-androidtv.
That's Google's software decoder you've quoted. If I remember correctly, c2.android.avc.decoder
is an alias for OMX.google.h264.decoder
. If you keep looking you should find the hardware decoder. Could you post the report of that one please? It would be good to have it here for reference.
from jellyfin-androidtv.
Here's the full output for the Fire TV Stick 4k 2nd gen
from jellyfin-androidtv.
For AVC, those logs say it supports up to 5.2 High but doesn't support High 10 at all. For HEVC, it supports up to 5.1 Main 10.
The device page you linked to agrees on the level of HEVC support, but claims support for AVC High 10 at level 5.2. Which one is wrong I have no idea.
My suggestion would be to continue the special casing of AVC profile levels per device when support is different from what MediaCodec reports. In fact, this could be expanded to be on a per-profile basis rather than "global" across all AVC profiles.
from jellyfin-androidtv.
Related Issues (20)
- Chromecast HD cannot play 4k HEVC, but chooses direct-play anyways
- Add proper deeplink support to the android app for Jellyfin
- Movie position not remembered and watched status doesn't change after watching
- Suddenly unable to remote connect HOT 5
- Websocket closes after a while and never reopens HOT 4
- Add hearing impaired subtitle stream indicator
- [bug] Playback of playlist shows songs in queue. Songs are not played in that order. HOT 2
- Status of Jellyfin 10.9 support HOT 8
- Subtitles can be delivered when using MX Player HOT 1
- Dolby Vision - Black bars are not black for non-16:9 media HOT 4
- Crash when opening newer Library Items (TV Show/Movie) HOT 1
- Embedded subtitles in a .MKV file do not work HOT 2
- Media player doesn't change sound channel HOT 2
- trailer playback on youtube doesn't return to movie page on jellyfin HOT 2
- FireTV Stick (2nd gen) seems to not send a transcode request to the server.
- Unable to connect to server HOT 3
- Android TV unable to connect HOT 2
- Some controls stop working on Android TV app HOT 4
- Subtitles get out of sync when resuming a movie, or the audio/video is out of sync with the subtitles. HOT 29
- [Issue]: Local "Strm" files can't be played on the jellyfin TV clients (android),but in the browser(like edge) can play strm file HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jellyfin-androidtv.