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

Adds adaptive speed functionality #583

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

newice
Copy link

@newice newice commented Jan 27, 2020

Press A to toggle adaptive speed.
The speed then increases to double the preferred speed if video is silent and goes back to preferred speed if it is not silent anymore.

Press A to toggle adaptive speed.
The speed then increases to double the preferred speed if video is silent and goes back to preferred speed if it is not silent anymore.
@newice newice requested a review from igrigorik January 27, 2020 09:23
Copy link
Collaborator

@ChadBailey ChadBailey left a comment

Choose a reason for hiding this comment

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

I really like this feature, thanks so much for the time you put into it!

Sorry for the delay getting it merged, there are a couple of things holding it back that have nothing to do with the request itself so please be patient with us!

First is the big one, #595 has to be resolved before we can merge. Once that's done, I'm sure we'll have some merge conflicts that we'll have to work through.

Second one, I haven't had the chance to pull this and test it to make sure it works on a handful of the usual big websites from my machine.

Thanks for your contribution and patience!

inject.js Outdated
}
}
});
}

function toggleAdoptiveSpeed(v, controller) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you may have meant to name this toggleAdaptiveSpeed

Copy link
Author

Choose a reason for hiding this comment

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

You are right.

inject.js Outdated
tc.adaptiveSpeedAnalyserNode.getFloatFrequencyData(myDataArray);
var dbValue = Math.max(...myDataArray) + 100;
var quietZone = 45;
var eps = 4;
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does eps stand for?

Copy link
Author

Choose a reason for hiding this comment

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

I Thought of Machine epsilon. https://en.wikipedia.org/wiki/Machine_epsilon
But i think it should be named different. I just wanted to have a buffer zone so the speed does not jump around all the time.

@ChadBailey
Copy link
Collaborator

I tried this out as-is without updating it, and I can't seem to get it to work? Can you provide steps for testing?

@ChadBailey ChadBailey added question blocked:feedback We are waiting for clarification questions to be answered and removed question labels Feb 27, 2020
@ChadBailey ChadBailey added this to the 0.7.0 milestone Mar 26, 2020
@ChadBailey
Copy link
Collaborator

All of the big changes that required this to be put on hold are behind us now. I've slated for 0.7 release if we can get it worked out before then. @newice Can you confirm with me how I can test this enhancement?

@ChadBailey ChadBailey added the Testing This issue is in testing, waiting to be merged label Mar 26, 2020
@newice
Copy link
Author

newice commented Mar 29, 2020

How to test the enhancement:

Nothing else needed to set up.. @ChadBailey Did you have any errors in the console? I also addad a new button to the overlay controls. you can click it instead of the key.

@ChadBailey
Copy link
Collaborator

Nothing else needed to set up..

I was able to activate it, but in my tests it didn't actually do anything. I assume maybe it was just the lack of sufficient silence in the videos I tried? I'm unsure. This is why I was hoping for exact steps, like set the settings this way, go to this website, activate, from 0:00-1:50 you should see 1x speed, from 1:50-1:55 you should see 2.5x speed, etc.

@newice
Copy link
Author

newice commented Mar 30, 2020

This video is silent between the speaking: https://www.youtube.com/watch?v=kcs82HnguGc

  1. Start the Video
  2. Hit 'A' ==>When you activate adaptive speed the speed should go from 1 to prefered speed (in my case 1.8)
  3. As soon as the speaker stops talking the Speed switches to 2x preferred (in my case 3.6)
  4. while active you can not change the speed because it gets resetted by adaptive speed.
  5. When you deactivate adaptive speed it jumps to preferred speed (in my case 1.8).

Youtube hides the controls so you maybe don't see the change. Keep the mouse over the video moving to always see the current speed.

@ChadBailey
Copy link
Collaborator

thanks for the steps for testing. sorry for the delays in getting back to you, i've been busy with COVID-19 related tasks. i plan to test this soon

@ChadBailey ChadBailey added enhancement Needs Work and removed blocked:feedback We are waiting for clarification questions to be answered labels May 17, 2020
@newice newice requested a review from ChadBailey August 3, 2020 09:00
@newice
Copy link
Author

newice commented Aug 3, 2020

Finally i was able to update my pullrequest. So if anyone has the time i would appreciate a feedback.

Instead of using Preferred Speed as the normal speed, use lastSpeed.
So the user has the full control on which speed to watch
and still the silent parts are fast forwarded at adaprive speed.
@igrigorik
Copy link
Owner

@newice this is, fascinating! I took for a quick test drive, a few questions..

  • On YouTube my video periodically flashes to 0.0 (full pause) and then resumes -- guessing, that's not intended behavior?
  • Have you done any testing on what the CPU impact is when this is enabled?

newice added 3 commits October 1, 2020 23:06
@newice
Copy link
Author

newice commented Oct 1, 2020

@newice this is, fascinating! I took for a quick test drive, a few questions..

  • On YouTube my video periodically flashes to 0.0 (full pause) and then resumes -- guessing, that's not intended behavior?

This is strange. I never had the speed go to 0.0 For the silent phases i changed the speed from two times the prefered speed to an own setting whichyou can set in the plugin options. Default is 3. Maybe the setting is missing for some reason?

  • Have you done any testing on what the CPU impact is when this is enabled?

No unfortunately i have no experience in extended performance testing. activating the adaptive speed for the first time after page load usually takes about 0.1 second for me.

inject.js Outdated Show resolved Hide resolved
@fideliochan
Copy link

@newice @igrigorik @ChadBailey update on this please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Needs Work Testing This issue is in testing, waiting to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants