Home > Forum > Demo Maui - distorted preview

Demo Maui - distorted preview

Feb 29 (59 days ago)
Fabio wrote
Any capture card (USB or webcam) shows a distorted preview.
I'm using Apple TV connected to HDMI Video Capture USB and Windows 11.
The video captured is ok and has correct format but preview is not.
The screen format seems that always is a 4x3 rectangle.

I ask:
How correct it?
Can I ajuste the proportion of image area diferent of 4x3 proportiion?
How capture an single image?
Tks.
Reply
8 Answers
Mar 01 (58 days ago)
Roman Miniailov agent wrote
Hi

Please send logs - https://www.visioforge.com/how-to-send-logs

You can use Snapshot_GetAsync/SnapshotSave methods to get/save frame.

Also, try to configure the video format/resolution. Maybe it can resolve the problem.
Mar 12 (47 days ago)
Fabio wrote
Inside Maui sample I included a button to capture single frame.

private async void btSnapshot_Clicked(object sender, EventArgs e)
{
VideoFrameX frame = await _core.Snapshot_GetAsync();

bool salvou = _core.Snapshot_Save($"{Constantes.FolderImagemPath}\\imagem1.jpg", Microsoft.Maui.Graphics.ImageFormat.Jpeg);
}

I don't know this is correct code...
First, await _core.Snapshot_GetAsync() returns null.
Second, a message appears: "cannot convert from 'Microsoft.Maui.Graphics.ImageFormat' to 'SkiaSharp.SKEncodedImageFormat'" doesn't allow compile.

In documentation Snapshot_GetAsync and Snapshot_Save appears on MediaPlayerX. I'm using Maui sample. It will works?

Could you provide a sample code that works fine?
Mar 12 (47 days ago)
Roman Miniailov agent wrote
The problems are confirmed and will be fixed in a few hours.
Mar 12 (46 days ago)
Roman Miniailov agent wrote
Please check v15.8.43 update. I think the problem has been resolved.
Mar 14 (45 days ago)
Fabio wrote
I donwloaded github Net-SDK-s-Samplpes again and now I can't compile VideoCaptureX.Demos CS Maui because the project can't find many references. For example:
Unable to find project 'C:\Users\iko\source\repos\VisioForge.Libs\VisioForge.Libs.csproj'.
In the project file appears like that:
<ProjectReference Include="..\..\..\..\VisioForge.Libs\VisioForge.Libs.csproj" />
This project doesn't exists in the folder.
Can I did something wrong?

Follow error list:
Severity Code Description Project File Line Suppression State Details
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Libs\VisioForge.Libs.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core.UI.MAUI\VisioForge.Core.UI.MAUI.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core.UI.Apple\VisioForge.Core.UI.Apple.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core\VisioForge.Core.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\_SETUP\FILES\Demos\AndroidDependency\VisioForge.Core.Android.X7.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Libs\VisioForge.Libs.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core.UI.MAUI\VisioForge.Core.UI.MAUI.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core.UI.Apple\VisioForge.Core.UI.Apple.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core\VisioForge.Core.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\_SETUP\FILES\Demos\AndroidDependency\VisioForge.Core.Android.X7.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Libs\VisioForge.Libs.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core.UI.MAUI\VisioForge.Core.UI.MAUI.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core.UI.Apple\VisioForge.Core.UI.Apple.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\repos\VisioForge.Core\VisioForge.Core.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Error NU1104 Unable to find project 'C:\Users\iko\source\_SETUP\FILES\Demos\AndroidDependency\VisioForge.Core.Android.X7.csproj'. Check that the project reference is valid and that the project file exists. SimpleCapture C:\Users\iko\source\repos\.Net-SDK-s-samples\Video Capture SDK X (crossplatform)\MAUI\SimpleCapture\SimpleCapture.csproj 1
Mar 14 (45 days ago)
Roman Miniailov agent wrote
Please check samples update.
Mar 14 (44 days ago)
Fabio wrote
Hi...
Now the solution was compiled.
v15.8.43 is present... but..
I want buy... but, without static image capture I can't.
Again:
_core.Snapshot_Grabber_Enabled=true;
VideoFrameX frame = await _core.Snapshot_GetAsync();
bool salvou = _core.Snapshot_Save(GenerateFilename(), SkiaSharp.SKEncodedImageFormat.Jpeg);

These code doesn't works.
Please give me a simple code that works fine and then I will buy.
I'almost giving up...
Mar 14 (44 days ago)
Roman Miniailov agent wrote
For VideoCaptureCoreX, set the _core.Snapshot_Grabber_Enabled = true; before the StartAsync call. By default, it's disabled for performance reasons.