-
Notifications
You must be signed in to change notification settings - Fork 132
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
[Proposal] scte214 - use supplemental codec instead of base codec if it's supported #1307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also have two other questions:
- Can
supplementalCodec
be defined at theAdaptationSet
level in an MPD (likecodec
I think)? In which case we should also parse it when found there. - The WASM DASH parser also has to be updated, do you know how to do it or do you want me to do it instead?
Yes the |
I also found out that both SCTE 214 and HLS* indicate the possibility of having multiple supplemental codecs, with a given separator (I think space for DASH SCTE214, and a comma for HLS). * note: we do not offer first class support for HLS yet - putting |
@@ -213,6 +213,17 @@ export default function parseRepresentations( | |||
codecs = codecs === "mp4a.40.02" ? "mp4a.40.2" : codecs; | |||
parsedRepresentation.codecs = codecs; | |||
} | |||
|
|||
let supplementalCodecs: string | undefined; | |||
if (representation.attributes.supplementalCodecs != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't you use a !==, in order to verify also the type or the existing isNullOrUndefined method in the utils?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used to check if the value is either null
or undefined
,
@peaBerberian is there any recommandations about using !=
or the function !isNullOrUndefined
?
Both syntax exists in the project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we now try to avoid relying on double equals in the RxPlayer as:
- double equals' behavior might not be understood by every dev
- it's more explicit when reading to have the exact conditions written
- it avoid some classes of bug where we wrote double equals just by lazyness.
Here the intent is to have to check explicitely for what can happen. In some situations where onlynull
xorundefined
are possible at first, we may create a bug in future code if ever the other value become possible.
There are some areas of the code still relying on the == null
trick, but that's old logic we ultimately want to replace them by more explicit code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, should I change all the !=
to !isNullOrUndefined
in the parse_representation.ts
file, or should I do another MR for this change ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you want, both are good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here isn't it only undefined
though? I'm unsure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think too it's only undefined
but as a precaution I didn't want to change the behavior of the API.
src/parsers/manifest/dash/js-parser/node_parsers/__tests__/utils.test.ts
Outdated
Show resolved
Hide resolved
@@ -120,19 +122,19 @@ export default function parseRepresentations( | |||
const parsedRepresentations : IParsedRepresentation[] = []; | |||
for (const representation of representationsIR) { | |||
// Compute Representation ID | |||
let representationID = representation.attributes.id != null ? | |||
let representationID = !isNullOrUndefined(representation.attributes.id) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm under the impression than none of those attributes can be set to null
, in which case the proper way of fixing that double equal to make it more explicit would be to just check against undefined
instead
I've been wondering. Do we ever want to rely on the old The only case we've now seen of actual In the scenario where we never want to rely on the non-used codec anyway, because it is already known which one we use on |
I think we can set One thing that I was wondering is about changing the device: |
All those kinds of usages I know of for now work with two pages, one on the sending device, and one on the receiving device, which both would run their RxPlayer locally. Though I guess sending chunks from a sender to be decoded in a receiver should theoretically be possible, I'm unsure of how it would interact with the blocking |
…alCodec in the representation
@@ -30,3 +31,33 @@ export function getSegmentTimeRoundingError(timescale: number): number { | |||
return config.getCurrent().DEFAULT_MAXIMUM_TIME_ROUNDING_ERROR * timescale; | |||
} | |||
|
|||
const supplementalCodecSeparator = /[, ]+/g; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, just the indexes
directory is normally only for what we call the segment "index" here, which the way segments are announced in the MPD.
So that's probably not the right place for this util
LGTM, just I had one last comment about the file where one of the utils is declared |
I forgot can you unstage |
Context
This PR add partial support for the SCTE-214 related to Dash.
This PR add in particular the support of the
scte214:supplementalCodecs
attribute in.mpd
ManifestsSupplemental codecs are defined as backwards-compatible codecs enhancing the experience of a base layer codec.
If the supplemental codecs are supported by the device, we should use them instead of the base codec, this would allow to play the medias with a better experience for users.
SCTE-214: https://www.scte.org/standards/library/catalog/scte-214-1-mpeg-dash-for-ip-based-cable-services-part1-mpd-constraints-and-extensions/
Implementation
The proposed logic for this improvement is:
supplementalCodec
.MediaSource.isTypeSupported
on the supplementalCodec to verify if it's supported.Example
Given the following Manifest:
dvh1.08.01
the used codec should behvc1.2.4.L63.B0
dvh1.08.01
the used codec should bedvh1.08.01
Work in progress
supplementalProfiles
, do we need to have the same logic ?supplementalCodecs
on the AdaptationSet