Comments (17)
I think it's more complicated, I'll try as you say but building OpenCv with GStreamer require to fill GStremer paths and other variables. Using CMake for windows and building winth VisualStudio it seems that works (show GStreamer in GetBuildInformation() method).
Thanks for your help.
from emgucv.
You just need to replace all dlls with the output emgucv compilation. I suspect you only need to replace the cvextern.dll
from emgucv.
Hi, I have rebuild the official OpenCv, but not EmguCv. I have try with EmguCv, but seems to be not so easy.
I thougt that it was possible only rebuilding OpenCv, since EmguCv it's only a wrapper.
from emgucv.
You can use openCV compilation too, copy the outputs to your project bin root. And this way not not use the emgucv runtime dist.
from emgucv.
I don't understand so well. You mean install EmguCv nugget and after that copy binaries from OpenCv Build?
I have try this and didn't work. It sais that cvextern.dll is not found.
from emgucv.
Yes, just install the emgucv nugget and copy the dlls. It should work on bin root. However in a normal not published compilation they are located under runtimes\win-x64\native
Directory: UVtools\UVtools.UI\bin\Debug\net6.0\runtimes\win-x64\native
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 19/09/2020 01:46 4369408 av_libglesv2.dll
-a--- 18/10/2023 01:41 327576 concrt140.dll
-a--- 16/09/2023 14:03 35899904 cvextern.dll
-a--- 20/09/2023 19:11 1607088 libHarfBuzzSharp.dll
-a--- 10/01/2024 22:47 9414064 libSkiaSharp.dll
-a--- 18/10/2023 01:41 35704 msvcp140_1.dll
-a--- 18/10/2023 01:41 267160 msvcp140_2.dll
-a--- 18/10/2023 01:41 50072 msvcp140_atomic_wait.dll
-a--- 18/10/2023 01:41 31640 msvcp140_codecvt_ids.dll
-a--- 18/10/2023 01:41 578384 msvcp140.dll
-a--- 17/10/2023 23:37 26353152 opencv_videoio_ffmpeg481_64.dll
-a--- 18/10/2023 01:41 49560 vcruntime140_1.dll
-a--- 18/10/2023 01:41 109440 vcruntime140.dll
from emgucv.
Hi,
It seems that I don't have the same dlls.
If I install EmguCv
nugget I get this dlls in bin/Debug
directory.
bin/Debug
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 06/04/2024 22:28 runtimes
-a---- 18/10/2023 3:37 24520 Emgu.CV.Bitmap.dll
-a---- 18/10/2023 2:59 891336 Emgu.CV.dll
And after that I have created runtimes directory as you mentioned and I have put all the dlls that I have in install/x64/vc17/bin
folder of OpenCv output.
By doing this I'm getting DllNotFoundException
because it seems EmguCv is searching for a dll named cvextern.dll
bin/Debug/runtime/win-x64/native
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 04/04/2024 16:32 3082752 opencv_calib3d490.dll
-a---- 04/04/2024 16:11 7384064 opencv_calib3d490d.dll
-a---- 04/04/2024 16:28 14705664 opencv_core490.dll
-a---- 04/04/2024 16:10 23786496 opencv_core490d.dll
-a---- 04/04/2024 16:34 7255040 opencv_dnn490.dll
-a---- 04/04/2024 16:12 17175040 opencv_dnn490d.dll
-a---- 04/04/2024 16:30 905216 opencv_features2d490.dll
-a---- 04/04/2024 16:11 2667520 opencv_features2d490d.dll
-a---- 04/04/2024 16:29 585728 opencv_flann490.dll
-a---- 04/04/2024 16:10 1609216 opencv_flann490d.dll
-a---- 04/04/2024 16:40 6283264 opencv_gapi490.dll
-a---- 04/04/2024 16:14 17370624 opencv_gapi490d.dll
-a---- 04/04/2024 16:32 346112 opencv_highgui490.dll
-a---- 04/04/2024 16:12 910848 opencv_highgui490d.dll
-a---- 04/04/2024 16:30 3586048 opencv_imgcodecs490.dll
-a---- 04/04/2024 16:11 8611840 opencv_imgcodecs490d.dll
-a---- 04/04/2024 16:30 29279232 opencv_imgproc490.dll
-a---- 04/04/2024 16:11 45126656 opencv_imgproc490d.dll
-a---- 04/04/2024 16:29 670208 opencv_ml490.dll
-a---- 04/04/2024 16:10 1698304 opencv_ml490d.dll
-a---- 04/04/2024 16:38 1435136 opencv_objdetect490.dll
-a---- 04/04/2024 16:13 3610112 opencv_objdetect490d.dll
-a---- 04/04/2024 16:30 830464 opencv_photo490.dll
-a---- 04/04/2024 16:11 1881600 opencv_photo490d.dll
-a---- 04/04/2024 16:32 1001984 opencv_stitching490.dll
-a---- 04/04/2024 16:12 2457600 opencv_stitching490d.dll
-a---- 04/04/2024 16:37 836608 opencv_video490.dll
-a---- 04/04/2024 16:13 2070528 opencv_video490d.dll
-a---- 04/04/2024 16:32 844288 opencv_videoio490.dll
-a---- 04/04/2024 16:11 2054656 opencv_videoio490d.dll
-a---- 02/04/2024 7:55 26314752 opencv_videoio_ffmpeg490_64.dll
from emgucv.
Theres not an option to combine all that into a single dll?
If you want emgucv runtime you need to get the package https://www.nuget.org/packages/Emgu.CV.runtime.windows
from emgucv.
I didn't see any cmake option to build as single dll.
I wan't to use my OpenCv build because it seems that default compilation of OpenCv doesn't include Gstreamer backend. That's why I'm trying to do in that way.
from emgucv.
Better ask to @emgucv
But you can also edit the bat and add WITH_GSTREAMER:BOOL=TRUE
, not sure if only that will work
from emgucv.
See: https://discourse.cmake.org/t/how-to-combine-all-dlls-from-subproject-into-one-dll/7235/5
BUILD_opencv_world
which emgucv is using here
from emgucv.
You are sugesting to use this cmake option to build OpenCv and rename as cvextern.dll?
from emgucv.
Yes, it should combine all in one dll and then you can try it as cvextern.dll
from emgucv.
The none-GPU release of Emgu CV static linked OpenCV into cvextern.dll. You can't just replace it with opencv dlls. You will need to re-build Emgu CV with the same configuration as Open CV to generate the cvextern.dll that contains the Open CV bits with GStreamer support.
The GPU release of Emgu CV use dynamic linked opencv_world.dll. You can download this nuget package for the dlls: https://github.com/emgucv/emgucv/releases/download/4.8.0/Emgu.CV.runtime.windows.cuda.4.8.0.5324.nupkg
Renamed it with extension of ".zip" and you should be able to unzip the file to get the dlls.
If you build opencv with GStreamer and BUILD_opencv_world enabled, you can replace the opencv_world.dll file from the above Emgu CV GPU runtime package with your own. In-theory that should give you GStreamer support using Emgu CV. We have not tested it and we do not officially support it.
from emgucv.
Hi,
I have tried to rebuild Emgucv from scratch following documentation.
- Clone git repository
- Executing
Build_Binary_x86-64_doc.bat
- Open build_x86_64 folder with cmake, setting new variable
GSTREAMER_DIR=C:/gstreamer/1.0/msvc_x86_64
- Click on configure and cmake fill
WITH_GSTREAMER=ON
and all the Gstreamer options paths. - Click on generate
- Open
build_x86_64/emgucv.sln
. Set Release mode and rebuild cvextern project. - Copy libs/runtimes directory to new VisualStudio project
bin/Degug
(project has EmguCv nugget installed)
It seems it isn't working. At starting I have called CvInvoke.BuildInformation
and it is throwing System.TypeLoadException
from emgucv.
You will also need to copy all the GStreamer dlls to the folder that contains cvextern.dll.
If you still got the System.TypeLoadException after that, follow this instruction to use dependecy walker to find out what dependecy is missing from the folder of the dlls:
https://www.emgu.com/wiki/index.php/Download_And_Installation#Are_you_missing_any_dependency.3F
If dependency walker reports missing dependency, copy them over to the folder where you have the "cvextern.dll".
from emgucv.
Finally I did it!
I copied all dlls in C:/gstreamer/1.0/msvc_x86_64/bin
to runtimes
dir inside bin
, at same level as cvextern.dll
.
Now it seems to work, and I see GSTREAMER
enabled in getBuildInformation()
.
But I'm having problems to build Gstreamer pipeline. I don't know if maybe gstreamer
needs more dependencies or somethig like that.
string command = "appsrc ! videoconvert ! mfxh264enc ! video/x-h264, stream-format=byte-stream, profile=baseline ! send-config=true rtph264pay pt=96 ! udpsink host=127.0.0.1 port=5004";
[ WARN:[email protected]] global cap_gstreamer.cpp:2250 cv::CvVideoWriter_GStreamer::close_ OpenCV | GStreamer warning: No source in GStreamer pipeline. Ignore
[ERROR:[email protected]] global cap.cpp:645 cv::VideoWriter::open VIDEOIO(GSTREAMER): raised OpenCV exception:
OpenCV(4.9.0) C:\CMake\opencv\opencv\modules\videoio\src\cap_gstreamer.cpp:154: error: (-215:Assertion failed) ptr in function 'cv::`anonymous-namespace'::GSafePtr<struct _GstElement>::get'
Thanks for your support.
from emgucv.
Related Issues (20)
- Image.Data and GetSubRect not compatible HOT 3
- [BUG] Wrong documentation of angle direction in RotatedRect HOT 5
- Wrongly converted parameter arguments for process method in AlignExposures class HOT 1
- [Feature] Add getter/setter in Feature2D algorithms
- Missing custom Aruco board definition
- [BUG] An error occurs when the file path contains Chinese characters
- [BUG] Emgu prevents apps from running on iPhone 6/iOS 12 HOT 7
- Timeline of .Net 8.0 support HOT 7
- [BUG] Features2DToolbox.DrawMatches singlePointColor argument is ignored, it always uses the matchColor argument
- EMGUCV 4.8 VideoCapture.Set is not setting desired Width and Height
- [BUG]AvaloniaUI Project with Emgu.CV.runtime.debian-arm64, encountered Segmentation fault error during runtime HOT 1
- [QUESTION] How to Optimize Image Stitching HOT 3
- [FEATURE] Adding GStreamer when building a project on Debian
- [FEATURE] - Support use of ReadOnly/Span in APIs HOT 5
- [BUG] For certain FPS settings VideoWriter creation fails with "make sure you have the specific codec installed" HOT 1
- Attempting to JIT compile method "(wrapper native-to-managed) int Emgu.CV.CvInvoke:CvErrorHandler (int,intptr,intptr,intptr,int,intptr)" while running in aot-only mode. HOT 2
- [BUG] ./cmake_configure run ends with an error HOT 1
- [BUG] Emgu on Raspberrypi error - global cap_v4l.cpp:1134 tryIoctl HOT 1
- [BUG] GetSpan with ROI crash application with violation of memory access HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emgucv.