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

HDR Playback issue on Philips TV #26

Open
Plazzmex opened this issue Oct 18, 2021 · 71 comments
Open

HDR Playback issue on Philips TV #26

Plazzmex opened this issue Oct 18, 2021 · 71 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@Plazzmex
Copy link

Plazzmex commented Oct 18, 2021

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.

  1. 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.

  2. Netflix and other apps shows Dobly vision content perfectly and the TV shows a notification that Dolby vision is being used.

  3. 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.

  4. 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

@theothernt theothernt changed the title HDR Playback Issue HDR Playback issue on Philips TV Oct 18, 2021
@theothernt
Copy link
Owner

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?

@theothernt theothernt added the bug Something isn't working label Oct 19, 2021
@Plazzmex
Copy link
Author

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... :/

@theothernt
Copy link
Owner

theothernt commented Oct 19, 2021

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)

@Plazzmex
Copy link
Author

Plazzmex commented Oct 19, 2021

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...

@theothernt
Copy link
Owner

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.

@Plazzmex
Copy link
Author

Plazzmex commented Oct 19, 2021

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!

@theothernt
Copy link
Owner

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!

@theothernt
Copy link
Owner

theothernt commented Oct 21, 2021

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)

@Plazzmex
Copy link
Author

Plazzmex commented Oct 21, 2021

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...

@theothernt
Copy link
Owner

Ok, all you have to do is enabled debugging on the TV, then connect to it...

  1. In System Preferences, select Developer options, under Debugging, select ADB Debugging or USB Debugging (this also mean wifi if there is no wifi option)
  2. Find the IP of your TV
  3. Use the command adb connect 192.168.x.x (put your IP there)
  4. Then use the command from the ExoPlayer debug guide... adb logcat EventLogger:* ExoPlayerImpl:* *:s
  5. Then run the debug build which I will send you...

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.

@Plazzmex
Copy link
Author

Ok, got it.

Send me the debug version and I'll try this.

@theothernt
Copy link
Owner

theothernt commented Oct 21, 2021

Ok, this is debug version of 0.99... [link removed]

@Plazzmex
Copy link
Author

Plazzmex commented Oct 24, 2021

Exoplayer_Debug_Log.txt

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.

@theothernt
Copy link
Owner

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?

@Plazzmex
Copy link
Author

Exoplayer_Debug_Log_Full.txt

Here is the full log.

@theothernt
Copy link
Owner

Just a couple more things to try, if you don't mind?

  1. What version of Android is the TV running (I'll add this to the app so it's easier to find in future)
  2. Could you install the previous version of the app, and tell me what codecs it shows for Dolby only (eg. OMX.dolby.vision.dvav.per.decoder, etc)

@Plazzmex
Copy link
Author

Plazzmex commented Oct 27, 2021

  1. The TV is Android 9
  2. What do you mean?

Edit:
20211027_193349

You mean this?

@theothernt
Copy link
Owner

You mean this?

Thank you, that was it!

@theothernt
Copy link
Owner

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).

@Plazzmex
Copy link
Author

Plazzmex commented Oct 28, 2021

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...

@theothernt
Copy link
Owner

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?

@Plazzmex
Copy link
Author

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...

@finnzz
Copy link

finnzz commented Dec 1, 2021

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.

https://github.com/mpv-android/mpv-android

@Plazzmex
Copy link
Author

Plazzmex commented Dec 2, 2021

Tested now,
Same as with Nova player, The videos are playing as standard videos, not as HDR.

@theothernt
Copy link
Owner

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.

@finnzz
Copy link

finnzz commented Jan 7, 2022

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

@Plazzmex
Copy link
Author

Plazzmex commented Jan 9, 2022

I already tried Just player, and it couldn't play it. :/

@matfax
Copy link

matfax commented Mar 15, 2023

@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
Copy link
Owner

@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.

@bdwixx
Copy link

bdwixx commented Mar 15, 2023

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.

@theothernt
Copy link
Owner

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.

  1. Any idea what happens when you try the fix on a non-Philips TV?
  2. What happens with non-Dolby Vision videos?

@bdwixx
Copy link

bdwixx commented Mar 16, 2023

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.

  1. Any idea what happens when you try the fix on a non-Philips TV?
  2. What happens with non-Dolby Vision videos?
  1. My understanding is that the MediaExtractor uses methods given by the vendor, whatever it outputs has to be compatible with the decoder, so on my tv the MediaExtractor spits out a couple extra bytes for the csd-0 but on an nvidia shield it might output the same data as ExoPlayer.
  2. I didn't check if it generates a different output compared to ExoPlayer when using non-dv video, but it should always give data that would work. If it ends up failing when getting the MediaFormat (also maybe check if the new csd-0 is empty because it never should be), then we just don't set it and its the same as it would've been otherwise.

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 83851f6, 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.

@theothernt
Copy link
Owner

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'.

@bdwixx
Copy link

bdwixx commented Mar 16, 2023

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.

@theothernt
Copy link
Owner

theothernt commented Mar 17, 2023

Here is the beta version which includes the option to enable the fix for Philips TV.

Look in Settings > Troubleshooting

