Open Plazzmex opened 3 years ago
For the moment, the short answer is Yes - but I am doing more research to figure out the issue.
The background to this is that I use ExoPlayer which is the 'player' provided by Google. It works most of the time for most people. But as Android is a little bit different on every device, issues do come up. Behaviour of Android in a TV vs an external device (Shield, Google TV, etc) is also different.
As for things to try, would you mind downloading Just (Video) Player, then download 1 of the 4K HDR videos and try playing it?
Ok so I tested it like you said. And no, just player couldn't play the HDR Videos :( Built in player of the TV played them flawlessly with Dolby Vision notification...
So the issue must be with exoplayer on Philips TV... Probably Philips did something with their codecs or whatever that broke this functionality... :/
Ok, at least we know where the problem is - could you test one more (free) app, this time Nova Player?
(it doesn't use ExoPlayer, they have their own player, customisations, etc - and it's open source)
Nova was able to play it BUT not as HDR video and all the colors are greenish purple magenta and not real colors :P
Edit: But does it support HDR & Dolby Vision playback? Because it doesn't seem so.. or at least not on Philips tv...
Hmmm... that is odd. I'm not an expert on the Android platform so I don't know why some DV content works (eg. Netflix) and some doesn't. I do hope to ask the developers of ExoPlayer why this happens or how to detect it.
I'm also curious if an external device (Shield, Google TV, etc) can play Dolby Vision on that TV or will it run into the same issues.
That is an interesting question, but I don't have Shield or Google TV so I can't test it unfortunately...
I do have a friend with mi box 4s but as I understand it doesn't work either...
Edit: Kodi was able to play the videos flawlessly, if that helps, with Dobly vision notification and everything!
Ok, thanks for that additional testing. I think Kodi uses their own low-level player so I'm not sure what I can take from it, but I'll have a look!
Also, would you be willing to try a debug version of the app on your TV - it should display more info (I do hope to add to this to the regular app in future) but you may have to installed Android Studio to see the logs?
(I'm trying to get this info... https://exoplayer.dev/debug-logging.html)
Sure, I can try the debug version.
I have the Android SDK Platform Tools package. Will this be enough? Although I never used it in combination with TV
Edit: After reading the Explayer debug logging page I see that it's not enough. So, I'll need your assistance in using the debugger and how to connect it to the TV etc...
Ok, all you have to do is enabled debugging on the TV, then connect to it...
adb connect 192.168.x.x
(put your IP there)adb logcat EventLogger:* ExoPlayerImpl:* *:s
If this works you should see info like that mentioned on the page above. As a test, after you use the adb connect
command, using adb logcat
should print lots of info as you use your TV normally.
Ok, got it.
Send me the debug version and I'll try this.
Ok, this is debug version of 0.99... [link removed]
Sorry for the delay, busy days... Here are the logs, hope it helps.
p.s. - For understanding the logs: I initiated the logging, then proceeded to open the debug version of the app, then went to test screensaver settings, then black screen, then I pressed one time right to switch to the next video, and then exit.
Thanks for that, the logs indicate that two videos were played ?! What's odd is that there are no visible error messages. In fact, I was not expecting to see supported=YES which means the video can be decoded, etc.
Would you mind running that test one more time, exactly the same as before, except just adb logcat
which doesn't use any filter so there'll be 5x more content in the logs?
Here is the full log.
Just a couple more things to try, if you don't mind?
Edit:
You mean this?
You mean this?
Thank you, that was it!
Just doing a bit more research on the issue as I don't fully understand what's going on. ExoPlayer does seem capable of playing the file but part of ExoPlayer or the system reports MediaCodecInfo: NoSupport [codec.profileLevel...
and tries each of the Dolby Codecs available.
My current guess is that not all devices/TV have the same codecs (maybe related to Android version or Dolby license?) so in this case, your TV can play some profiles and not others. And with streaming apps (Netflix, etc), all they have to do is supply the video with the right profile (typically streaming platforms have many, many versions of each video for different devices).
Sounds like every TV manufacturer does what they want to try to complicate things... Don't they suppose to have a standard? Isn't this what Dolby Vision is all about? to standardize HDR video across devices and media files? I'm lost :/ Also, why would anyone want to even use royalty Dolby Vision if there's a free base HDR royalty-free, i'll never understand.
But then, how do you explain that the TV can natively play the Apple file flawlessly with the HDR capability and some apps, like Kodi for example, can play it without issues too... It means the TV has the necessary profiles and codecs to play the file... It's just the playback implementation of particular apps to access it? I'm no expert ¯(o_o)/¯
Edit: Philips messed up big time... A lot of bugs in the firmware, low-quality post-processing & image, and now this sh*t with codecs support! The only reason I like this TV is because of Ambilight, but I'm not sure it's worth it...
Dolby Vision is a standard, but a proprietary one that has to be licensed (as opposed to HDR10 and HDR10+ which are free to use). Dolby (or Google) probably supplies the codecs and test suite (clips, etc), plus I'd guess certain streaming apps are tested too.
I think the issue here is that a certain DV profile is missing, it may not have been part of the codec when the TV shipped - and it's not problem for Apple TVs as they know the capabilities of their devices, plus they get regular updates.
And I use ExoPlayer, I'm limited to that the system provides but players like Kodi and VLC basically handle everything themselves and ignore the system codecs.
Btw, does a 4K HDR Apple video play locally, trigger Dolby Vision and all the colours look correct in Kodi?
Yeah, The 4K HDR Apple videos play flawlessly off a USB drive in Kodi with Dolby Vision notification and correct colors. But like you said, Kodi uses their own codecs?
But also the TV has its own built-in video player and it too played the files as Dolby Vision correctly, so I understand the TV does have the appropriate codecs and profiles to play the Apple videos...
Have you tried MPV player? It's open source, and one of the players Jellyfin uses. I think it plays Dolby Vision, but I'm not sure how smoothly.
Tested now, Same as with Nova player, The videos are playing as standard videos, not as HDR.
I've done a lot of research over the last couple of months on this issue but I'm still not sure if there's a fix or not.
My current guess is that the method ExoPlayer uses to a) figure out what codecs are installed on your TV and b) match those to the version (profile) of Dolby Vision that the Apple uses in its videos had edge cases where it gets it wrong. That does explain why different methods used by other apps eg. Kodi and even Philip's own build in video player work no problem.
If I come up with things to try, I'll post here but in the meantime I'll close this issue.
Tested now, Same as with Nova player, The videos are playing as standard videos, not as HDR.
I saw this question of what players support DoVi recently. It turns out Nova, VLC, and MPV don't support DoVi. But Just Video Player does. One last player to try: https://github.com/moneytoo/Player
I already tried Just player, and it couldn't play it. :/
I already tried Just player, and it couldn't play it. :/
Oh sorry about that, I missed that earlier in this thread
On my PUS7304 just by putting it in an mkv container, which doesn't need transcoding, so its as fast as copying it, the app plays it back as dolby vision (though the built in player sees it as sdr which is strange). Unfortunately I'm not sure how we could host it. The best I've seen is gofile, but I'm not sure how these files are streamed, so I don't know if it even would work, but even then there would have to be some hackiness needed because they don't do direct links on a free account.
On my PUS7304 just by putting it in an mkv container, which doesn't need transcoding, so its as fast as copying it, the app plays it back as dolby vision (though the built in player sees it as sdr which is strange).
If you have a few minutes, can you test both the original .MOV and your .MKV file with Just (Video) Player? (it's free)
Basically, that app uses the same video player as Aerial Views but it's a bit newer, plus there are a few fixes to support different Dolby Vision profiles.
It acts the same way your app does. The mov gets stuck on loading, the mkv plays back as dolby vision.
EDIT: I pulled the built in video player of the tv, which playes back the mov as dovi, it does also use exoplayer, I haven't looked farther into it, If I were you I wouldn't waste time looking in there but in case you want to here is the apk: https://gofile.io/d/S7tY98
EDIT2: After staring at a couple more files, I feel like its not actually playing back as dolby vision in the built in video player, even though the notification comes up that it is. I've been comparing it to the sdr version and the dolby vision version definitely looks worse, which is not something I've ever come across, I've compared dolby vision to sdr many times before. Profile 5 DoVi shouldn't have any backwards compatibility but somehow mpc-hc playes it back with the right colors, even though it cant tone map DV, all that to say however they encoded this at apple is too obscure, and I feel like this whole deal is hopeless (though I'm very much not an expert). I am a moron. I never use the built-in player and the picture settings were off. It looks fine.
Thanks @bdwixx for testing that. It kinda confirms what I thought, there's a lot of custom stuff going on with older Philips TVs that I'm not sure I can fix.
From what I know, the device (TV, etc) must have 'codecs' to play different types of video. Dolby Vision has several profiles but Philips TVs only support a few of them. The built in player, which is custom and supports a few more profiles, will play the .MOV file while my app won't.
Transcoding the .MOV files to .MKV files does seem like a reasonable solution - unless the ExoPlayer devs are able to fix the bug.
On my PUS7304 just by putting it in an mkv container, which doesn't need transcoding, so its as fast as copying it, the app plays it back as dolby vision (though the built in player sees it as sdr which is strange). Unfortunately I'm not sure how we could host it. The best I've seen is gofile, but I'm not sure how these files are streamed, so I don't know if it even would work, but even then there would have to be some hackiness needed because they don't do direct links on a free account.
Hey, what program did you use to Remux MOV files to MKV container? Iv'e tried with Xmedia Recode which I use daily for other needs, but it doesn't seem to like the HDR MOV files and shows an error when converting. :/ I would like to try to recreate it on my Philips. Thanks.
Thanks @bdwixx for testing that. It kinda confirms what I thought, there's a lot of custom stuff going on with older Philips TVs that I'm not sure I can fix.
From what I know, the device (TV, etc) must have 'codecs' to play different types of video. Dolby Vision has several profiles but Philips TVs only support a few of them. The built in player, which is custom and supports a few more profiles, will play the .MOV file while my app won't.
Transcoding the .MOV files to .MKV files does seem like a reasonable solution unless the ExoPlayer devs are able to fix the bug ?!
Alright, thanks anyways. One interesting titbit I've found is that MX Player plays back the mov correctly, I'm not remotely smart enough to understand what is going on, but as far as I understand it uses ffmpeg as its base, there may be open source implementations of it but I haven't found a prebuilt apks I could test it with. I did try this one and it did not work : https://github.com/coderJohnZhang/TvPlayer
On my PUS7304 just by putting it in an mkv container, which doesn't need transcoding, so its as fast as copying it, the app plays it back as dolby vision (though the built in player sees it as sdr which is strange). Unfortunately I'm not sure how we could host it. The best I've seen is gofile, but I'm not sure how these files are streamed, so I don't know if it even would work, but even then there would have to be some hackiness needed because they don't do direct links on a free account.
Hey, what program did you use to Remux MOV files to MKV container? Iv'e tried with Xmedia Recode which I use daily for other needs, but it doesn't seem to like the HDR MOV files and shows an error when converting. :/ I would like to try to recreate it on my Philips. Thanks.
I used MKVToolNix GUI, if you prefer cli you can use mkvmerge.
Just realised, if you're using .MKV instead of .MOV files, I don't think the titles + descriptions will appear.
I'll put a fix in the next release to ignore to file extension when matching video filenames to their title + description.
Alright, thanks anyways. One interesting titbit I've found is that MX Player plays back the mov correctly
Most video players on Android either use Google's ExoPlayer (like Aerial Views) or they write everything themselves. MX Player and VLC handle everything themselves, which means they can support more formats but performance is worse - more of a problem on a phone though.
Just realised, if you're using .MKV instead of .MOV files, I don't think the titles + descriptions will appear.
I'll put a fix in the next release to ignore to file extension when matching video filenames to their title + description.
That would be great, and also i noticed the hourly gigabytes used is wrong I downloaded all the 114 1080p hdr files and they are 34.7GB according to windows and are combined 38211 seconds, that is over 10 hours, which would make it around 3.3GB/h.
By the way i looked around a ton and there are no free file hosts i would trust. I looked into onedrive but the "direct" link you can get is an auto redirect that sets the cookie before sending you to the actual file, and I believe its the same with google drive. Maybe its possible to work around this, I think you can give exoplayer a cookie, but i didnt try because i only have the free e5 dev account which who knows how long would last. Mediafire is another one that could work with some hackiness but they like deleting accounts. Mega, Dropbox and Scaleway have relatively strict daily limits. The cheapest solution might be backblaze. I just thought i'd share my findings in case anyone would have wanted to look into this in the future. If someone were to be willing to host the files on onedrive or google drive (or something else even), id be willing to (at least try to) make a fork to handle those links. I know google drive has some download limits (its either 2 or 10 tb/day so its probably fine), i think onedrive doesnt.
I found out that android's MediaPlayer plays back the dolby vision movs, I made a proof of concept? fork : https://github.com/bdwixx/AerialViews/tree/mediaplayer This is my first time touching android code, so I know very little but I've read that this mediaplayer api isnt great, and hit or miss on some devices, but on my tv it seems to work fine.
I found out that android's MediaPlayer plays back the dolby vision movs, I made a proof of concept? fork : https://github.com/bdwixx/AerialViews This is my first time touching android code, so I know very little but I've read that this mediaplayer api isnt great, and hit or miss on some devices, but on my tv it seems to work fine.
Very interesting. So it seems that ExoPlayer is the issue, it's not able to either a) identify the file properly or b) able to identify Dolby Vision hardware support on certain (your Philips) TVs.
And you're right about MediaPlayer. It's the older API, but ExoPlayer is actually built on top of it.
If you're curious @bdwixx, here is a thread about some Dolby Vision files playing in MediaPlayer but not ExoPlayer. A number of months ago, I had the idea to use a modified MediaCodecVideoRenderer but I never got around to it.
I found out that android's MediaPlayer plays back the dolby vision movs, I made a proof of concept? fork : https://github.com/bdwixx/AerialViews This is my first time touching android code, so I know very little but I've read that this mediaplayer api isnt great, and hit or miss on some devices, but on my tv it seems to work fine.
Very interesting. So it seems that ExoPlayer is the issue, it's not able to either a) identify the file properly or b) able to identify Dolby Vision hardware support on certain (your Philips) TVs.
And you're right about MediaPlayer. It's the older API, but ExoPlayer is actually built on top of it.
If you're curious @bdwixx, here is a thread about some Dolby Vision files playing in MediaPlayer but not ExoPlayer. A number of months ago, I had the idea to use a modified MediaCodecVideoRenderer but I never got around to it.
I believe the problem is that ExoPlayer uses a custom implementation, instead of MediaExtractor that MediaPlayer uses, which in the background on my tv uses MtkMP4Extractor, that im guessing is made by MediaTek. The built-in video player uses a modified version of ExoPlayer seemingly made by mediatek that also uses MtkMP4Extractor. And by the looks of it they wouldnt go back to using MediaExtractor
EDIT: The reason i say its the extractor, is because i looked into how the decoder gets initialized in the built in player's version of exoplayer (everything ends up using "OMX.dolby.vision.dvhe.stn.decoder", so it selects it correctly), i only saw one difference which was this and it changed nothing: mediaFormat.setString("vendor.vdecomx.trick", "nativesource");
, but of course there is a chance i just missed something.
Anyway, I would love to contribute to this project, I would be willing to try to implement a way to toggle between exoplayer and mediaplayer, im just not very confident in my android/kotlin knowledge. If doing this yourself is a low-priority thing then, I would take the time to try to do it right.
I believe the problem is that ExoPlayer uses a custom implementation, instead of MediaExtractor that MediaPlayer uses, which in the background on my tv uses MtkMP4Extractor, that im guessing is made by MediaTek. The built-in video player uses a modified version of ExoPlayer seemingly made by mediatek that also uses MtkMP4Extractor. And by the looks of it they wouldnt go back to using MediaExtractor
EDIT: The reason i say its the extractor, is because i looked into how the decoder gets initialized in the built in player's version of exoplayer (everything ends up using "OMX.dolby.vision.dvhe.stn.decoder", so it selects it correctly), i only saw one difference which was this and it changed nothing:
mediaFormat.setString("vendor.vdecomx.trick", "nativesource");
, but of course there is a chance i just missed something.Anyway, I would love to contribute to this project, I would be willing to try to implement a way to toggle between exoplayer and mediaplayer, im just not very confident in my android/kotlin knowledge. If doing this yourself is a low-priority thing then, I would take the time to try to do it right.
If you'd like to have a go at figuring out the issue and contributing a fix, that would be great!
As I didn't start the project, I'm not sure what the thinking was behind ExoPlayerView (in Aerial Dream/Views) but it seems to extend ExoPlayer so that's the part to replace. I'm open to ideas of how to do it though!
If it were possible to modify ExoPlayer or use a different extractor, that might be an easier option to integrate.
Also, it's worth noting that we could file an issue on the ExoPlayer repo as you've shown that the video plays when inside an MKV wrapper but not a MOV wrapper?
If anyone is still checking this issue and has time, can you confirm something for me...
If you could try Just (Video) Player again but this time make sure the Dolby Vision profile 7 support is enabled in Settings. You have to long-press the settings/gear/cog icon btw.
I assumed that option was enabled by default before, but I was mistaken.
@theothernt Which app do you mean? I've tried the integrated Media app, which is able to play the video with Dolby, unlike VLC, though it shows a warning about an incompatible audio format. This media app doesn't open any menu after long pressing the cog button though. Do you mean the button on the remote? I'm still on Android TV 9.
Is it possible that ExoPlayer isn't able to handle the unexpected audio format and this is what makes it hang on the loading screen?
@theothernt Which app do you mean? I've tried the integrated Media app, which is able to play the video with Dolby, unlike VLC, though it shows a warning about an incompatible audio format. This media app doesn't open any menu after long pressing the cog button though. Do you mean the button on the remote? I'm still on Android TV 9.
Sorry, forgot to add the link - fixed now.
Is it possible that ExoPlayer isn't able to handle the unexpected audio format and this is what makes it hang on the loading screen?
I think the media player built into the TV is a modified version of ExoPlayer, so it is capable - we just don't know why the generally available version, which I use, doesn't work.
If anyone is still checking this issue and has time, can you confirm something for me...
If you could try Just (Video) Player again but this time make sure the Dolby Vision profile 7 support is enabled in Settings. You have to long-press the settings/gear/cog icon btw.
I assumed that option was enabled by default before, but I was mistaken.
I ended up figuring out a way to make ExoPlayer work, I just wanted to add a setting option to toggle the workaround and clean it up then do a pr, but I have a problem with finishing projects so I give up on that. The Philips decoder is picky and needs a couple extra bytes at the end of the "csd-0" for Dolby Vision metadata. Using the MediaExtractor to get the csd-0 is good because it shouldn't break anything on other TVs, in my repo I added a check to see if its Philips, but I think that's unnecessary. https://github.com/bdwixx/AerialViews Edit: Ive been using this for over a month and never had any issues. I can give more info if needed too.
I ended up figuring out a way to make ExoPlayer work, I just wanted to add a setting option to toggle the workaround and clean it up then do a pr, but I have a problem with finishing projects so I give up on that. The Philips decoder is picky and needs a couple extra bytes at the end of the "csd-0" for Dolby Vision metadata. Using the MediaExtractor to get the csd-0 is good because it shouldn't break anything on other TVs, in my repo I added a check to see if its Philips, but I think that's unnecessary. https://github.com/bdwixx/AerialViews Edit: Ive been using this for over a month and never had any issues. I can give more info if needed too.
That's fantastic, great work!
I'll integrate that into the next release (v1.4.1) over the next few days and attach a beta here for others to test.
I ended up figuring out a way to make ExoPlayer work, I just wanted to add a setting option to toggle the workaround and clean it up then do a pr, but I have a problem with finishing projects so I give up on that. The Philips decoder is picky and needs a couple extra bytes at the end of the "csd-0" for Dolby Vision metadata. Using the MediaExtractor to get the csd-0 is good because it shouldn't break anything on other TVs, in my repo I added a check to see if its Philips, but I think that's unnecessary. https://github.com/bdwixx/AerialViews Edit: Ive been using this for over a month and never had any issues. I can give more info if needed too.
That's fantastic, great work!
I'll integrate that into the next release (v1.4.1) over the next few days and attach a beta here for others to test.
- Any idea what happens when you try the fix on a non-Philips TV?
- What happens with non-Dolby Vision videos?
Something that still bothers me is that the csd-0 in theory should be the same whether its mkv or mov file because its only data from the video track. There may be something different that can be used instead of changing the csd-0. The extra bytes are things like dovi profile, level and hdr10 compatibility, which are already being given to the decoder in a different field but for some reason it seemingly ignores it. Honestly my understanding at a low-level of what's happening is hazy. Also I'm not sure if you saw my comment in the code but ASynchronousMediaCodecAdapter is not usable with my implementation. You can make it work, but right now unless you force it, its not being used on most devices. Off topic but can you please add this https://github.com/theothernt/AerialViews/commit/83851f6c195930d8e40333e120ffbd2ede5b2a6d, maybe with a check for philips beacuse the button does nothing right now. Looking forward to the release with the fix!
Edit: Something I forgot to say is that (there is very little info on this so its possible I'm not right but) the csd-0 shouldn't differ between devices, it being different on my philips tv is likely because this is some hotfix made by them.
Off topic but can you please add this 83851f6, maybe with a check for philips beacuse the button does nothing right now. Looking forward to the release with the fix!
Ok, that's been added.
Edit: Something I forgot to say is that (there is very little info on this so its possible I'm not right but) the csd-0 shouldn't differ between devices, it being different on my philips tv is likely because this is some hotfix made by them.
I did a little testing and video plays regardless in the emulator and on the Google TV if I remove the check for a Philips device. So I think I'll just remove the device check, and leave it up to the user to enable or disable this 'fix'.
Ok, that's been added.
Thank you.
I did a little testing and video plays regardless in the emulator and on the Google TV if I remove the check for a Philips device. So I think I'll just remove the device check, and leave it up to the user to enable or disable this 'fix'.
Yeah I think that makes more sense. Its possible it affects other mediatek devices too.
Hey,
I'm trying to understand why my Philips tv doesn't play the HDR Videos. I have the Philips Android TV model PUS8505 from last year.
The TV spec sheet says that it supports all the HDR formats and video formats including Dolby Vision, hdr10, hdr10+, hlg and vp9, avc and hevc codecs.
Netflix and other apps shows Dobly vision content perfectly and the TV shows a notification that Dolby vision is being used.
In the debug section of the app everything shows as True, but the HDR Videos are still black screen. The debug screen also shows that my tv is at 1080p at 60hz, maybe it has something to do with this? Although it is a 4k screen and as mentioned earlier Other video apps do support 4k content with Dolby Vision.
I've tested both the 1080p HDR stream and 4k HDR stream and both get black screen instead of the video and no Dolby vision notification is shown
Is there anything else that can be done? Or am I doomed to use SDR ?
Regards