![]() |
VOOZH | about |
dotnet add package djaus2_MauiMediaRecorderVideoLib --version 3.0.2
NuGet\Install-Package djaus2_MauiMediaRecorderVideoLib -Version 3.0.2
<PackageReference Include="djaus2_MauiMediaRecorderVideoLib" Version="3.0.2" />
<PackageVersion Include="djaus2_MauiMediaRecorderVideoLib" Version="3.0.2" />Directory.Packages.props
<PackageReference Include="djaus2_MauiMediaRecorderVideoLib" />Project file
paket add djaus2_MauiMediaRecorderVideoLib --version 3.0.2
#r "nuget: djaus2_MauiMediaRecorderVideoLib, 3.0.2"
#:package djaus2_MauiMediaRecorderVideoLib@3.0.2
#addin nuget:?package=djaus2_MauiMediaRecorderVideoLib&version=3.0.2Install as a Cake Addin
#tool nuget:?package=djaus2_MauiMediaRecorderVideoLib&version=3.0.2Install as a Cake Tool
A .NET MAUI library for Android video recording plus 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 test app work.
Nb: The solution of test app plus this lib as one solution is a private repository.
djaus2/MauiMediaRecorderVideoAndroidApp
This library is being developed to target a sporting Phototiming 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.
See the sample app for details. The following is a summary of the steps to get started:
Android/Manifest.xaml:<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
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 the point at which the app requests permissions. The method actually iterates through the permissions in the Android/Manifest file and requests them.
using MauiMediaRecorderVideoLib;
Include the Toolkit:
builder
.UseMauiApp<App>()
.UseMauiCommunityToolkitCamera() <- Add this
...
In the Builder setup, add the following lines to register the camera preview handler and configure camera services:
builder.ConfigureMauiHandlers(handlers =>
{
handlers.AddHandler(typeof(CameraPreviewView), typeof(MauiAndroidCameraViewLib.Platforms.Android.CameraPreviewHandler));
});
MauiAndroidCameraViewLib.MauiCameraServicesSetup.ConfigureCameraServices(builder);
The following is in MainPage.cs:
using MauiMediaRecorderVideoLib;
// Initialize the service
_VideoKapture = new VideoKapture(this, CameraPreview);
_VideoKapture.OnFilenameCompleted(filename);
var activity = Platform.CurrentActivity;
await _VideoKapture.OnButton_GetReady4Recording(activity);
await _VideoKapture.OnButton_StartRecording_Clicked();
await _VideoKapture.OnButton_PauseRecording_Clicked();
await _VideoKapture.OnButton_ContinueRecording_Clicked();
await _VideoKapture.OnButton_StopRecording_Clicked();
_VideoKapture.ViewModel.EnableCrossHairs = !_VideoKapture.ViewModel.EnableCrossHairs;
There is also code to set the framerate at 30 or 60 FPS and to enable image stabilisaztion. See the sample app.
| 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 | 245 | 7/16/2025 |
| 3.0.1 | 205 | 7/16/2025 |
| 3.0.0 | 224 | 7/16/2025 |
| 2.5.1 | 179 | 7/11/2025 |
| 2.5.0 | 190 | 7/11/2025 |
| 2.4.3 | 212 | 7/6/2025 |
| 2.4.2 | 222 | 7/6/2025 |
| 2.4.0 | 222 | 7/6/2025 |
| 2.3.0 | 223 | 7/6/2025 |
| 2.2.2 | 246 | 6/19/2025 |
| 2.2.1 | 243 | 5/23/2025 |
| 2.2.0 | 251 | 5/21/2025 |
| 2.1.2 | 237 | 5/20/2025 |
| 2.1.1 | 336 | 5/15/2025 |
| 2.1.0 | 339 | 5/14/2025 |
| 2.0.3 | 313 | 5/14/2025 |
| 2.0.2 | 322 | 5/14/2025 |
| 2.0.1 | 317 | 5/13/2025 |
| 2.0.0 | 326 | 5/13/2025 |
| 1.1.3 | 245 | 5/11/2025 |
Added Autostart Countdown mode: V3.0.2