[Windows] The first frame of the recorded videos are black when using D3D12
Unity version
6000.0.51f1
Unity editor platform
Windows
AVPro Movie Capture edition
Full
AVPro Movie Capture Version
5.3.0
Which Windows version(s) are you using?
Windows 11 Pro
Which graphics API(s) are you using?
Direct3D 12
Hardware
13th Gen Intel(R) Core(TM) i9-13900HX 2.20 GHz Nvidia GTX 4070 8gb 32.0 GB RAM 2.79 TB Storage
Which capture component are you using?
Capture From Screen
Capture mode
Realtime
Which output mode are you using?
Video file
Video codecs
H264
Audio source
Unity
Audio codecs
AAC
Any other component configuration
- Render Pipeline: HDRP
The issue
The first frames of the recorded videos are black. This flash does not happen in Unity 2023.1.20f1.
- We already; fade a black overlay out, render a few warm-up frames (explicit Camera.Render() + WaitForEndOfFrame()), skip ~10 frames before arming capture.
- We tried starting capture on the nextframe boundary, deffering UI/audio/thumnail code: still reproduces the issue
- We implemented a content-aware gate: the camera was downsampled to a 64x64 temp RT and we performed AsyncGPUReadback to compute average luminance. We only allowed a capture when the frame is non-black. The probe reported that it was non black but the first encoded frames are still black.
The UseWaitForEndOfFrame property had no effect on the issue, same with start delay.
For context these are Tour videos, the camera follows a walking path around a room and records as it does, it's a fairly simple implementation.
A couple of questions:
- Is Unity 6 supported? (We are in the process of upgrading to this)
- Has the issue been reported before? (I've been unable to find any matching bugs)
I will try and send an email with an example video.
Log output
Hi, thanks for bringing this to our attention. Could you retest using D3D11 and see if the issues still occurs for you please.
Hi, I ran it with DX11 and it did indeed fix the issue.
Though we are tied to using DX12 (for pathtracing) so unfortunately this workaround doesn't work for us.
Same issue here. With Unity 6.2 and the latest version of the package. Applying delays before rendering the video did not help. Reverting to DX11 fixes the issue.
https://github.com/user-attachments/assets/c29cb021-353e-45a7-86ce-99730f78fa79 https://github.com/user-attachments/assets/75c3ab46-6de0-4dbd-8740-9cb216d09ebd
We have a similar issue on iOS, audio is recorded but all frames are black
@genereddick
Please open a new issue for this.
Please open a new issue for this.
https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/issues/480