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

Fixed quality level using Flashls parameters? #562

Open
jcampbell1710 opened this issue Dec 1, 2016 · 11 comments
Open

Fixed quality level using Flashls parameters? #562

jcampbell1710 opened this issue Dec 1, 2016 · 11 comments

Comments

@jcampbell1710
Copy link

Is there a way to assign a fixed quality level in Flashls parameters?

In the "flashls - Chromeless HLS Flash player" test page at http://flashls.org/flashls-0.4.0/examples/chromeless, I noticed there is a setting "Set Level". This works, and when it is set, only the specified level is used - the bandwidth does not change, and if the buffers run out, the video just stops. However, I see that this page sets that parameter with a direct call using the Flash API, i.e., with playerSetLevel(level). However, I don't see this exposed in any of the published settings, and I looked through the source and saw no call to this method other than through the same sample page that was part of the flashls distribution.

How would I do a fixed level setting? Is there a way that I am missing? If there is no way, can you suggest a workaround?

I'm using Flowplayer 6.0.4, and I presently have the following configuration. startfromlevel and seekfromlevel start and seek the video at a certain level, as designed, but do not keep it there, also as designed. I see nothing in the documentation that is merely called level.

scope.playerData.api = flowplayer(flowplayerTargetElement,
{
    key: lmsEmbedObjectResponse.key,
    swf: '/scripts/lib/flowplayer-6.0.4/flowplayer.swf',
    swfHls: '/scripts/lib/flowplayer-6.0.4/flowplayerhls.swf',
    embed: false,
    ratio: 9 / 16,
    autoplay: scope.controlData.autoPlay, // NOTE: http://stackoverflow.com/questions/12496144/can-you-autoplay-html5-videos-on-the-ipad
    splash: ((scope.controlData.autoPlay || scope.isBackgroundSplashMissing) ? false : (scope.itemData.splashUrl ? scope.itemData.splashUrl : true)),
    // splash: (scope.controlData.autoPlay ? false : true), // Force splash with no image
    clip: {
	autoPlay: false,
	subtitles: subtitles,
	sources: [
	    // Good URI, this is the one you want
	    {type: 'application/x-mpegurl', src: lmsEmbedObjectResponse.hlsVideoSourceUrl}
	],
	flashls: {
		startfromlevel: 0,
		seekfromlevel: 0,
		lowbufferlength: 10,
		minbufferlength: 10
	}
    }
});
@phloxic
Copy link

phloxic commented Dec 1, 2016

Flowplayer HTML5 version 6.x has no specific API for flash hls. Manual hls level selection is only possible with the hlsjs plugin: https://flowplayer.org/docs/plugins.html#hls-quality-selection

However, Flowplayer HTML5 version 7 will offer manual hls level selection for flash hls as well, see: flowplayer/flowplayer#1080

@jcampbell1710
Copy link
Author

Unfortunately, the issue I'm trying to solve is in Flash HLS only, since my problem is under non-HTML5 versions of IE. Is there any way you can recommend that could work around the API to do a manual level selection?

@phloxic
Copy link

phloxic commented Dec 2, 2016

I don't know what the problem is you're trying to solve?

@jcampbell1710
Copy link
Author

I am supporting HLS streaming to Flash-dependent browsers, and customers keep complaining about poor rendering in lower-bandwidth environments. While we are improving bandwidth where we can and recommending customers change to use HTML5-conformant browsers, some internal policies mandate use of IE on pre-Windows 8.1 environments, so we're stuck with Flash and they will be frustrated without the bandwidth solution.

In an effort to keep the visual experience steady (if not optimal), they want me to configure Flowplayer and FlashLS to keep from going down to the audio-only channels at startup (hence starfromlevel=0, seekfromlevel=0) and stay out of them through the length of the playback, even if this means the video has to pause for buffering. The first part works fine, and there is always video when the playback starts, but the bandwidth causes the stream to degenerate to audio-only after a few seconds. Plus, when the video is raised to a higher quality in environments with good bandwidth, the image distorts as it is is being promoted - we get pixel blocks.

I see no way to configure the parameters to set a minimum quality level or to make the channel switch any more graceful,, so I settled on the idea of just fixing it at a low or medium quality level and unconditionally forgo the attempt to render the highest qualities within these IE environments. That solves both problems - no audio-only playback occurs, and no pixelation occurs due to a stream upshift. Though I saw a way to set a fixed level in the Chromeless HLS Flash Player page (see above), it looks like that environment uses direct calls on the Flash media object to set the level, but this, as you pointed out, this is not in directly available from the API.

I tried the same method by doing a getElementsByTagName() to get the Flash object that Flowplayer creates in the document, and to call the playerSetLevel() method directly from it, as what appeared to be done in the Chromless HLS Flash Player page (see above). For some reason, playerSetLevel() wasn't available from the object.

So - I'd like to know if: 1) there is a way to configure Flowplayer/FlashLS to avoid the lowest, audio only stream with the AAC files, or 2) it is possible bypass the API in a reliable way to use a fixed stream that does not change.

Is there also possibly a way to intervene on the downloaded manifest and remove the audio-stream from configuration altogether? That might also work.

I do not have any way to change the asset encodings or the manifests.

Thanks!

@phloxic
Copy link

phloxic commented Dec 2, 2016

This sounds in part like encoding probs in your streams, but be that as it may, as I said, manual quality selection will be avaible for flash hls with the next release which we are working on right now.
It sounds also like you have to doctor on the symptoms instead of curing the cause. One of the big advantages arguably of HLS is that manifests are just text files, and are easily edited ...

@jcampbell1710
Copy link
Author

jcampbell1710 commented Dec 2, 2016

True but I cannot change the installed manifests. Is there a way within Flowplayer to intervene as they are loaded and remove the audio-only quality configuration from being considered? Like a "post-download, pre-load" event?

@phloxic
Copy link

phloxic commented Dec 2, 2016

No, there isn't. And as far as I can see there won't be for flash hls even in fp 7. Sorry.
With the hlsjs plugin you can set the minAutoBitrate option - https://github.com/dailymotion/hls.js/blob/v0.6.12/API.md#minautobitrate - but we won't put all bells and whistles into the flash backend - Flash is more and more depracated by major browsers.
Feel free to submit a patch, this is probably what you want to look at: https://github.com/flowplayer/flowplayer/blob/dev/lib/as/HLSStreamProvider.as

@jcampbell1710
Copy link
Author

Then that brings me to going around the API, as I said above, using playerSetLevel()? Do you have any examples of code that call that?

@phloxic
Copy link

phloxic commented Dec 3, 2016

With Flowplayer 7 you will be able to do api.quality(2) where 2 is the hls level index.
But to exclude variants (which seems to be the actual problem in your scenario) you would need a configuration setting for flashls which has the same effect as hlsjs' minAutoBitrate, and not a method.

@jcampbell1710
Copy link
Author

jcampbell1710 commented Dec 3, 2016 via email

@phloxic
Copy link

phloxic commented Dec 4, 2016

To re-iterate: what will be added in fp 7 is manual level selection, i.e. the audio only level would still be there for selection and ABR.
To exclude levels from being selected by ABR and/or manual selection you'd need the equivalent of hls.js' minAutoBitrate - or an API for flash hls engine specific methods, events etc. - and this is not planned. As much as we'd like to offer it in an ideal world, it would mean allocating a lot of resources (creation, maintenance, support) on a feature set which is not the focus of Flowplayer HTML5 and rapidly on the wane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants