Slow scrubbing for videos
See original GitHub issueHi,
We have spotted that video scrubbing can be quite slow using VideoContext. It can drop to 4/5 fps. There are obviously a lot of factors that will come into play for that:
- Canvas drawingbuffer size
- Video dimensions
- Video encoding (whether it is optimised for fast decoding or not)
- Number of nodes that play in parallel
To make sure that we would have a fair benchmark, @sacharified came up with a reduced test case that compares:
- Native video element scrubbing
- Scrubbing and painting on a
2dRenderingContext
- Scrubbing and painting on a
WebGLRenderingContext
with the most simplistic shaders possible - Scrubbing using VideoContext with a single node attached to the graph
You can try it for yourself: https://codepen.io/Sacharified/pen/dgderG?editors=0010
We are currently trying to investigate what the bottleneck is but it is slightly unclear as there are a lot of boilerplate code. Is there some documentation somewhere that explain the WebGL program structure? That would really help to debug this issue further. If you have any lead please let me know
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
How to Adjust Your iPhone's Scrubbing Speed for Video and ...
Use this simple trick to scrub through music and videos at different speeds on your iPhone.
Read more >YouTube video scrubbing is VERY laggy in Safari
On pretty much every YouTube video I watch in Safari, using the arrow keys to skip ahead 5 seconds, or manually clicking another...
Read more >How do I make the audio/video scrubbing speed faster or ...
If the slider is at the bottom of the screen, move your finger up slightly as you fast forward or rewind and you...
Read more >Extreme lag when scrubbing through video timeline, advice on ...
So, I'm scratching my head because it's not like my storage or gpu are slow by any means, I do know my CPU...
Read more >H.264 slow scrubbing and playback performance
Jumping from one position to another, playback will happen immediately. B: H.264/AAC 1920x1080 25FPS ~3662kb/s. This video can't seem to handle ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I forgot to update this issue.
I think this is more a video encoding problem rather than a VideoContext problem. I dug deep on this one and realised that the way that VC approached this was as optimised as it could be.
Changing the encoding parameters of our videos made a huge impact here.
Safari just released a canvas debugger. It exposes all of the valid shaders for a WebGL canvas. https://webkit.org/blog/8452/canvas-debugging/
It might help us to better understand the structure of VideoContext