unity3d-jp / FrameCapturer

export framebuffer, GBuffer or any RenderTextures from Unity to file. supported format: png, exr, gif, webm, mp4
MIT License
1.04k stars 164 forks source link

Empty Capture #52

Closed davidvjc closed 4 years ago

davidvjc commented 4 years ago

Hey guys,

Just tried the movie recorder in Unity 2020.1.0b5 using HDRP (Windows 10) - all I get is an empty .mp4 file of 0 bytes. The project is an unaltered standard HDRP demo scene created using the Unity Hub. I don't get any errors. Steps:

  1. Imported .unitypackage from link in documentation,
  2. Added a MovieRecorder to my camera,
  3. Set absolute path, format: mp4 and capture control: manual,
  4. Capture Target: Frame Buffer,
  5. Pressed "Start Recording" and then "End Recording after 5 seconds.

I get an appropriate Console Log on recording end: GBufferRecorder: EndRecording() UnityEngine.Debug:Log(Object)

Thanks! David

tincivilfx commented 4 years ago

So basically, OnPostRender() does not get called when you're in HDRP. OnPostRender() is where each frame data is extracted and inserted into the recorder's queue to write to disk.

You need to modify the code in MovieRecorder.cs to extract and insert the frame.