Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Support "UseMotionBlur" with the Scriptable Render Pipeline #394

Open
ertan-retinize opened this issue May 24, 2024 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@ertan-retinize
Copy link

ertan-retinize commented May 24, 2024

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

image

image

image

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 ()
@ertan-retinize ertan-retinize added the Bug 🐛 Something isn't working label May 24, 2024
@ertan-retinize
Copy link
Author

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.
image

@ertan-retinize ertan-retinize changed the title [Bug] Enabling "UseMotionBlur" corrupts exported video when capture mode is Offline Render [Bug] Enabling "UseMotionBlur" corrupts exported video when capture mode is Offline Render + URP May 27, 2024
@ertan-retinize
Copy link
Author

ertan-retinize commented May 31, 2024

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 ?

@ertan-retinize ertan-retinize changed the title [Bug] Enabling "UseMotionBlur" corrupts exported video when capture mode is Offline Render + URP [Bug] Enabling "UseMotionBlur" corrupts exported video when capture mode is Offline Render and render pipeline is URP Jun 5, 2024
@ertan-retinize
Copy link
Author

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 ?

@Chris-RH
Copy link
Contributor

Chris-RH commented Jul 16, 2024

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?

@ertan-retinize
Copy link
Author

ertan-retinize commented Jul 16, 2024

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:b__0 () (at Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Scripts/Internal/Mp4FileProcessing.cs:173)
System.Threading.ThreadHelper:ThreadStart ()

@MorrisRH
Copy link
Contributor

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.

@MorrisRH MorrisRH added enhancement New feature or request and removed Bug 🐛 Something isn't working windows labels Jul 17, 2024
@MorrisRH MorrisRH changed the title [Bug] Enabling "UseMotionBlur" corrupts exported video when capture mode is Offline Render and render pipeline is URP [Enhancement] Support "UseMotionBlur" with the Scriptable Render Pipeline Jul 17, 2024
@ertan-retinize
Copy link
Author

Thanks a lot @MorrisRH , we'll be looking forward for an update on this !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants