Unity Recorder movie output is too fast

Hey there,

I’m using the Unity Recorder 2.0.0-preview6 package with Unity 2018.3.8f1 on Windows 10, and I’m having some trouble with the movie output speed. When I render an MP4, the resulting video footage is faster than it should be when played in the editor, while the audio track is at the correct speed. For example, I have one recorder clip set up to record 10 seconds of the timeline in 4k. The resulting video output is 8 seconds. What’s even weirder, is that when I set the output to 1080p, the resulting video is 6 seconds.

Here is my setup:

  • I have one timeline in my scene, set to 30 FPS.
  • The Playable Director is set to update on the DSP clock, because the timeline is animated to an audio track.
  • I use a mixture of activation tracks, animation tracks with clips, and animation tracks recorded inline.
  • I have a RecorderClip set up in the timeline to output a 1080p MP4. Settings are shown in the screenshot.

cc @marief_unity

Having the same problem. The recorded video is way too fast. The video was designed to be in sync with the background music, but the recorded version is out of sync with audio playing at normal speed.
Unity 2018.3.14,
Recorder ver. 2.0.1-preview.1
Record format: mp4
Constant playback, Film(24), cap
@marief_unity

still running into this problem as well

I’d like to bump this issue, happens here too. It’s even worse if you’re using a video texture in the game, the video texture will play back at like 10x the speed it’s supposed to.

Can someone from Unity get in here and help to figure this out? Please?

I am trying to make some trailers and it is impossible to get the recorder to output at the correct speed.

Regards,
Carlos

I think I figured out a way to get the right speed in the output of the recorder! I set the sync in Quality Settings to every second v blank, I pressed the game window’s top right button VSync to activate it, and set the Recorder target setting in the top right to NTSC(29.97), and finally I unchecked Capture audio in the recorder. After I set these and recorded the output was at the right speed. Of course I had to take the video to AE or other software to like it to add the audio back.

I hope this helps someone.

Regards,
Carlos

3 Likes

Im having this same issue too. I tried your steps but cant figure out where/how to activate the game windows VSync “I pressed the game window’s top right button VSync to activate it”

Where is this buttoin exactly?

Any updates? That’s very annoying! Basically makes Unity Recorder totally useless

here:

5704690--596758--playwindow_vsync.jpg

And here as well:

This problem still occurs even when using the VSync setting above. To fix this you can manually control the frame of the video the VideoPlayer is displaying like this:

void Update() {
    videoPlayer.Pause();
    if (videoPlayer.frame / videoPlayer.frameRate < Time.time) {
        videoPlayer.StepForward();
    }
}

This works if the framerate of the playing video is lower than the framerate you are trying to record at (if not then you could try replacing the if statement with a while loop). And it assumes you start playing the video when the scene starts. If not just subtract the time the video starts from Time.time above.
You also might be tempted to do this by setting the frame number directly with videoPlayer.frame = .... But don’t do this as it just causes more problems. Using StepForward and Pause is your best option.
@Teejay5

2 Likes

So I had the same problem - a Video texture playing on a billboard (plane) in the engine, will not record with UnityRecorder.
I’ve done all the error checking so far:

  • Set Vblank and even tried Vblank to every second frame, in game window and main settings/
  • Set fps to 30 in Unity Recorder
  • set timeline to 30 fps (the billboard video is on a plane gameobject and has a simple translation movement on x axis)
  • Video on billboard is also 30 fps and plays fine in Unity when NOT recording with UnityRecorder.
    - Even worse should you decide to play the video at slower speed using Unity Player slider and recording to 4k.

Solution:
Luckily I own the VR panorama asset from the asset store and it has a script called videoSync. Which is the same code as the post by @SolutionStudios

Come on Unity, UnrealEngine is miles ahead in Video production and Unity is lagging in fixing solutions that make or break a feature.

Has this previous problem with Unity Recorder not recording Camera iSO/aperture and depthof field been fixed?

@cguertin , any insights?
Kind Regards

1 Like

Hi everyone,

Sorry to have missed this thread.

Synchronization between audio and rendering with video recorder should be fixed at leat in the latest Recorder package (2.2). If you still have issues, please share it here (ideally with a small project to reproduce and a ticket submitted in the Editor so that you can track our progress).

Note: With the Recorder Window, for video recording, you must select frame rate option to Constant and matching your main Timeline frame rate. With a Recorder clip on Timeline this is set automatically.

@Dirrogate The VideoPlayer and the Unity Recorder are not generally compatible because the VideoPlayer does not support the use of Time.captureFramerate and this is how the recorder changes the execution speed to perform non-realtime rendering. Check this thread which lists workarounds or solutions depending on your usage: Frame accurate video or image sequence playback

@Dirrogate Re. animation clip recording of Camera ISO and aperture, we have not yet a solution. But this is high on our priority list.

Best,
Mathieu

2 Likes

Another warning, about synchronization when baking anything: Make sure that the Playable Director update method is set to Game Time. DSP clock is for real-time playback only.

2 Likes

@Matjio for some Reason it still doesn’t work for me. :frowning:

I want to record Animation Clips from gameobjects in sync to music because I am basically trying to record a rythm based aniamtion that can be replayed in the timeline.
Oddly enough when I simply use the example Code from the GameObjectRecorder Class it seems to work just fine:

I have not yet tried to record something over a longer period of time so I don’t know if the recording will still go out of sync over a longer period.

The Timelie Recorder in comparison is completely unuseable for me, though. I notice drastically delayed/slowed down input during Play mode and while I try to keep in sync with music as soon as I load in the animation clip into the timeline I can immediately see that even over 1 - 2 minutes the clip is only half the length of the time it is supposed to be.
As with the others in this thread the clip plays expectedly waaay too fast.

The Playable Director is set to GameTime.
I am using Unity 2019.4.4f1 LTS
The gameobject recorded is using BOLT Scripts but the scene has only this one gameObject in it for testing reasons. So It’s not likely that it’s the overall scene performance capping the recording.

this helped me out a lot, only issue now is i’m a bit stumped at the logic to have the video player loop once it’s played through. any suggestions?

You can just tick the option ‘Loop’ on the video player script

Enabling Vsync like this solved my problem. Thanks!

Setting the recorder fps to NTSC(29.97) is what worked for me. Idk why it can’t work at higher frame rate.

3 Likes

None of these “solutions” helped me about this. Sadly these bugs still exist in the latest versions and keeps making it unusable…

1 Like