[Enhancement] Support "UseMotionBlur" with the Scriptable Render Pipeline
Unity Version
2021.3.13
AVPro Movie Capture Version
4.7.11
Which platform(s) are you using?
Windows
Which OS version(s) are you using?
Windows 10.0.22631 Build 22631
Which rendering API(s) are you using?
Direct3D 11
Hardware
No response
Which capture component are you using?
Capture From Screen
Capture mode
Offline
Which output mode are you using?
Video file
Video codecs
H264
Audio source
Manual
Audio codecs
AAC
Any other component configuration
The issue
Enabling "Use Motion Blur" on CaptureFromCamera component with "Offline Render" mode corrupts the output video file. It exports just fine if I either set motion blur bool to false or set render mode to realtime.. in my case using realtime render is not acceptable so I'd like to proceed with offline render and enable motion blur if possible.
Unity version: 2021.3.13 AVPro Video version (number and edition (trial/core/ultra/enterprise)): 4.7.11 Operating system version: Windows 10.0.22631 Build 22631 Device model: Video specs (resolution, frame-rate, codec, file size): any resolution, 60FPS, H264
To Reproduce
Import URP and create and assign a render pipeline to your graphics settings. create a default renderer and assign it to your camera Set the render mode to "offline render" Enable motion blur Capture something for a few seconds via "CaptureFromCamera" Once capture is stopped it'll throw an error into the console
Log output
can't find moov or mdat chunks
UnityEngine.Debug:LogError (object)
RenderHeads.Media.AVProMovieCapture.MP4FileProcessing:Process (System.IO.Stream,System.IO.Stream) (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:243)
RenderHeads.Media.AVProMovieCapture.MP4FileProcessing:ProcessFile (string,string,RenderHeads.Media.AVProMovieCapture.MP4FileProcessing/Options) (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:218)
RenderHeads.Media.AVProMovieCapture.MP4FileProcessing:ProcessFile (string,bool,RenderHeads.Media.AVProMovieCapture.MP4FileProcessing/Options) (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:185)
RenderHeads.Media.AVProMovieCapture.MP4FileProcessing/<>c__DisplayClass32_0:b__0 () (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:162)
System.Threading.ThreadHelper:ThreadStart ()
Some extra notes I've just discovered:
If I disable "streamable audio" it doesn't throw the exception I've mentioned above but the output video is still comes as corrupted.
Hi @Chris-RH Could you please have a look at this issue whenever you're available ? I'd love to know if there's any workaround or even better... a hotfix ?
Hi @Chris-RH and @MorrisRH , Is there any update you guys could make on this ticket ? Is there any workaround or a newer version where this is fixed ?
AVPro Movie Capture 4.7.11 is over 2 years old now; have you been able to reproduce it in the trial version of AVPro Movie Capture version 5?
Hi @Chris-RH yes I've just tried it and its reproducible in the trial version as well.
Here's the full stack from the trial version:
can't find moov or mdat chunks UnityEngine.Debug:LogError (object) RenderHeads.Media.AVProMovieCapture.MP4FileProcessing:Process (System.IO.Stream,System.IO.Stream) (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:270) RenderHeads.Media.AVProMovieCapture.MP4FileProcessing:ProcessFile (string,string,RenderHeads.Media.AVProMovieCapture.MP4FileProcessing/Options) (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:245) RenderHeads.Media.AVProMovieCapture.MP4FileProcessing:ProcessFile (string,bool,RenderHeads.Media.AVProMovieCapture.MP4FileProcessing/Options) (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:201) RenderHeads.Media.AVProMovieCapture.MP4FileProcessing/<>c__DisplayClass32_0:<ProcessFileAsync>b__0 () (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:173) System.Threading.ThreadHelper:ThreadStart ()
Our current implementation for "Use Motion Blur" relies on the OnRenderImage callback in the MonoBehaviour interface which unfortunately (according to the Unity documentation) is not available when using the Scriptable Render Pipeline.
Because of this no actual frames are ever written out hence the video post-processing failing with can't find moov or mdat chunks.
We will look into reimplementing Motion Blur for the Scriptable Render Pipeline but for now you will need to make sure it's disabled.
Thanks a lot @MorrisRH , we'll be looking forward for an update on this !
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. If you wish to continue this issue, then please create a new issue as we do not monitor closed issues.