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

HEVC HLS packing throws errors #587

Closed
teb opened this issue May 3, 2019 · 14 comments
Closed

HEVC HLS packing throws errors #587

teb opened this issue May 3, 2019 · 14 comments
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@teb
Copy link

teb commented May 3, 2019

Command:

./packager --segment_duration=4
in=test_aac.mp4,stream=audio,output=/mnt/s/temp/out/audio_aac.mp4,playlist_name=audio_aac.m3u8,lang=eng
in=test_ec3.mp4,stream=audio,output=/mnt/s/temp/out/audio_ec3.mp4,playlist_name=audio_ec3.m3u8,lang=eng
in=test_HEVC_360x180_crf23_P1.mp4,stream=video,output=/mnt/s/temp/out/hevc_180p.mp4,playlist_name=hevc_180p.m3u8
in=test_HEVC_640x360_crf23_P2.mp4,stream=video,output=/mnt/s/temp/out/hevc_360p.mp4,playlist_name=hevc_360p.m3u8
in=test_HEVC_960x540_crf23_P3.mp4,stream=video,output=/mnt/s/temp/out/hevc_540p.mp4,playlist_name=hevc_540p.m3u8
in=test_HEVC_1280x720_crf23_P4.mp4,stream=video,output=/mnt/s/temp/out/hevc_720p.mp4,playlist_name=hevc_720p.m3u8
in=test_HEVC_1920x1080_crf23_P5.mp4,stream=video,output=/mnt/s/temp/out/hevc_1080p.mp4,playlist_name=hevc_1080p.m3u8
in=test_HEVC_1920x1080_crf20_P6.mp4,stream=video,output=/mnt/s/temp/out/hevc_1080pHQ.mp4,playlist_name=hevc_1080pHQ.m3u8
--hls_master_playlist_output /mnt/s/temp/out/h265_master.m3u8
--mpd_output /mnt/s/temp/out/h265.mpd

What happens instead?
Shakalog:
0503/121822:ERROR:box_definitions.cc(627)] Not implemented reached in virtual bool shaka::media::mp4::SampleDescription::ReadWriteInternal(shaka::media::mp4::BoxBuffer *)SampleDecryption type 0 is not handled. Skipping.
[0503/121822:ERROR:box_definitions.cc(627)] Not implemented reached in virtual bool shaka::media::mp4::SampleDescription::ReadWriteInternal(shaka::media::mp4::BoxBuffer *)SampleDecryption type 0 is not handled. Skipping.
[0503/121822:ERROR:box_definitions.cc(2091)] Not implemented reached in virtual bool shaka::media::mp4::MediaInformation::ReadWriteInternal(shaka::media::mp4::BoxBuffer *)
[0503/121822:ERROR:box_definitions.cc(2091)] Not implemented reached in virtual bool shaka::media::mp4::MediaInformation::ReadWriteInternal(shaka::media::mp4::BoxBuffer *)
[0503/121822:ERROR:box_definitions.cc(627)] Not implemented reached in virtual bool shaka::media::mp4::SampleDescription::ReadWriteInternal(shaka::media::mp4::BoxBuffer *)SampleDecryption type 0 is not handled. Skipping.

Manifest seems ok tho but the audio parts was missing from both HLS and Dash manifests..

Validator:

