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

Playback rates higher than 400% #1764

Open
bloomav opened this issue Feb 21, 2024 · 7 comments
Open

Playback rates higher than 400% #1764

bloomav opened this issue Feb 21, 2024 · 7 comments
Labels
enhancement 🚀 New feature or request macOS macOS platform Windows Windows platform

Comments

@bloomav
Copy link

bloomav commented Feb 21, 2024

It would be nice to have the ability to adjust the playback float to a value greater than 4.

I can play videos encoded with the HAP codec smoothly at up to 1200% of the original speed on other software on the same computer.

Thanks for making a plugin that works so well at 400% anyway!

@Chris-RH
Copy link
Collaborator

Increasing playback rate usually places more demand on the video decoder and also on the disk/network source, so these limit how high you can set the playback rate. Obviously running Unity itself will have increased overheads as well.

What platform are you using?
What have you been using to play the videos faster?

@bloomav
Copy link
Author

bloomav commented Feb 21, 2024

OK, I have built this PC for this purpose with a RAID drive and decent GPU. I seem to be able to run the same clips at 1000% of the original speed on Resolume without any issues.

I've also use similar videos with VDMX on a Mac rig with similar specs and I was running playback rates this high without an issue.

@Chris-RH Chris-RH added enhancement 🚀 New feature or request Windows Windows platform macOS macOS platform labels Feb 21, 2024
@MorrisRH
Copy link
Collaborator

You can set the playback rate to values higher than 4x by calling mediaPlayer.Control.SetPlaybackRate. It's set to a maximum of 4 in the editor as we need a reasonable max value to make the slider useful. Simply do the following to playback a video at 30x speed:

	IEnumerator Start()
	{
		MediaPlayer mediaPlayer = null;
		if (!TryGetComponent<MediaPlayer>(out mediaPlayer))
		{
			yield return null;
		}

		// Wait for end of frame to make sure the media player has been initialised
		yield return new WaitForEndOfFrame();

		mediaPlayer.Control.SetPlaybackRate(30.0f);
	}

@bloomav
Copy link
Author

bloomav commented Feb 27, 2024

Thanks for taking the time to post that. Unfortunately, that doesn't seem to work for me and I have already tried something similar via VS as it still seems to be capped at 400%.

I can confirm the correct float (30 in your example) is displayed in the Media Player component while I'm running in editor view and I've also tried changing the range in the Media Player script but that didn't help either.

@bloomav
Copy link
Author

bloomav commented Mar 22, 2024

I can confirm it works and at a much higher frame rate on MacOS when using OpenCore on the same system. Could it be related to the APFS filesystem?

@MorrisRH
Copy link
Collaborator

No idea why using OpenCore would make a difference.
Would be interesting to know the spec of the machine you're using and the kind of HAP file you're playing (codec, resolution, frame rate, etc.).

@bloomav
Copy link
Author

bloomav commented Mar 23, 2024

I'm not sure either but here are my relevant specs in case it helps and please let me know if you want more details:

Gigabyte X299X MB
10980XE CPU
64GB RAM
AMD Radeon VII GPU
960 PRO SSD (MacOS)
4 X 970 EVO Plus SSD RAID (Media)

The videos I'm using are encoded in HAP A at 3840 X 2160 with 120fps and it looks like the exact same project in MacOS is handling 3 of them playing at the same time with at least 10x the playback and the build is running at around twice the frame rate compared to Windows.

Basically, I'm using audio input levels to drive the playback rate of video loops and I've had good results using VDMX to achieve this on the my old X99 board using the Clover boot loader which is why I thought I'd test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚀 New feature or request macOS macOS platform Windows Windows platform
Projects
None yet
Development

No branches or pull requests

3 participants