VRsun2
March 23, 2023, 10:56am
1
I’m using Unity 2021.3.21f1, Recorder version is 3.0.3.
I have a script that is supposed to automatically start a recording with RecorderWindow.StartRecording. But I get some errors:
WindowsVideoMedia error 0x80070020 while reading K:(project folder)\Recordings\movie_000.mp4
Context: Creating SinkWriter
Error details: Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird.
Track types:
UnityEditor.Media.MediaEncoder:.ctor (string,UnityEditor.Media.VideoTrackAttributes,UnityEditor.Media.AudioTrackAttributes[ ])
Unity.Media.CoreMediaEncoder:Construct (string,UnityEditor.Media.VideoTrackAttributes,UnityEditor.Media.AudioTrackAttributes[ ]) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/CoreMediaEncoder.cs:131)
Unity.Media.CoreMediaEncoder:Construct (string,UnityEditor.Media.VideoTrackAttributes,UnityEditor.Media.AudioTrackAttributes) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/CoreMediaEncoder.cs:117)
Unity.Media.CoreMediaEncoder:Construct (string,System.Collections.Generic.List1<Unity.Media.IMediaEncoderAttribute>) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/CoreMediaEncoder.cs:106) Unity.Media.MediaEncoderManager:Construct (Unity.Media.MediaEncoderHandle,string,System.Collections.Generic.List
1<Unity.Media.IMediaEncoderAttribute>) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/MediaEncoder.cs:378)
UnityEditor.Recorder.RecorderWindow:StartRecording (
VideoMediaEncoder::Create got unsupported format.
UnityEditor.Media.MediaEncoder:.ctor (string,UnityEditor.Media.VideoTrackAttributes,UnityEditor.Media.AudioTrackAttributes[ ])
Unity.Media.CoreMediaEncoder:Construct (string,UnityEditor.Media.VideoTrackAttributes,UnityEditor.Media.AudioTrackAttributes[ ]) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/CoreMediaEncoder.cs:131)
Unity.Media.CoreMediaEncoder:Construct (string,UnityEditor.Media.VideoTrackAttributes,UnityEditor.Media.AudioTrackAttributes) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/CoreMediaEncoder.cs:117)
Unity.Media.CoreMediaEncoder:Construct (string,System.Collections.Generic.List1<Unity.Media.IMediaEncoderAttribute>) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/CoreMediaEncoder.cs:106) Unity.Media.MediaEncoderManager:Construct (Unity.Media.MediaEncoderHandle,string,System.Collections.Generic.List
1<Unity.Media.IMediaEncoderAttribute>) (at Library/PackageCache/com.unity.recorder@3.0.3/Editor/Encoding/MediaEncoder.cs:378)
UnityEditor.Recorder.RecorderWindow:StartRecording ()
When I start a recording by pressing the according button in the editor tab, it works as expected. So the issue only occurs when trying to start the recording programmatically.
I get the RecorderWindow in the Start function and store it in a variable rw. Then in Update, after preparations have been triggered with a button press I check for a ready state; once reached, I call rw.StartRecording(). This is when the error occurs.
rooose
March 24, 2023, 6:38pm
2
Hi KayH,
Would you mind sharing your RecorderWindow settings and the script you are using to start the recording? I am having some trouble reproducing the issue.
VRsun2
March 27, 2023, 3:19pm
3
Thanks for taking the time to try to reproduce the problem. Turns out I was starting the recording repeatedly because of a missing check for a bool.
1 Like