View Galaxy.txt
Camera2: Hardware level: 1 | |
06-02 10:49:07.625 21849 21865 I Unity : Camera2: FrameSize 4032 x 3024 [2.5824869781268642] | |
06-02 10:49:07.625 21849 21865 I Unity : Camera2: FrameSize 4032 x 2268 [2.2948049056750834] | |
06-02 10:49:07.625 21849 21865 I Unity : Camera2: FrameSize 3984 x 2988 [2.558534596033433] | |
06-02 10:49:07.625 21849 21865 I Unity : Camera2: FrameSize 3264 x 2448 [2.1598687907924505] | |
06-02 10:49:07.626 21849 21865 I Unity : Camera2: FrameSize 3264 x 1836 [1.8721867183406695] | |
06-02 10:49:07.626 21849 21865 I Unity : Camera2: FrameSize 3024 x 3024 [2.2948049056750834] | |
06-02 10:49:07.626 21849 21865 I Unity : Camera2: FrameSize 2976 x 2976 [2.2628042229822007] | |
06-02 10:49:07.626 21849 21865 I Unity : Camera2: FrameSize 2880 x 2160 [1.9095425048844386] | |
06-02 10:49:07.626 21849 21865 I Unity : Camera2: FrameSize 2592 x 1944 [1.698821473568786] |
View CameraTextureInput.cs
/* | |
* NatCorder | |
* Copyright (c) 2020 Yusuf Olokoba. | |
*/ | |
namespace NatSuite.Recorders.Inputs { | |
using UnityEngine; | |
using UnityEngine.Rendering; |
View StreamCamera.cs
async void StartPreview () { | |
// Start the camera preview | |
ICameraDevice device = ...; | |
Texture2D previewTexture = await device.StartRunning(); | |
// Display the preview texture on a UI panel | |
rawImage.texture = previewTexture; | |
} |
View ICameraDevice.cs
/// <summary> | |
/// Camera device which provides pixel buffers. | |
/// </summary> | |
public interface ICameraDevice : IMediaDevice { | |
/// <summary> | |
/// Is the camera front facing? | |
/// </summary> | |
bool frontFacing { get; } |
View RecordAudio.cs
void StartRecording () { | |
// Start recording audio from the microphone | |
IAudioDevice device = ...; | |
device.StartRunning(OnSampleBuffer); | |
} | |
void OnSampleBuffer (float[] sampleBuffer, long timestamp) { | |
// `sampleBuffer` is linear PCM, interleaved by channel | |
} |
View IMediaDevice.cs
/// <summary> | |
/// Media device which provides media buffers. | |
/// </summary> | |
public interface IMediaDevice : IEquatable<IMediaDevice> { | |
/// <summary> | |
/// Device unique ID. | |
/// </summary> | |
string uniqueID { get; } |
View IAudioDevice.cs
/// <summary> | |
/// Audio device which provides sample buffers. | |
/// </summary> | |
public interface IAudioDevice : IMediaDevice { | |
/// <summary> | |
/// Audio sample rate. | |
/// </summary> | |
int sampleRate { get; } |
View TranscodeDemo.cs
using UnityEngine; | |
using NatCorder; | |
using NatExtractor; | |
public class TranscodeDemo : MonoBehaviour { | |
public string videoPath; // Path to video to be transcoded | |
void Start () { | |
// Create a frame extractor |
View AudioStream.cs
/* | |
* NatMic | |
* Copyright (c) 2019 Yusuf Olokoba | |
*/ | |
namespace NatMic.Recorders { | |
using UnityEngine; | |
using System; | |
using System.Runtime.CompilerServices; |
View MixAudio.cs
// Get a hardware microphone | |
var microphoneDevice = AudioDevice.GetDevices()[0]; | |
// Create a virtual device from an AudioSource component in game | |
var gameDevice = new VirtualDevice(audioSource); | |
// Create a mixer device that mixes audio from both devices | |
var audioDevice = new MixerDevice(microphoneDevice, gameDevice); | |
// Use the audio device like any other NatMic device | |
... |
NewerOlder