When I set Unity Recorder to .png image sequence, the game slows down from 60fps to 8fps. Is that normal?
Yes it is normal that encoding some files slows down you gameplay. How much it will be slowed down depends on several things:
- image size
- output format (PNG encoding slower than JPEG, ProRes slower than H.264)
- your hardware (disk specs, GPU)
Your output file will have the proper FPS however.
Cheers
Thank you. I’m getting about 21 fps with jpg, but only 8 fps with png. I’m using RTX 2080. I wonder what kind of specs would produce 60 fps with png output.
There might be some optimizations possible on the encoding/recording side, but there will always be some overhead that will slow down your FPS. You shouldn’t expect recording+encoding to add zero overhead to your rendering frame rate. Maybe exporting to a low image size (try 640x480?) will bring you closer to 60 FPS. What FPS do you get without any recorders, and what is your game view size?
I force fps to 60 (Application.targetFrameRate = 60), otherwise it runs at about 100fps when the game window is 1920x1080. So the png capture at this point is good for games with no user interaction.
I wonder if you could save to some lossless but fast format (bmp?) and then convert to png asynchronously?
This is definitely possible but it’s not the architecture we have for the Recorder package. You could do that yourself with our API.
Could you give an example of how this could be done, or is there any documentation about this you can point us to?
I second this post!
I had a closer look at my sample code for a custom Recorder and I noticed that as of today it still needs access to internal classes in the Recorder package. As such, you cannot yet write a custom Recorder that will fit nicely with the existing package. Apologies for misleading you.
Please be aware that we are aware of the need for users to create their custom Recorders and Encoders. The current public API has its limitations.
I can’t download UnityRecorder in the asset store, it says the package is no longer available.
Any alternatives?
You need to use the Package Manager
OOh, I see, I had to enable the preview packages in Project settings