Skip to content

Video freezes / stutters on Firefox (Gecko) #186

@WofWca

Description

@WofWca

I.e. the FPS gets super low (like 0.5 - 1 frames per second).
This looks a lot like a browser regression bug. If the video is routed through AudioContext and the playback rate gets set to > 6.5, this starts happening. It's easier to reproduce for higher-resolution video.

This happens even without the extension:

ctx = new AudioContext();
v = document.querySelector('video');
src = ctx.createMediaElementSource(v);
src.connect(ctx.destination);
v.playbackRate = 7.5

It starts happening after a few seconds after the execution of the above code. Seeking the video temporarily fixes the issue. Setting playbackRate back to a lower value of 1 doesn't get rid of the freezes.

I was able to reproduce this on the following Firefox versions: 134.0a1, 132.0.1, 130.0b9, 128.4.0esr, 107.0.1, 103.0.2, 103.0.

On 116.0b8 it still starts to freeze, but switching the speed back to 1 eventually restores normal behavior. Hmmm or not. If you change playback rate a lot of times, it still becomes sluggish.
On 92.0b9, 97.0b9, 100.0.2, 101.0.1, 102.9.0esr I was unable to reproduce the bug at all, so looks like 103.0 is the first version with this bug.

It also looks like switching playbackRate often has to makes it more easily reproducible:

ctx = new AudioContext();
v = document.querySelector('video');
src = ctx.createMediaElementSource(v);
src.connect(ctx.destination);

switchesLeft = 20;
intervalId = setInterval(() => {
	v.playbackRate = 8;
 	// v.playbackRate = 8.25; // (a muted speed) also makes the bug appear.

	switchesLeft--;
	if (switchesLeft <= 0) {
		clearInterval(intervalId);
		v.playbackRate = 1;
		console.log('back to normal speed');
		return;
	}

	setTimeout(() => {
		v.playbackRate = 1.25;
	}, 100)
}, 300)

Tested on this video: https://download.blender.org/demo/movies/BBB/bbb_sunflower_1080p_30fps_normal.mp4.zip playing the local file, and some other local files. On YouTube I was unable to reproduce this.

This was reported by one of the users.

Workarounds

  • Set "Silence speed" to a lower value (e.g. 2).
  • Set "Silence speed" to 1.25 and enable the "experimental algorithm". The skipping efficiency will not degrade much, don't worry.
  • Use a Chromium-based browser (e.g. Brave, De-Googled Chromium, Chrome)
  • Set configuration option media.wmf.zero-copy-nv12-textures to false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions