Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Video Unity Recorder slow down.

Discussion in 'Audio & Video' started by username132323232, Jun 18, 2021.

  1. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    When I set Unity Recorder to .png image sequence, the game slows down from 60fps to 8fps. Is that normal?

    recorder.PNG
     
    Rocaguinarda likes this.
  2. unitybru

    unitybru

    Unity Technologies

    Joined:
    Jan 28, 2020
    Posts:
    225
    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
     
  3. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    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.
     
    CAWMUN_GAMES likes this.
  4. unitybru

    unitybru

    Unity Technologies

    Joined:
    Jan 28, 2020
    Posts:
    225
    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?
     
  5. username132323232

    username132323232

    Joined:
    Dec 9, 2014
    Posts:
    477
    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?
     
  6. unitybru

    unitybru

    Unity Technologies

    Joined:
    Jan 28, 2020
    Posts:
    225
    This is definitely possible but it's not the architecture we have for the Recorder package. You could do that yourself with our API.
     
    chadfranklin47 likes this.
  7. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    221
    Could you give an example of how this could be done, or is there any documentation about this you can point us to?
     
    username132323232 likes this.
  8. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    296
    I second this post!
     
  9. unitybru

    unitybru

    Unity Technologies

    Joined:
    Jan 28, 2020
    Posts:
    225
    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.
     
    spikezart and chadfranklin47 like this.
  10. awsapps

    awsapps

    Joined:
    Jun 15, 2021
    Posts:
    74
    I can't download UnityRecorder in the asset store, it says the package is no longer available.
    Any alternatives?
     
  11. chadfranklin47

    chadfranklin47

    Joined:
    Aug 11, 2015
    Posts:
    221
    You need to use the Package Manager
     
    spikezart likes this.
  12. awsapps

    awsapps

    Joined:
    Jun 15, 2021
    Posts:
    74
    OOh, I see, I had to enable the preview packages in Project settings
     
    chadfranklin47 likes this.