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

not to download captions if button unpressed #1058

Closed
kuznetcoff777 opened this issue Oct 9, 2017 · 17 comments
Closed

not to download captions if button unpressed #1058

kuznetcoff777 opened this issue Oct 9, 2017 · 17 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@kuznetcoff777
Copy link

Have you read the FAQ and checked for duplicate issues:yes

What version of Shaka Player are you using:latest

Can you reproduce the issue with our latest release version:on demo

Can you reproduce the issue with the latest code from master: on demo

Are you using the demo app or your own custom app: demo

If custom app, can you reproduce the issue using our demo app:

What browser and OS are you using: win7x64+chrome

What are the manifest and license server URIs:https://shaka-player-demo.appspot.com/demo/#asset=//storage.googleapis.com/shaka-demo-assets/sintel-mp4-wvtt/dash.mpd;lang=ru
(you can send the URIs to [email protected] instead, but please use GitHub and the template for the rest)

**What did you do?**opened stream and unpressed CC button

What did you expect to happen? player does not download captions

What actually happened? player downloads captions anyway

@vaage
Copy link
Contributor

vaage commented Oct 9, 2017

@kuznetcoff777 We always stream subtitles so that when someone enables them, they are immediately present. If we did not do this, they would have to wait for the subtitles to be available. Since subtitles consume so little bandwidth we feel that this minor cost in bandwidth usage is a minor price to pay for user experience.

@vaage vaage added status: working as intended The behavior is intended; this is not a bug and removed needs triage labels Oct 9, 2017
@kuznetcoff777
Copy link
Author

kuznetcoff777 commented Oct 10, 2017

"Since subtitles consume so little bandwidth we feel that this minor cost in bandwidth usage is a minor price to pay for user experience." - yes, from user side it is not so bad situation. But from streamer side...
I want to mention that in DASH there is a good decision was made to divide init.mp4 and mp4. Init file in our case is about 1KB, not so big, but in long-term perspective it is economy of traffic. In our case caption file minimum size is 32KB. So, for example, if we have 100000 of users that dont need captions and they watch stream for 1 hour (10sec fragments) - we get excess traffic ((32/1024)*100000 *60 *60/10) = 1125000MB = 1,125TB - too huge
Moreover we get excess req/s for edge servers.

" If we did not do this, they would have to wait for the subtitles to be available." - i suppose it is not so worse situation if user will wait a little for new subs. Or it will be good if if cc button pressed then caption must be downloaded immediately and showed to user.

Otherwise I propose to make configurable parameter - by default player fetches captions as you described, and if it is off, then player start to fetch captions only after CC button is pressed.

@kuznetcoff777
Copy link
Author

I suppose it is readonable, isnt it?

@vaage
Copy link
Contributor

vaage commented Oct 12, 2017

@joeyparrish Is not in the office right now. It is his call. Once he is back in the office I will talk to him about it.

@joeyparrish joeyparrish self-assigned this Oct 16, 2017
@karlovich
Copy link

Hi gents,

The same situation in our application, but our fragment is 2 sec and subs chunk size is about 32kb (TTML base64 images). Ability to download subs by user selection could save much CDN traffic and improve network performance and playback quality as a result.

@vaage @joeyparrish, any updates on this?

@joeyparrish
Copy link
Member

I must be unfamiliar with this situation. Please forgive my ignorance.

@karlovich, you have 2s segments, and each 2s of subs is 32kB? That would be about 128 kbit/sec, which is as much bandwidth as some audio streams. I did not anticipate this. Your TTML contains base64-encoded images instead of actual text?

@kuznetcoff777, you have a minimum caption file size of 32kB? Why is this a minimum? Where does this limitation come from?

I am not sure how much work it will be to change this. A configurable parameter would not make it any easier to implement, so I'm not sure if that would make sense for us to add one.

We don't want anyone to waste 11 MB per person per hour on unused subs, so I will schedule this enhancement for the current milestone. Thank you for being patient with us while we try to understand the problem better.

@joeyparrish joeyparrish added type: enhancement New feature or request and removed status: working as intended The behavior is intended; this is not a bug labels Oct 17, 2017
@joeyparrish joeyparrish added this to the v2.3.0 milestone Oct 17, 2017
@kuznetcoff777
Copy link
Author

kuznetcoff777 commented Oct 17, 2017

"you have a minimum caption file size of 32kB? Why is this a minimum? Where does this limitation come from?" It is not a limitation, i just watched directory where fragments are situated and found mimimum size of our 10-sec caption fragments.

