Version: 2023.2
言語: 日本語
ビデオファイルの互換性
ビデオファイルについて

Clock management with the Video Player component

This section describes the different time update modes available for the Video Player component and how it interacts with them.

You can use the Video Player component to control how to time video playback relative to other interactive behaviors. For example, you can synchronize video playback with animation or with audio. You can do this through the following time update modes:

  • Audio Digital Signal Processing (DSP) clock
  • Game time
  • Unscaled game time

The Video Player follows Unity’s capture frame rate (Time.captureFramerate) and capture delta time (Time.captureDeltaTime).

When you specify a capture frame rate, a Video Player’s playback becomes synchronous, which means the Video Player displays all frames at the expected time stamp even if it has to delay the overall game execution. Another advantage of the capture frame rate is that, it also blocks preparation and seek operations, which leads to consistent and accurate results. However, this might slow down game execution especially when the video must remain synchronized with the rest of the scene. For example, Unity Recorder uses this special behavior of time to produce smooth recordings.

The capture frame rate only affects game time. If a Video Player uses unscaled game time or audio DSP clock while capture frame rate is in use, the Video Player ignores the capture frame rate and uses asynchronous playback. That means, the Video Player skips or repeats frames if needed, and preparation or seek tasks are asynchronous to prevent blocking of playback. However, this only happens if you select game time as the time update mode for Video Player.

Note: On WebGL, Unity’s Video Player doesn’t support synchronous playback with captureFramerate. By default, it uses the normal asynchronous playback that’s described with the Game time update mode.

Audio DSP clock

The audio DSP clock comes from the Audio module. You can access it through AudioSettings.dspTime.

Game time

Game time is set in the Time module. You can access it using C# through Time.time. When you use game time, also known as scaled game time, Unity follows the Time Scale value set in the Time window. You can also modify the Time Scale value using C# through Time.timeScale. However, if the capture frame rate or capture delta time have non-zero values, game time changes according to the rules that govern the time manager’s capture frame rate feature.

Note: Capture delta time is the same as 1 divided by the capture frame rate. It’s another view of the same information.

Unscaled game time

When you use Unscaled game time, the Video Player ignores the Time Scale value. Unscaled game time comes from the Time module. You can access it using C# through Time.unscaledTime.

その他の参考資料

ビデオファイルの互換性
ビデオファイルについて
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961