Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

HEVCDecoderConfigurationRecord gives incorrect codec string when NAL units have emulation_prevention_three_byte #312

Closed
l-law opened this issue Jan 3, 2018 · 5 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@l-law
Copy link
Contributor

l-law commented Jan 3, 2018

System info

Operating System: Ubuntu 16.04
Shaka Packager Version: 22c758e

Issue and steps to reproduce the problem

Use EsParserH265 to parse HEVC ES (extracted from TS packets).
Check codec_string() from VideoStreamInfo from NewStreamInfoCB.
The output codec string is wrong and seems it didn't handle emulation_prevention_three_byte (0x000003).

What is the expected result?
Give me a correct codec string, eg. hev1.1.6.L150.90

What happens instead?
It gave me hev1.1.C0000006.L0.0.90.0.0.3
0xC is exactly the inversion of 0x3.
Profile became L0 because it read the wrong byte.
And there was one extra 0x3 in the end.

<Please attach the input files or email to shaka-packager-issues@google.com.>

Attached VPS for reference.
vps_capture

@kqyang
Copy link
Contributor

kqyang commented Jan 3, 2018

Good catch! The problem comes from the incorrect handling in https://github.com/google/shaka-packager/blob/master/packager/media/codecs/h265_byte_to_unit_stream_converter.cc#L56, where we shouldn't just copy the data without escaping it first. Do you have a sample input we can use for verification after the fix?

@kqyang kqyang added the type: bug Something isn't working correctly label Jan 3, 2018
@l-law
Copy link
Contributor Author

l-law commented Jan 8, 2018

What kind of sample input is needed? I can prepare a few H265 packets in binary, is this enough for the verification?

@kqyang kqyang self-assigned this Jan 8, 2018
@kqyang
Copy link
Contributor

kqyang commented Jan 8, 2018

@l-law Preferably H265 packets packaged in TS. I already have a fix available. I'll push it some time this week. It also works for us if you can verify after it is pushed.

@kqyang
Copy link
Contributor

kqyang commented Jan 10, 2018

@l-law The fix is just pushed. Let us know the results when you have a chance to test. Thanks.

@l-law
Copy link
Contributor Author

l-law commented Jan 30, 2018

Sorry for late reply. I have updated my copy to include the fix and it worked, codec string for H265 is the same as I expected.

@kqyang kqyang added this to the 2.0.0 milestone Feb 2, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 19, 2018
@shaka-project shaka-project locked and limited conversation to collaborators Apr 19, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants