File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
H264SharpBitmapExtentions Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,8 @@ public partial class MainWindow :System.Windows.Window
2525 private H264Decoder decoder ;
2626 private Stream s ;
2727 private AviWriter writer ;
28- const int w = 1920 ;
29- const int h = 1080 ;
28+ const int w = 640 ;
29+ const int h = 480 ;
3030 object mtex = new object ( ) ;
3131 int numThreads = 4 ;
3232 ConverterConfig config = ConverterConfig . Default ;
@@ -157,6 +157,11 @@ private void CaptureCam()
157157 capture . FrameWidth = w ;
158158 capture . FrameHeight = h ;
159159 capture . Fps = 30 ;
160+ if ( capture . FrameWidth != w || capture . FrameHeight != h )
161+ {
162+ MessageBox . Show ( $ "Unable to set the resolution { w } x{ h } for the camera.") ;
163+ return ;
164+ }
160165 Mat frame = new Mat ( ) ;
161166 Thread t = new Thread ( ( ) =>
162167 {
Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <TargetFramework >netstandard2.0</TargetFramework >
55 <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
6+ <GeneratePackageOnBuild >True</GeneratePackageOnBuild >
7+ <Title >H264SharpBitmapExtentions</Title >
8+ <Authors >ReferenceType</Authors >
9+ <Description >Bitmap extentions for H264Sharp</Description >
10+ <PackageProjectUrl >https://github.com/ReferenceType/H264Sharp</PackageProjectUrl >
11+ <RepositoryUrl >https://github.com/ReferenceType/H264Sharp</RepositoryUrl >
12+ <PackageTags >h264</PackageTags >
13+ <PackageLicenseFile >Licence.txt</PackageLicenseFile >
614 </PropertyGroup >
715
16+ <ItemGroup >
17+ <None Include =" ..\Resources\Licence.txt" >
18+ <Pack >True</Pack >
19+ <PackagePath >\</PackagePath >
20+ </None >
21+ </ItemGroup >
22+
823 <ItemGroup >
924 <PackageReference Include =" System.Drawing.Common" Version =" 7.0.0" />
1025 </ItemGroup >
You can’t perform that action at this time.
0 commit comments