I would like to play back a video on iPhone/iPad in the background of my game, with opengl rendered 3D on top. The video should speed up and slow down depending of the speed of the player. The video playback speed should be anything between 0 and 2 times regular speed (even faster max speed would be better, if the CPU can handle it).
Is it possible to adjust video playback speed like this? Also, I need to know the currently rendered video frame, so that certain events in the game can be synchronized to the video.
Related
I am using Unity to create movies. Right now, I create a scene and play it and record it in real time and export the video file. But I'd like render the scene as fast as possible and reduce the time for creating the movie.
How can I render simple scenes faster than real time in Unity? For example, if I have a 10-second movie at 24 frames/second and my machine can render 240 frames in a second, I'd like to finish the job in a second rather than wait for 10 seconds. Working with framerate and time might do the job but I was wondering if there is a better/simpler way to do it.
Unreal Engine's capture movie renders simple scenes faster than real time without me changing anything and I'd like to know if there is something similar in Unity.
Update: You can disable Cap FPS to speed up rendering if you are using the Unity recorder. I am using something else because I want to record the video in a Unity build.
I'm working on a VR project where at some points we will display video in front of the user. I'm looking for recommendations/answers into how to maintain focus on the video without causing eye strain on the users. I want to know how others have tackled this issue of showing video for VR headsets within their projects/games.
What I have tried so far is increasing/decreasing the size and distance of the video from the players eyes/head. I have found that since you can't do overlay or world space-camera with VR canvas, you have to result to general world space placement. This results in decreasing too small and close causing a splitting effect and also blurring the video. Increasing the size as resulted in no significantly noticeable changes.
Headset: HTC Vive (Regular and Pro versions)
I am using the Video player API that unity provides for playing a video on the surface texture. While I am changing the video clip after each update the FPS on the editor is really slow. The switching and loading the new video clip takes a lot of time (500-600 ms)
videoPlayer.clip = videoClips [vindex]; //this command used for changing the videoclip
I just put the timer before and after and found it consumes a huge amount of time.
Can anyone please tell me how to reduce the time and increase the FPS. Any alternative way or suggestion will highly be appreciated. (Platform: Unity Editor on windows)
If the videos are really small, you can consider to use multiple videoPlayer to play each video in the same time. Set the RenderMode to RenderTexture, and switch RenderTexture instead of videoClip.
surface.GetComponent<MeshRenderer>().material = videoPlays[vindex].targetTexture;
I learned to capture screenshot from unity game and I'm having my HD ones happily. By my still poor knowledge of animation I can't understand how many screenshots and with what delay to get from unity to render a reasonable quality mpeg video later in blender, say, for a 3 minute clip?
Any link to a tutorial is very welcomed. I sure found ready exntensions for in-game video from unity, but I want to DIY to learn something!
I found some tutorials about playing a fullscreen video on the iPhone, but I wonder if it is possible to play an embedded movie in the background of a openGl animated app?
The movie should just loop seamlessly and should not have any control buttons like play/pause/volume popping up while being played. If possible, then how about performance?
Decode next video frame
Upload frame bitmap to texture
Disable depth buffer reads/writes
Draw screen-sized textured quad using frame texture
Re-enable depth buffer reads/writes
Render your regular scene
Go to #1