(this version also contains auto refresh rate switching, which also has to be enabled by the user)

(link removed)

@theothernt
Copy link
Owner

Has anyone had a chance to try the v.1.4.1 beta 1? 😅

@bdwixx
Copy link

bdwixx commented Mar 27, 2023

Has anyone had a chance to try the v.1.4.1 beta 1? 😅

I figured you might want someone else to confirm that this workaround works which i why i didnt respond, but for me everything works.

@matfax
Copy link

matfax commented Mar 27, 2023

I confirm that Dolby is now recognized by OLED805. The only issue I notice is some aliasing (presumably) with the small text in particular. Might be shadow or border but the white content isn't coherent. It also happens without the Philips option and without HDR, so I'm not sure if it's related.

PXL_20230327_142748174 MP

@theothernt
Copy link
Owner

theothernt commented Mar 27, 2023

I confirm that Dolby is now recognized by OLED805. The only issue I notice is some aliasing (presumably) with the small text in particular. Might be shadow or border but the white content isn't coherent. It also happens without the Philips option and without HDR, so I'm not sure if it's related.

Thank you @bdwixx and @matfax for confirming. Do you both see this text aliasing issue?

EDIT: Any idea what year these TVs are? 2019, 2020?

This issue was reported in another thread so I don't funny understand the cause. In the meantime, I'll probably add options to change text size, thickness and the font.

@bdwixx
Copy link

bdwixx commented Mar 28, 2023

I confirm that Dolby is now recognized by OLED805. The only issue I notice is some aliasing (presumably) with the small text in particular. Might be shadow or border but the white content isn't coherent. It also happens without the Philips option and without HDR, so I'm not sure if it's related.

Thank you @bdwixx and @matfax for confirming. Do you both see this text aliasing issue?

It looks a little weird for me too but only until the dolby vision logo disappears, then it looks normal, and it doesnt happen on sdr videos, however im running unreleased? (the comments say no one got it through ota) android 11 firmware.

20230328_031316
(The image here looks like its compressed or something but this is actually what it looks like.)
20230328_031318

EDIT: Any idea what year these TVs are? 2019, 2020?

I have a 2019 tv. The 2019 (model no. ends in 4), and 2020 (ends in 5) philips android tvs all use the same firmware(and the same soc too i believe).

EDIT: I took screenshots and the text looks fine there... (The colors are fine irl.)

screen1
screen2

@matfax
Copy link

matfax commented Mar 28, 2023

2020 has the aliasing both on Android 9 and unreleased 11, like it's rendered on a low resolution. And it stays after the Dolby logo disappears. The only moment when it seems to be fine is when I press the back button to cancel the screensaver, for a very brief moment it changes the text view before the complete view is destroyed. Moreover, during initialization, the aliasing also seems to shift for a very brief moment, though not including any accurate text view.

It also happens when I disable the Dolby notification all together.

@theothernt
Copy link
Owner

2020 has the aliasing both on Android 9 and unreleased 11, like it's rendered on a low resolution. And it stays after the Dolby logo disappears. The only moment when it seems to be fine is when I press the back button to cancel the screensaver, for a very brief moment it changes the text view before the complete view is destroyed. Moreover, during initialization, the aliasing also seems to shift for a very brief moment, though not including any accurate text view.

Text can only be rendered up to 1080p, like the rest of the UI, but video can go a lot higher - 4K in your case.

I'm not sure there anything I can do about other than give the user the option to change the font, size, weight, etc - which should be available in a release or two.

@matfax
Copy link

matfax commented Apr 10, 2023

I see. It's not important anyway. Thanks for the effort to make Dolby work.

@theothernt
Copy link
Owner

Aerial Views v1.4.1 is out with the fix so I'll close this issue.

Thanks again to @bdwixx for the fix - and @Plazzmex, @finnzz, @matfax for your help and suggestions over the past... checks notes... year and a half!

@Plazzmex
Copy link
Author

Hey,

sorry I couldn't chime in to test when you asked, haven't been able to.

But now I've tried with the latest 1.4.2 version from the play store, and it works when playing from the online source BUT it still the same problem when using the SMB feature, shows loading and nothing happens. :/

@theothernt
Copy link
Owner

theothernt commented Apr 27, 2023

But now I've tried with the latest 1.4.2 version from the play store, and it works when playing from the online source BUT it still the same problem when using the SMB feature, shows loading and nothing happens. :/

Ah! there might be a fix for this, let me look into it.

@theothernt
Copy link
Owner

theothernt commented Apr 27, 2023

Ok, think I figured out the issue but I'll need confirmation... (link removed)

@bdwixx
Copy link

bdwixx commented Apr 27, 2023

Ok, think I figured out the issue but I'll need confirmation... (link removed)

I was also clearing the mediaurl in the finally block, the one you commented out should be removed altogether

@theothernt
Copy link
Owner

theothernt commented Apr 27, 2023

I was also clearing the mediaurl in the finally block, the one you commented out should be removed altogether

When I tested clearing the mediaUrl in the finally block, playback fails - although I was testing in the simulator which can be a little flaky with SMB. Does it work when you remove it?

UPDATE: Same behaviour on the Google TV.