{
"dataVersion" : 1.1000000000000001,
"url" : "h265_master.m3u8",
"messages" : [
{
"errorParserCode" : -16237,
"errorComment" : "a URI found without leading a EXTINF / EXT-X-STREAM-INF.",
"errorDomain" : "CoreMediaErrorDomain",
"errorStatusCode" : -12642,
"errorRequirementLevel" : 1,
"errorParserLine" : "audio_aac.m3u8"
},
{
"errorParserCode" : -16237,
"errorComment" : "a URI found without leading a EXTINF / EXT-X-STREAM-INF.",
"errorDomain" : "CoreMediaErrorDomain",
"errorStatusCode" : -12642,
"errorRequirementLevel" : 1,
"errorParserLine" : "audio_ec3.m3u8"
},
{
"errorComment" : "Playlist codec type doesn't match content codec type",
"errorDomain" : "ValidatorErrorDomain",
"errorReferenceDataID" : 5,
"errorStatusCode" : -50083,
"errorRequirementLevel" : 1,
"errorDetail" : "Playlist: hev1, Content: hvc1"
},
{
"errorComment" : "Playlist codec type doesn't match content codec type",
"errorDomain" : "ValidatorErrorDomain",
"errorReferenceDataID" : 3,
"errorStatusCode" : -50083,
"errorRequirementLevel" : 1,
"errorDetail" : "Playlist: hev1, Content: hvc1"
},
{
"errorComment" : "Playlist codec type doesn't match content codec type",
"errorDomain" : "ValidatorErrorDomain",
"errorReferenceDataID" : 6,
"errorStatusCode" : -50083,
"errorRequirementLevel" : 1,
"errorDetail" : "Playlist: hev1, Content: hvc1"
},
{
"errorComment" : "Playlist codec type doesn't match content codec type",
"errorDomain" : "ValidatorErrorDomain",
"errorReferenceDataID" : 8,
"errorStatusCode" : -50083,
"errorRequirementLevel" : 1,
"errorDetail" : "Playlist: hev1, Content: hvc1"
},
{
"errorComment" : "Playlist codec type doesn't match content codec type",
"errorDomain" : "ValidatorErrorDomain",
"errorReferenceDataID" : 4,
"errorStatusCode" : -50083,
"errorRequirementLevel" : 1,
"errorDetail" : "Playlist: hev1, Content: hvc1"
},
{
"errorComment" : "Playlist codec type doesn't match content codec type",
"errorDomain" : "ValidatorErrorDomain",
"errorReferenceDataID" : 7,
"errorStatusCode" : -50083,
"errorRequirementLevel" : 1,
"errorDetail" : "Playlist: hev1, Content: hvc1"
}
],
"variants" : [
{
"playlistType" : "VOD",
"processedSegmentsCount" : 1842,
"url" : "hevc_180p.m3u8",
"hasDiscSequenceTag" : false,
"measuredMeanBitrate" : 219290,
"parsedSegmentsCount" : 1842,
"playlistMeanBitrate" : 667508,
"hasEndTag" : true,
"playlistCodecs" : "hev1.2.4.L63.90,ec-3,mp4a.40.2",
"playlistResolutionHeight" : 270,
"measuredMaxBitrate" : 982138,
"independentSegments" : false,
"audioGroup" : {
"playlistGroupID" : "default-audio-group",
"renditions" : [
{
"url" : "audio_aac.m3u8",
"persistentID" : 0
},
{
"url" : "audio_ec3.m3u8",
"persistentID" : 1
}
]
},
"closedCaptionGroup" : {
"playlistGroupID" : "CC",
"renditions" : [
{
"persistentID" : 2
}
]
},
"iframeOnly" : false,
"playlistKind" : "media",
"playlistMaxBitrate" : 1433996,
"playlistResolutionWidth" : 480,
"discontinuities" : [
{
"segments" : [
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 17989,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5728,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 4,
"mediaSequence" : 0,
"startTime" : -0.080000000000000002,
"segmentByteRangeOffset" : 25173
},
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 16099,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5730,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 4,
"mediaSequence" : 1,
"startTime" : 3.9199999999999999,
"segmentByteRangeOffset" : 43162
},
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 7974,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5731,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 4,
"mediaSequence" : 2,
"startTime" : 7.9199999999999999,
"segmentByteRangeOffset" : 59261

@teb
Copy link
Author

teb commented May 3, 2019

HLS Manifest:
`#EXTM3U

Generated with https://github.com/google/shaka-packager version b85e5c9-release

#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_aac.m3u8",GROUP-ID="default-audio-group",LANGUAGE="en",NAME="stream_6",AUTOSELECT=YES,CHANNELS="2"
audio_aac.m3u8
#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_ec3.m3u8",GROUP-ID="default-audio-group",LANGUAGE="en",NAME="stream_7",CHANNELS="6"
audio_ec3.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1433996,AVERAGE-BANDWIDTH=667508,CODECS="hev1.2.4.L63.90,ec-3,mp4a.40.2",RESOLUTION=480x270,AUDIO="default-audio-group"
hevc_180p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2371706,AVERAGE-BANDWIDTH=756725,CODECS="hev1.2.4.L63.90,ec-3,mp4a.40.2",RESOLUTION=640x360,AUDIO="default-audio-group"
hevc_360p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2971536,AVERAGE-BANDWIDTH=954069,CODECS="hev1.2.4.L90.90,ec-3,mp4a.40.2",RESOLUTION=960x540,AUDIO="default-audio-group"
hevc_540p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=3748742,AVERAGE-BANDWIDTH=1178391,CODECS="hev1.2.4.L93.90,ec-3,mp4a.40.2",RESOLUTION=1280x720,AUDIO="default-audio-group"
hevc_720p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=7712102,AVERAGE-BANDWIDTH=1751833,CODECS="hev1.2.4.H120.90,ec-3,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="default-audio-group"
hevc_1080p.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=12445774,AVERAGE-BANDWIDTH=2549225,CODECS="hev1.2.4.H120.90,ec-3,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="default-audio-group"
hevc_1080pHQ.m3u8`

@teb teb changed the title HEVC HLS packing trows errors HEVC HLS packing throws errors May 3, 2019
@kqyang
Copy link
Contributor

kqyang commented May 3, 2019

@teb It is present in the HLS output actually:

#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_aac.m3u8",GROUP-ID="default-audio-group",LANGUAGE="en",NAME="stream_6",AUTOSELECT=YES,CHANNELS="2"
audio_aac.m3u8
#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_ec3.m3u8",GROUP-ID="default-audio-group",LANGUAGE="en",NAME="stream_7",CHANNELS="6"
audio_ec3.m3u8

@teb
Copy link
Author

teb commented May 3, 2019

Yes its, there! Works on VLC, but
1.IOS, AppleTV, safari doesnt want to parse the manifest
2. Shaka throws the errors mentioned further up
3. Validator is complaining..

@teb
Copy link
Author

teb commented May 3, 2019

Validator says : "errorComment" : "Playlist codec type doesn't match content codec type"
It seems to a be a HEVC issue

@kqyang
Copy link
Contributor

kqyang commented May 3, 2019

@teb Can you replace "hev1" with "hvc1" in playlist to see if it works?

Can you also provide a sample stream to us? You can email or share with shaka-packager-issues@google.com if it cannot be shared publicly.

@teb
Copy link
Author

teb commented May 3, 2019

so, u mean hvc1.2.4.L63.90 ?

@kqyang
Copy link
Contributor

kqyang commented May 3, 2019

Yes.

@teb
Copy link
Author

teb commented May 4, 2019

Validator was suddenly happy at least.. i need to wait til monday to re-confirm all our players tho

@teb
Copy link
Author

teb commented May 6, 2019

I can confirm that HEVC for HLS works fine, both in the validator and also with IOS 10.x++ for AppleTV, Iphones, ipads etc.. + safari as long as we use HVC1 in the manifest..
Hev1 works in Android tho...
Can anyone explain why the difference now in the HEVC world ? But in AVC its the same "mime/id code" ?

@kqyang
Copy link
Contributor

kqyang commented May 6, 2019

@teb There are more than one codec ids for avc as well actually (avc1, avc2, avc3, avc4 etc).

avc1 and hvc1 are used to indicate standard avc/hevc streams without parameter sets in the samples; while avc3 and hev1 have parameter sets in the samples.

This is a bug in Shaka Packager. We'll fix it.

Can you also provide a sample stream to us, which can speed up the fix? You can email or share with shaka-packager-issues@google.com if it cannot be shared publicly.

@kqyang kqyang added type: bug Something isn't working correctly and removed needs triage labels May 6, 2019
@shaka-bot shaka-bot added this to the v2.4 milestone May 6, 2019
@teb
Copy link
Author

teb commented May 7, 2019

email sent!

I also noticed that the "segmentDurationTag" is most of the time 4 sec, as configured, but sometimes its 1.5 sec, 2.6 sec etc... Know why?

{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 72705,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5763,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 4,
"mediaSequence" : 34,
"startTime" : 135.91999999999999,
"segmentByteRangeOffset" : 2646515
},
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 83899,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5764,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 6.4400000000000004,
"mediaSequence" : 35,
"startTime" : 139.91999999999999,
"segmentByteRangeOffset" : 2719220
},
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 23838,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5765,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 1.5600000000000001,
"mediaSequence" : 36,
"startTime" : 146.36000000000001,
"segmentByteRangeOffset" : 2803119
},
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 62553,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5766,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 4,
"mediaSequence" : 37,
"startTime" : 147.91999999999999,
"segmentByteRangeOffset" : 2826957
},
{
"discontinuityDomain" : 0,
"segmentByteRangeLength" : 36429,
"format" : "fragmentedMP4",
"url" : "hevc_180p.mp4",
"dataID" : 5767,
"videoFrameRate" : 25,
"videoStartsWithIDR" : true,
"segmentDurationTag" : 4,
"mediaSequence" : 38,
"startTime" : 151.91999999999999,
"segmentByteRangeOffset" : 2889510
},

@kqyang
Copy link
Contributor

kqyang commented May 7, 2019

@teb New segments start at the key frame only, so it could be of an unusual keyframe.

@teb
Copy link
Author

teb commented May 8, 2019

All segments start with an IDR frame, the rest are normal i-frames due to scenecut.. Im using a 4 sec gop structure so its bound to happen with some "extra" i-frames.. Looks like the packager is either missreading the gop structure..

@bence-csire
Copy link

@teb
I just read your issue with i-frames and IDR frames and I would like to add my research about it.
Few months ago I had the same issue with a different packager and in h264. Not that packager nor FFmpeg make difference between IDR and i-frame.

Also with our encoder the different quality profiles sometimes have different i-frames (IDR-s are the same in every profile).
Hopefully this informations could help you. If you have any question feel free to ask, I will try to answer.

@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Aug 8, 2019
@shaka-project shaka-project locked and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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

4 participants