![]() |
VOOZH | about |
dotnet add package djaus2_MauiMediaRecorderVideoLib --version 2.0.0
NuGet\Install-Package djaus2_MauiMediaRecorderVideoLib -Version 2.0.0
<PackageReference Include="djaus2_MauiMediaRecorderVideoLib" Version="2.0.0" />
<PackageVersion Include="djaus2_MauiMediaRecorderVideoLib" Version="2.0.0" />Directory.Packages.props
<PackageReference Include="djaus2_MauiMediaRecorderVideoLib" />Project file
paket add djaus2_MauiMediaRecorderVideoLib --version 2.0.0
#r "nuget: djaus2_MauiMediaRecorderVideoLib, 2.0.0"
#:package djaus2_MauiMediaRecorderVideoLib@2.0.0
#addin nuget:?package=djaus2_MauiMediaRecorderVideoLib&version=2.0.0Install as a Cake Addin
#tool nuget:?package=djaus2_MauiMediaRecorderVideoLib&version=2.0.0Install as a Cake Tool
A .NET MAUI library for Android video recording (no Audio) using MediaRecorder with camera preview and stabilization features.
Now waits for the user to accept Camera before starting the camera preview.
Both Release and Debug versions of Host app work.
Nb: (Private Repository) The solution of test app plus this lib as one solution.
djaus2/MauiMediaRecorderVideoAndroidApp
This library is being developed to target a sporting Photoiming app. See djaus2/PhotoTimingDjaus
Start by creating a new .NET MAUI project or using an existing one.
Install the package via NuGet:
dotnet add package MauiMediaRecorderVideoLib
Also need to install the following NuGet package:
dotnet add package CommunityToolkit.Maui.Camera
Nb: CommunityToolkit.Maui.Camera is in the library but needs a reference in the App as it uses the Toolkit Peview.
Android/Manifest.xaml:<uses-permission android:name="android.permission.CAMERA" />
Android/MainActivity.cs: public class MainActivity : MauiAppCompatActivity
{
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState); // Ensure base initialization always occurs
VideoKapture.RequestPermissionsStatic();
}
}
This is point at which the app requests permissions. The method actually iterates through the permissions in the Android/Manifest file and requests them.
The following needs updating:
using MauiMediaRecorderVideoLib;
// Initialize the service
var videoRecorderService = new AndroidVideoRecorderService();
await videoRecorderService.InitializeAsync();
// Assuming you have a GraphicsView named 'cameraPreview' in your XAML
videoRecorderService.SetPreviewSurface(cameraPreview);
// Configure recording options
videoRecorderService.SetVideoFPS(30); // Optional: Set FPS
videoRecorderService.SetImageStabilization(StabilizationMode.Locked); // Optional: Set stabilization
// Start recording
string outputFilePath = Path.Combine(FileSystem.CacheDirectory, "myVideo.mp4");
await videoRecorderService.StartRecordingAsync(outputFilePath);
// Pause recording
await videoRecorderService.PauseRecordingAsync();
// Resume recording
await videoRecorderService.ResumeRecordingAsync();
// Stop recording
await videoRecorderService.StopRecordingAsync();
// Release resources when done
await videoRecorderService.CleanupAsync();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-android35.0 net9.0-android35.0 is compatible. net10.0-android net10.0-android was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.2 | 249 | 7/16/2025 |
| 3.0.1 | 209 | 7/16/2025 |
| 3.0.0 | 227 | 7/16/2025 |
| 2.5.1 | 183 | 7/11/2025 |
| 2.5.0 | 192 | 7/11/2025 |
| 2.4.3 | 214 | 7/6/2025 |
| 2.4.2 | 225 | 7/6/2025 |
| 2.4.0 | 225 | 7/6/2025 |
| 2.3.0 | 225 | 7/6/2025 |
| 2.2.2 | 248 | 6/19/2025 |
| 2.2.1 | 245 | 5/23/2025 |
| 2.2.0 | 255 | 5/21/2025 |
| 2.1.2 | 239 | 5/20/2025 |
| 2.1.1 | 339 | 5/15/2025 |
| 2.1.0 | 342 | 5/14/2025 |
| 2.0.3 | 316 | 5/14/2025 |
| 2.0.2 | 324 | 5/14/2025 |
| 2.0.1 | 319 | 5/13/2025 |
| 2.0.0 | 328 | 5/13/2025 |
| 1.1.3 | 247 | 5/11/2025 |
Host app now works in Relase buld V2.0.0