I am using Xam.Plugin.Media to capture a photo and record a video. The problem is the file size of the video always above 20MB.
I tried to put the settings to the lowest still getting a 20MB file size for a 20 seconds video. I am using Samsung Galaxy A9 (2018). Can I use FFMPEG to reduce the file size?
private async void btnCamera4_Clicked(object sender, EventArgs e)
{
var cafNo = entCafNo.Text;
TimeSpan time = new TimeSpan(0, 0, 0, 20, 0);
await CrossMedia.Current.Initialize();
if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakeVideoSupported)
{
await DisplayAlert("No Camera", "No Camera Available", "Ok");
return;
}
try
{
var file = await CrossMedia.Current.TakeVideoAsync(
new Plugin.Media.Abstractions.StoreVideoOptions
{
Name = cafNo + "_VID.mp4",
CompressionQuality = 0,
Quality = VideoQuality.Low,
DesiredLength = time
});
entVideoUrl.Text = file.Path;
}
catch (Exception ex)
{
Crashes.TrackError(ex);
}
}