-
Notifications
You must be signed in to change notification settings - Fork 409
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
ExoPlayer ignores embedded 608 captions in Dolby Vision streams #1820
Comments
Thanks for the report.
Can you elaborate a bit on this part? Are you saying that this would be safe/correct: public static boolean isNalUnitSei(@Nullable String mimeType, byte nalUnitHeaderFirstByte) {
return ((MimeTypes.VIDEO_H264.equals(mimeType)
|| MimeTypes.VIDEO_DOLBY_VISION.equals(mimeType))
&& (nalUnitHeaderFirstByte & 0x1F) == H264_NAL_UNIT_TYPE_SEI)
|| ((MimeTypes.VIDEO_H265.equals(mimeType)
|| MimeTypes.VIDEO_DOLBY_VISION.equals(mimeType))
&& ((nalUnitHeaderFirstByte & 0x7E) >> 1) == H265_NAL_UNIT_TYPE_PREFIX_SEI);
} But this would be incorrect for H.264-in-dolby-vision (since it assumes dolby-vision implies H.265)?
If I've correctly understood your concern, we can probably modify Do you have a piece of sample media that demonstrates this problem? It would be really helpful if you could share it with us for testing. Please either upload it here or send it to android-media-github@google.com with the subject It would be even better if you could modify our existing dolby vision test asset to add CEA-608 captions and share the result with us, so we can write an automated test against it to avoid this breaking again in future. |
Thanks @icbaker
and
@icbaker, to answer your question, yes if we can identify the SEI NAL unit for Dolby Vision stream, and based on that can decide to skip the header bytes, it will resolve the issue. Thanks a lot. |
Does the bit I've bolded mean that when you play H.264-in-dolby-vision with CEA-608 subtitles, they work? If so, how does that work, because surely the same MIME type checks you've flagged here should fail with |
We haven't tried playing H.264(with CEA-608 subtitles) with Dolby Vision yet, but my guess is that it likely won’t work. |
@icbaker the problem with
Is that it would allow H265 Dolby Vision content to check Similarly you could also have the inverse where you are playing H264 Dolby Vision and it fails the first check but then checks To be honest I think ExoPlayer really needs to append Dolby Vision to the H264/H265 mime types vs having it as its own mime type since to my knowledge there's no dolby vision only codec it's always built on top of another existing codec. But this of course is a large change that touches a lot of pieces in ExoPlayer. We have other workarounds in our code due to the mime type being reported as Dolby Vision and the original codec being dropped from the mime type. As for content I'll reach out to our internal teams to see if we can help in adding the 608 embedded to your existing test asset. |
@icbaker I've sent a sample asset to android-media-github@google.com. It doesn't seem to want to play in ExoPlayer for some reason (didn't investigate too much) but it does execute the code path in FragmentedMp4Extractor. |
Issue: #1820 #cherrypick PiperOrigin-RevId: 691378476
Thanks for the sample, and for flagging the concerns with false-positives if we just inspect the NAL byte. I've gone for a different approach using the existing |
Thanks @icbaker, appreciate the quick action on this. Would you be able to provide an idea on when this will be in a version of Media3 that we can consume? |
This fix should be included in |
Version
Media3 main branch
More version details
627b7a3
Devices that reproduce the issue
All
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
Expected result
Captions are enabled and are rendered.
Actual result
Captions are enabled but are not rendered.
This occurs because the Dolby Vision metadata in the video track causes the mime type to be
video/dolby-vision
instead ofvideo/hevc
orvideo/avc
.In this line:
media/libraries/extractor/src/main/java/androidx/media3/extractor/mp4/FragmentedMp4Extractor.java
Line 1609 in 49337d9
NalUnitUtil.isNalUnitSei
always returns false because the function only checks for H264 or H25 mime types: https://github.com/androidx/media/blob/release/libraries/container/src/main/java/androidx/media3/container/NalUnitUtil.java#L342If the mime type is Dolby Vision the Sei NAL units get ignored.
Secondly for H265 Dolby Vision this check also fails:
media/libraries/extractor/src/main/java/androidx/media3/extractor/mp4/FragmentedMp4Extractor.java
Line 1632 in 49337d9
If Dolby Vision is or'd with the H265 format for the above 2 cases the issue is resolved. However, the fix obviously isn't that simple because H264 or H265 can in theory be Dolby Vision.
Media
Not applicable
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.The text was updated successfully, but these errors were encountered: