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

Add unsupported codecs detection #2164

Conversation

nicosang
Copy link
Contributor

@nicosang nicosang commented Sep 7, 2017

Hi,

as explained in issue #1643, only codec of the first representation is verified by dash.js. Unfortunately, the others codec are not tested. In this PR, when an unsupported codec is detected, the representation is deleted from the adaptation.

Nicolas

…ction returns codec from the specific representation. If not, it returns codec of the first representation
@dsparacio
Copy link
Contributor

I am going to pull this PR local and test against the known issue listed in last release for Axinom content.


// Filter codecs that are not supported
// But keep at least codec from lowest representation
i = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think if we do the same but using filter method of the array? I think that could help to better understand it.

Ex:

realAdaptation.Representation_asArray.filter((_, i) => {
	if (i === 0) return true;

	codec = dashManifestModel.getCodec(realAdaptation, i);
	if (codec && !capabilities.supportsCodec(VideoModel(context).getInstance().getElement(), codec)) {
		log('[Stream] codec not supported: ' + codec);
		return false;
	}
	return true;
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @epiclabsDASH ,

indeed, you can add a commit with this modification. The filter method is already used in other parts of the code : not a problem for me! ;-)

Nicolas

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem. Just my thought but happy to add the commit myself.

By the way, thanks for the PR, it is really useful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add this was tested and works well. @epiclabsDASH I will leave it to you to commit filter and merge. I can test again if you need it, just ping

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Many thanks

@@ -430,6 +434,26 @@ function Stream(config) {
}
}

function filterCodecs(type) {
const realAdaptation = dashManifestModel.getAdaptationForType(manifestModel.getValue(), streamInfo.index, type, streamInfo);
let codec;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codec could be moved inside the .filter method and declared const?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. Honestly, I thought about that but limited myself to avoid touching too much...

@bbcrddave, thanks for the comment.

@nicosang
Copy link
Contributor Author

Hi all,

as suggested by @bbcrddave in issue #2167, the call to canPlay function is replaced by isTypeSupported function.

Nicolas

@epiclabsDASH
Copy link
Contributor

epiclabsDASH commented Sep 12, 2017

We need to take care with this change. The only disadvantage I see on using isTypeSupported is it is supported by less browsers/devices/versions. So, it is ok moving to isTypeSupported, as pointed out by @bbcrddave seems more appropriated, but makes sense keeping canPlay as a "fallback" for cases where isTypeSupported is not available.

We also need to do some testing to be sure isTypeSupported is not raising false negatives. I remember in the past there were issues in Chrome/Firefox with the implementation of this method and I am afraid this is going to affect us.

@epiclabsDASH
Copy link
Contributor

epiclabsDASH commented Sep 13, 2017

In my tests everything was fine with isTypeSupported.

Any other thought? Otherwise seems like a good change to be merged.

@epiclabsDASH epiclabsDASH merged commit 38d4a1d into Dash-Industry-Forum:development Sep 26, 2017
@nicosang nicosang deleted the addCodecsUnsupportedDetection branch September 26, 2017 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants