title: Unity: Record video from device camera
body: <p>I want a plugin or a library or a way to record video (sure with sound) in unity (windows standalone) from device camera.</p>
  
  <p>Currently, I am able to take screenshots using this camera. Someone says that I can take many screenshots and convert it to one video file. </p>
  
  <p>I found a plugin on Asset store called <a href="https://assetstore.unity.com/packages/tools/integration/camera-shot-19682" rel="noreferrer">Camera Shoot</a></p>
  
  <p>I want something like it but for windows.</p>
  
  <p><strong>Edit 1:</strong></p>
  
  <p>Now I am using a library that captures video from unity camera (virtual camera inside unity). I am previewing my camera feed on a canvas that is not shown in my application and I use this library to record this video.</p>
  
  <p>This may solve my problem, but another problem was found that I need to record microphone voice to add this audio to the recorded video.</p>
  
  <p>So now I am recording video (without sound) from the library, and record voice from microphone using another code, and after finish recording, I merge these 2 files together to get my desired file.</p>
  
  <p>A new problem appears again. The merging process (muxing and compressing) takes a long time (more than 10% of the recorded time) which makes leads to many issues.</p>
  
  <p>So I need another solution and prefered to be a plugin like the one above.</p>
  
  <p><strong>Edit 2:</strong></p>
  
  <p>I tried Unity VideoCapture Example in both editor and build. In unity editor, the application runs without errors but it didn't enter to this function "VideoCapture.CreateAsync()", as they said it didn't work with the editor.</p>
  
  <p>When I tried to build to windows standalone build, it gives me this error : "Assets/Scripts/Controllers/Other/VideoCaptureExample.cs(4,26): error CS0234: The type or namespace name 'WebCam' does not exist in the namespace 'UnityEngine.XR.WSA'. Are you missing an assembly reference?"</p>