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

HLS - AVC/HEVC track formats incorrectly assigned same mime type #3653

Closed
AntonAFA opened this issue Dec 31, 2017 · 9 comments
Closed

HLS - AVC/HEVC track formats incorrectly assigned same mime type #3653

AntonAFA opened this issue Dec 31, 2017 · 9 comments
Assignees
Labels

Comments

@AntonAFA
Copy link

Hello. Please consider following manifests.
Both of them contains HEVC and AVC codecs.

  1. DASH -
    http://cfvod.kaltura.com/dash/p/2035982/sp/203598200/serveFlavor/entryId/0_3ygb9zlt/v/2/pv/7/flavorId/0_,e8rbw59u,uf2z04po,oipic3cp,pyy89j5i,8o51rwag,i3u1m33j,77bwa8xe,a2xc8gja,ypuer7a3,8cyfpyos,vby88nhm,/name/a.mp4.urlset/manifest.mpd

  2. HLS - http://cfvod.kaltura.com/hls/p/2035982/sp/203598200/serveFlavor/entryId/0_3ygb9zlt/v/2/pv/7/flavorId/0_,e8rbw59u,uf2z04po,oipic3cp,pyy89j5i,8o51rwag,i3u1m33j,77bwa8xe,a2xc8gja,ypuer7a3,8cyfpyos,vby88nhm,/name/a.mp4.urlset/master.m3u8

Parsing dash manifest will create 2 video groups. First for hevc Formats and the second for avc. I understand that it happens due to the simple structure of the dash manifest(AdaptationSet). While in HLS it will create only one group and all of the Formats will have the same codec type, in this case hevc(if avc was the first codec type to appear in manifest all of them would be avc). As i saw, hlsParser parse stream right and create each Format with the correct codecType. But in some moment, probably during AtomParer it assign same codecType to all the Formats. Also it creates only one group of video Formats, so all of the avc Formats become unreadable by renderer and can not be played. I understand that possibly it happens because of the complex structure of hls manifest.
It would be grate if you can clarify why that happens and if there are any solution to such a use case.

Thanks, a lot.

@ElizaSapir
Copy link

+1

@ojw28 ojw28 added the question label Jan 2, 2018
@ojw28
Copy link
Contributor

ojw28 commented Jan 2, 2018

Answering the question parts:

  • It's correct behavior that the DASH manifest results in two TrackGroups where-as the HLS manifests only results in one. This correctly mirrors the different structures in the manifests themselves. For the DASH manifest to result in a single TrackGroup you'd need either (a) AVC and HEVC Representation elements to be contained by a single AdaptationSet element in the manifest, or (b) use of urn:mpeg:dash:adaptation-set-switching:2016 in the manifest to indicate support for switching between the two AVC and HEVC AdaptationSet elements. My understanding is (b) is the recommended approach. See DASH: Support cross-AdaptationSet seamless switching #2431 and the DASH-IF Interoperability Points as quoted in that issue.
  • Where AVC and HEVC tracks are contained by the same TrackGroup, you can enable adaptive switching between them using withAllowMixedMimeAdaptiveness as described in Couldn't adaptive different codecs in HLS stream #3500 (comment).

The following looks like a bug, since the codecs should be accurately carried into the formats of the tracks in the TrackGroup. Assigning to @AquilesCanta to take a look, and marking as a bug accordingly:

While in HLS it will create only one group and all of the Formats will have the same codec type

@ojw28 ojw28 added bug and removed question labels Jan 2, 2018
@ojw28 ojw28 changed the title HEVC + AVC manifest. HLS - AVC/HEVC track formats incorrectly assigned same mime type Jan 2, 2018
@AquilesCanta
Copy link
Contributor

AquilesCanta commented Jan 8, 2018

While in HLS it will create only one group and all of the Formats will have the same codec type

I don't think the codec propagation has any problems. However, I can reproduce an issue with the track's mime type for which a fix will be pushed soon. Please clarify if are referring to a codec specific issue.

@AntonAFA
Copy link
Author

Hey. Thank for your reply. I am not sure that i understood your reply regarding to "Please clarify if are referring to a codec specific issue".
I got hls manifest with mixed codec types. I expect that exoplayer will create separate Format groups for each codec. Like it is doing with dash manifest.

@AquilesCanta
Copy link
Contributor

The fix push will appear ref'd below, and you'll be able to try it out. But as @ojw28 explained above, the track group will be only one.

@AquilesCanta
Copy link
Contributor

If the content is actually the same, it is better for you to have all codecs in the same track group. You can either pick one codec and select only tracks with that codec, or both and adapt between them (by allowing mixed mime type adaptation). The latter is not possible with separate track groups. Even if they are in the same track group, you will be able to pick a subset of them (in your case, depending on the video formats's mimetype).

@OrenMe
Copy link

OrenMe commented Jan 11, 2018

@AquilesCanta how can we pick one codec? mappedTrackSelctor? can you please show an example?

@AntonAFA
Copy link
Author

Thank you. Do you have any time estimation/side branch for that fix. I just want to track and check it as soon as possible.

ojw28 pushed a commit that referenced this issue Jan 23, 2018
Issue:#3653

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182064250
ojw28 pushed a commit that referenced this issue Jan 23, 2018
This solves the problem of having dense tracks' ids change.
For example, if the available variants offer both HEVC and AVC video
tracks, all video samples will map to the same sample queue even if
IDs don't match.

Issue:#3653

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=182070486
@ojw28
Copy link
Contributor

ojw28 commented Jan 23, 2018

This is fixed in dev-v2.

@ojw28 ojw28 closed this as completed Jan 23, 2018
@google google locked and limited conversation to collaborators Jun 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants