Open Giantbean opened 1 month ago
When removing all of the code in the start function which was copied from the PDF and Web documentation
CaptureFromScreen capture = _capture.GetComponent<CaptureFromScreen>(); capture.IsRealTime = false; capture.FrameRate = 15f; capture.StopMode = StopMode.FramesEncoded; //capture.StopAfterFramesElapsed = capture.FrameRate * 10f; //Can not convert Int to float but this is what the documentation recommends? capture.NativeForceVideoCodecIndex = -1; capture.VideoCodecPriorityWindows = new string[] { "H264", "HEVC" }; //capture.StartCapture(); //If we want to start recording on start.
- I tried to edit this ↑ code formatting but it's not working. Sorry.
The video saves again. I will continue to test to see if the issue is intermittent as it may be similar to a few other issues reported by users or it may just be that the documentation examples are out of date.
AVPro Movie Capture Version
5.1.6f1 / Desktop Edition
Which platform is your question for?
Windows
Your question
I am trying to savea file with a specific name however I am getting an error:
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 ()
I'm setting the name and trying to make the file with:
`using UnityEngine; using RenderHeads.Media.AVProMovieCapture; using System; using System.Text; using UnityEngine.SceneManagement;
//[RequireComponent(typeof(CaptureFromScreen))] public class ScreenCaptureManager : MonoBehaviour { [SerializeField] CaptureBase _capture = null; private string videoFileName = string.Empty;
}`
It seemed like it was recording videos but with a different name and when I got the name working it started showing the "can't find moov or mdat chunks" error that seems to be linked to the h254 mp4 codec processing.
P.S. Unity 2022.3.20f1