"We don't want anyone to waste 11 MB per person per hour on unused subs, so I will schedule this enhancement for the current milestone. Thank you for being patient with us while we try to understand the problem better." - it will be perfect, thanks!

@karlovich
Copy link

karlovich commented Oct 17, 2017

@joeyparrish

Your TTML contains base64-encoded images instead of actual text?

Yes

you have 2s segments, and each 2s of subs is 32kB?

Depends on content inside. 32kB is max size but many chunks have two images inside.

That would be about 128 kbit/sec, which is as much bandwidth as some audio streams.

Seems yes, one more audio stream in background.

Please see possible variations:
30.4 кВ (two images inside) TTML-base64-m4s-Two-Images-Inside.txt
16.2 кВ (one image inside) TTML-base64-m4s-One-Image-Inside.txt
0.68 kB (empty) TTML-base-64-m4s-Empty.txt

@joeyparrish
Copy link
Member

We are going to try to tackle this as part of v2.3. Depending on how complex it turns out to be, it may have to be deferred until v2.4.

@joeyparrish joeyparrish removed their assignment Nov 20, 2017
@joeyparrish
Copy link
Member

This will appear in v2.3, and is available in the nightly build now: https://nightly-dot-shaka-player-demo.appspot.com/demo/

@kuznetcoff777
Copy link
Author

@joeyparrish
Opened stream https://nightly-dot-shaka-player-demo.appspot.com/demo/#asset=//storage.googleapis.com/shaka-demo-assets/sintel-mp4-wvtt/dash.mpd;lang=ru

But when button is unpressed it still fetches subtitles, screenshot is attached
wtt

@kuznetcoff777
Copy link
Author

@joeyparrish @michellezhuogg
Guys, reopen ticket, problem is not solved!!!

@joeyparrish joeyparrish reopened this Nov 27, 2017
@joeyparrish
Copy link
Member

We have been looking into the issue, but forgot to reopen the ticket. We should have it fixed soon. Thanks!

@joeyparrish
Copy link
Member

This should be fixed in the nightly build now: https://nightly-dot-shaka-player-demo.appspot.com/demo/#asset=//storage.googleapis.com/shaka-demo-assets/sintel-mp4-wvtt/dash.mpd;lang=ru

All fixes for this will appear in the v2.3 release.

shaka-bot pushed a commit that referenced this issue Feb 15, 2018
In our previous fixes for issue #1058, we made it so that we
remove the text engine when not displaying captions.
However, we did not clear MediaSource's buffered text. Thus, when
loading a new text stream after re-enabling the captions, the old
buffered text would still be displayed. Text tracks, in VOD content,
can potentially be a single file for the entire video. Thus, when
changing text languages while closed captions were disabled, the
actual captions did not change.

This modifies streaming engine to clear buffered text, to fix that
problem. It also updates unit tests.

Closes #1293

Change-Id: Iddf2591101286474862b52579d4cf6b464e450fb
joeyparrish pushed a commit that referenced this issue Feb 21, 2018
In our previous fixes for issue #1058, we made it so that we
remove the text engine when not displaying captions.
However, we did not clear MediaSource's buffered text. Thus, when
loading a new text stream after re-enabling the captions, the old
buffered text would still be displayed. Text tracks, in VOD content,
can potentially be a single file for the entire video. Thus, when
changing text languages while closed captions were disabled, the
actual captions did not change.

This modifies streaming engine to clear buffered text, to fix that
problem. It also updates unit tests.

Closes #1293

Change-Id: Iddf2591101286474862b52579d4cf6b464e450fb
@itaykinnrot
Copy link
Contributor

Our use case is that the captions are always hidden since we want to render them ourself (styling that will work cross browser...) and this "fix" just stop us from doing that. can we change it to not disabled?

@TheModMaker
Copy link
Contributor

@itaykinnrot See #1332. We'll be adding a configuration for this. Also note that you could write your own TextDisplayer to use our text pipeline and then still use player.setTextTrackVisibility.

@joeyparrish
Copy link
Member

I think the intended way for you to render them yourself is to use the TextDisplayer plugin interface. See also the default implementation, SimpleTextDisplayer, which delegates to the browser's native rendering.

I'm not sure of the details of what you are doing, but you may also be interested in bug #1332. In that isue, we realized that in order to support native controls, we need a new option to stream without regard for the display state. This may also help you.

yairans added a commit to kaltura/playkit-js-dash that referenced this issue Mar 7, 2018
upgrade shaka to 2.3.3 for shaka-project/shaka-player#979 fix
fix shaka v2.3.3 text tracks issue (hidden text tracks not handled see shaka-project/shaka-player#1058) by custom text displayer
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
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: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants