Unity-Technologies / GenericFrameRecorder

This GitHub package is DEPRECATED. Please get the new Unity Recorder from the Asset Store (https://assetstore.unity.com/packages/essentials/unity-recorder-94079) Use the editor builtin Bug Reporter to report issues. You can track and vote for issues on the Issue Tracker (https://issuetracker.unity3d.com)
MIT License
534 stars 66 forks source link

Performace about 4K video OutPut. #40

Closed frideal closed 6 years ago

frideal commented 6 years ago

Dose GenericFrameRecorder Use Multi thread when Output 4K Mp4 file?

When I upgrade My computer device config:

Window10 64 bit Intel Core i9-7900 @ 3.30GHZ 525GB ssd Gtx 1080 ti 11GB

The Recorder process always output about 10fps (My scene just contains just One character)

frideal commented 6 years ago

Texture2D.ReadPixels(); about 50ms

frideal commented 6 years ago

public static void fcLock(RenderTexture src, TextureFormat dstfmt, Action<byte[], fcPixelFormat> body) { var tex = new Texture2D(src.width, src.height, dstfmt, false); RenderTexture.active = src; tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0, false); tex.Apply(); body(tex.GetRawTextureData(), fcGetPixelFormat(tex.format)); UnityEngine.Object.Destroy(tex); }

In the Profiler I found that the bottleneck of GenericFrameRecorder is ReadPixels (about 50ms - 60ms).

jasonm-unity commented 6 years ago

at the moment, the recorder do not use async read back from the grafics card, so yes recording has a significant impact on frame rate.

frideal commented 6 years ago

thanks for your reply.