<p>Yes, there's a better approach than using a screen recorder. You can capture frames directly inside Unity, using <a href="https://docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshot.html" rel="noreferrer"><code>ScreenCapture.CaptureScreenshot</code></a>. There's a choice of formats to save as, and you can use PNG so that, when you later assemble the frames into a video (using ffmpeg or another tool), you have full control over how much compression to use.</p>

<p>This function is very slow, because it reads back the framebuffer, encodes the image, and writes it to disk, all in the main thread. You may want to use it in combination with setting the <a href="https://docs.unity3d.com/ScriptReference/Time-captureFramerate.html" rel="noreferrer"><code>Time.captureFramerate</code></a> value. This setting lets you slow down Unity by completely disconnecting the in-game frame rate from real time. That is, if you set it to 30, the game will run at 30 fps as measured by <code>Time.deltaTime</code> and the calls to <code>Update</code> on your components, regardless of whether a frame takes a millisecond or a minute as measured by wall-clock time.</p>

CC BY-SA 4.0
2018-09-08T08:48:50.043Z
This is probably the best option. Thanks also for the `Time.captureFramerate` hack, I did not know that possibility.
L. Chaumartin
CC BY-SA 4.0
2018-09-07T08:20:45.620Z
2018-09-07T08:20:45.620Z
Dan Hulme
<p>I made an audio visualizer using Unity3D (you can see it <a href="https://www.youtube.com/watch?v=s8ORkq8ZR3Q" rel="nofollow noreferrer" title="here">here</a>) but I am not satisfied on the video quality, as the compression destroys the graphics. I recorded the screen during a real-time rendering. I tried many screen recorders, but always the same disappointment. </p>

<p>I want to try another approach, using non real-time rendering. I know Unity is made for real time rendering, but do you know if such a thing is possible ?</p>

CC BY-SA 4.0
2018-09-06T20:21:13.677Z
Could you add more detail on what you're aiming to achieve? Do you want a completely new approach that is not real-time, or are you looking to redirect the real-time output so it gets recorded directly rather than going to the screen? Or something else?
trichoplax is on Codidact now
CC BY-SA 4.0
2018-09-07T08:10:29.030Z
Are you asking "Is there a non-realtime" or "slower" rendering mode in Unity that will render in higher quality _OR_ are you wanting a lossless video recording approach? I don't know unity, but can you save each frame at the end of each render to create a sequence of images (e.g PNGs) and put them through a lossless or near-lossless video encoder?
Simon F
CC BY-SA 4.0
2018-09-11T08:32:16.500Z
It looks pretty good. You understand that if you view it immediately after uploading that you'll probably be viewing it at 360P and it will be a bit fuzzy, after an hour or so a (in the case of *that* video) 1080P version becomes available.
Rob
<rendering><unity><video>
Non real-time rendering on Unity3D
L. Chaumartin
# Non real-time rendering on Unity3D

(Asked by: username_0 on 2018-09-05)

I made an audio visualizer using Unity3D (you can see it [here](https://www.youtube.com/watch?v=s8ORkq8ZR3Q "here")) but I am not satisfied on the video quality, as the compression destroys the graphics. I recorded the screen during a real-time rendering. I tried many screen recorders, but always the same disappointment.

I want to try another approach, using non real-time rendering. I know Unity is made for real time rendering, but do you know if such a thing is possible ?

**Tags:** rendering, unity, video

> **Comments:**
> **username_1**: Could you add more detail on what you're aiming to achieve? Do you want a completely new approach that is not real-time, or are you looking to redirect the real-time output so it gets recorded directly rather than going to the screen? Or something else?  
> **username_2**: Are you asking "Is there a non-realtime" or "slower" rendering mode in Unity that will render in higher quality _OR_ are you wanting a lossless video recording approach? I don't know unity, but can you save each frame at the end of each render to create a sequence of images (e.g PNGs) and put them through a lossless or near-lossless video encoder?  
> **username_3**: It looks pretty good. You understand that if you view it immediately after uploading that you'll probably be viewing it at 360P and it will be a bit fuzzy, after an hour or so a (in the case of *that* video) 1080P version becomes available.  

---

## 1 answers

### Answer by username_4 on 2018-09-07. Score: 5 | Accepted answer

Yes, there's a better approach than using a screen recorder. You can capture frames directly inside Unity, using [`ScreenCapture.CaptureScreenshot`](https://docs.unity3d.com/ScriptReference/ScreenCapture.CaptureScreenshot.html). There's a choice of formats to save as, and you can use PNG so that, when you later assemble the frames into a video (using ffmpeg or another tool), you have full control over how much compression to use.

This function is very slow, because it reads back the framebuffer, encodes the image, and writes it to disk, all in the main thread. You may want to use it in combination with setting the [`Time.captureFramerate`](https://docs.unity3d.com/ScriptReference/Time-captureFramerate.html) value. This setting lets you slow down Unity by completely disconnecting the in-game frame rate from real time. That is, if you set it to 30, the game will run at 30 fps as measured by `Time.deltaTime` and the calls to `Update` on your components, regardless of whether a frame takes a millisecond or a minute as measured by wall-clock time.

> **Comments:**
> **username_0**: This is probably the best option. Thanks also for the `Time.captureFramerate` hack, I did not know that possibility.  

---

