question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slow scrubbing for videos

See original GitHub issue

Hi,

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:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gsouquetcommented, Mar 11, 2019

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.

1reaction
gsouquetcommented, Oct 24, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found