@bdwixx
Copy link

bdwixx commented Apr 27, 2023

I was also clearing the mediaurl in the finally block, the one you commented out should be removed altogether

When I tested clearing the mediaUrl in the finally block, playback fails - although I was testing in the simulator which can be a little flaky with SMB. Does it work when you remove it?

UPDATE: Same behaviour on the Google TV. I think the fix is to not clear the mediaUrl in the finally block but playback fails if I remove it. Could there be a race condition with mediaUrl when using SMB playback?

Just so that i understand, playback fails if the mediaurl is not set to null anywhere or only in the finally block?

@theothernt
Copy link
Owner

theothernt commented Apr 27, 2023

Just so that i understand, playback fails if the mediaurl is not set to null anywhere or only in the finally block?

Playback fails when I remove mediaurl = null from the finally block.

UPDATE: I added more logging, things are a bit clearer...

  1. The Factory fails to create an instance due to an exception
  2. Finally block sets mediaUrl to null
  3. Factory is called again and creates default instance, which is why playback will work but DV playback will fail on a Philips TV.

UPDATE: Looks like it's an issue with the MediaExtractor, it will only handle local or HTTP streams. Looks like SmbDataSource will have to be adapted to work with it.

@theothernt theothernt reopened this Apr 27, 2023
@bdwixx
Copy link

bdwixx commented Apr 27, 2023

Looks like it's an issue with the MediaExtractor, it will only handle local or HTTP streams. Looks like SmbDataSource will have to be adapted to work with it.

Dang. That seems like a massive undertaking. It might be more realistic to append the extra bytes mediaextractor creates to the exoplayer ones, its probably not a great solution so if we can figure it out you should only use this for smb.
Here is an example of the extra csd-0 bytes for a dv mov file:
'00 00 00 01 7c 01 01 05 07 00 00 00'
I think this is only dovi metadata. I know some are dv level, profile, compatibility level, but i dont know what 7c is for example. i have found this (page 19), but i dont know how i could figure out which byte is which.

EDIT: Honestly the 7c must be the 'descriptor_length', right? The rest i could figure out with trial and error on random dovi videos. I'll look more into it later.

@theothernt
Copy link
Owner

Dang. That seems like a massive undertaking. It might be more realistic to append the extra bytes mediaextractor creates to the exoplayer ones, its probably not a great solution so if we can figure it out you should only use this for smb. Here is an example of the extra csd-0 bytes for a dv mov file: '00 00 00 01 7c 01 01 05 07 00 00 00' I think this is only dovi metadata. I know some are dv level, profile, compatibility level, but i dont know what 7c is for example. i have found this (page 19), but i dont know how i could figure out which byte is which.

EDIT: Honestly the 7c must be the 'descriptor_length', right? The rest i could figure out with trial and error on random dovi videos. I'll look more into it later.

After some more research, and what you've said above, I see a couple of options (correct me if I'm wrong)...

  1. Write a MediaDataSource which only has a couple of methods to implement, plus I can use most of the code from SmbDataSource.

  2. In SmbDataSource when the Dolby fix is needed, alter the byte stream from there. Looking at the logs, the SmbDataSource is called 3 times during normal playback - one of those must be by the default MediaExtractor

@bdwixx
Copy link

bdwixx commented Apr 28, 2023

I did some research into those bytes and this is what I found:
Extra csd-0 from a Blu-ray remux:

00 - padding
00 - padding
00 - padding
01 - DV version (afaik there is only v1)
7c - not sure what this is but it was always this value
01 - BL flag (indicates whether track if base layer, only relevant for dual track dv(profile 7), for which i don't think this setup would work for anyway)
01 - RPU flag (indicates whether there is dv metadata, 1 unless first track of dual track dovi)
08 - DoVi profile (we already know this from ExoPlayer)
06 - DoVi level (we already know this from ExoPlayer)
00 - padding
00 - padding
00 - padding

Its possible the BL and RPU are swapped, but it shouldn't matter for this. I also did test for dv compatibility id and it doesn't show up in the csd0. The 'el_present_flag' is something I wasn't able to test for but I believe that is only present in profile 7 videos, and would likely play back correctly if the decoder ignores it. I tested many of the apple videos, Blu-rays and WebDLs, I feel fairly confident that these are correct.
'configuration.format' inside 'PhilipsMediaCodecAdapterFactory' has a 'codecs' field formatted like this that contains dv profile and level: hev1.08.06.
If you feel comfortable building the bytes according to this, then I can make actual code for it if you'd like, although the custom MediaDataSource would definitely be better, but its also harder.

@theothernt
Copy link
Owner

If you feel comfortable building the bytes according to this, then I can make actual code for it if you'd like, although the custom MediaDataSource would definitely be better, but its also harder.

If you'd like to write some code based on the method above, I would be interested to try it!

In the meantime, I have done a little work on making a SambaMediaDataSource for the MediaExtractor. It's not working yet as I have to refactor the the SambaDataSource to use/re-use a single connection. From what I can see, the MediaExtractor creates more than one instance of the SambaMediaDataSource so the underlying SMBJ library throws concurrency errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants