Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to support gStreamer framework? #169

Open
Valery-Pavlenko opened this issue Jan 10, 2025 · 7 comments
Open

Is it possible to support gStreamer framework? #169

Valery-Pavlenko opened this issue Jan 10, 2025 · 7 comments

Comments

@Valery-Pavlenko
Copy link

Thank you, very useful and great work. I have been using your wrapper for a long time.
But recently I needed to receive streaming video from gStremer and failed. I rebuilt OpenCV and under C++ I receive the stream successfully, but your wrapper lacks the corresponding calls. Do you plan to support gStreamer? What would you advise me to correct in your wrapper so that I would get the result?
Thank you

@Laex
Copy link
Owner

Laex commented Jan 10, 2025

Please send me a code example (in Object Pascal or C++) of working with gStremer

@Valery-Pavlenko
Copy link
Author

#include "opencv2/core/utility.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
using namespace cv;
using namespace std;

int main(int argc, char** argv)
{
std::cout << getBuildInformation();
const string test_str = "videotestsrc ! videoconvert ! appsink";
cv::VideoCapture cap(test_str, CAP_GSTREAMER);
if (!cap.isOpened()) { exit(-4); }
Mat frame;
namedWindow("Display window", WINDOW_AUTOSIZE); // Create a window for display.
for (;;)
{
if (!cap.read(frame)) { exit(-1); }
imshow("Display window", frame); // Show our image inside it.
int key = waitKey(1);
if (key == 27/ESC/) break;
}
return 0;
}

@Valery-Pavlenko
Copy link
Author

This is a report of getBuildInformation();
###############################################
General configuration for OpenCV 4.1.0 =====================================
Version control: unknown

Platform:
Timestamp: 2025-01-08T05:22:02Z
Host: Windows 10.0.19045 AMD64
CMake: 3.10.0
CMake generator: Visual Studio 15 2017
CMake build tool: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/MSBuild/15.0/Bin/MSBuild.exe
MSVC: 1916

CPU/HW features:
Baseline: SSE SSE2
requested: SSE2
Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX
requested: SSE4_1 SSE4_2 AVX FP16
SSE4_1 (16 files): + SSE3 SSSE3 SSE4_1
SSE4_2 (2 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2
FP16 (1 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
AVX (5 files): + SSE3 SSSE3 SSE4_1 POPCNT SSE4_2 AVX

C/C++:
Built as dynamic libs?: YES
C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe (ver 19.16.27030.1)
C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /arch:SSE /arch:SSE2 /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP12 /MD /O2 /Ob2 /DNDEBUG
C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /arch:SSE /arch:SSE2 /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /MP12 /MDd /Zi /Ob0 /Od /RTC1
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Professional/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x86/cl.exe
C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /arch:SSE /arch:SSE2 /MP12 /MD /O2 /Ob2 /DNDEBUG
C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:fast /arch:SSE /arch:SSE2 /MP12 /MDd /Zi /Ob0 /Od /RTC1
Linker flags (Release): /machine:X86 /INCREMENTAL:NO
Linker flags (Debug): /machine:X86 /debug /INCREMENTAL
ccache: NO
Precompiled headers: NO
Extra dependencies:
3rdparty dependencies:

OpenCV modules:
To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo stitching ts video videoio world
Disabled: -
Disabled by dependency: -
Unavailable: java js python2 python3
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: YES

Windows RT support: NO

GUI:
Win32 UI: YES
VTK support: NO

Media I/O:
ZLib: build (ver 1.2.11)
JPEG: build-libjpeg-turbo (ver 2.0.2-62)
WEBP: build (ver encoder: 0x020e)
PNG: build (ver 1.6.36)
TIFF: build (ver 42 - 4.0.10)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
HDR: YES
SUNRASTER: YES
PXM: YES
PFM: YES

Video I/O:
DC1394: NO
FFMPEG: YES (prebuilt binaries)
avcodec: YES (58.35.100)
avformat: YES (58.20.100)
avutil: YES (56.22.100)
swscale: YES (5.3.100)
avresample: YES (4.0.0)
GStreamer: YES (1.24.10)
DirectShow: YES
Media Foundation: YES
DXVA: YES

Parallel framework: Concurrency

Trace: YES (with Intel ITT)

Other third-party libraries:
Intel IPP: 2019.0.0 Gold [2019.0.0]
at: C:/OpenCV/build/3rdparty/ippicv/ippicv_win/icv
Intel IPP IW: sources (2019.0.0)
at: C:/OpenCV/build/3rdparty/ippicv/ippicv_win/iw
Lapack: NO
Eigen: NO
Custom HAL: NO
Protobuf: build (3.5.1)

OpenCL: YES (NVD3D11)
Include path: C:/OpenCV/opencv-4.1.0/3rdparty/include/opencl/1.2
Link libraries: Dynamic load

Python (for build): NO

Java:
ant: NO
JNI: C:/Program Files/Eclipse Adoptium/jdk-11.0.15.10-hotspot/include C:/Program Files/Eclipse Adoptium/jdk-11.0.15.10-hotspot/include/win32 C:/Program Files/Eclipse Adoptium/jdk-11.0.15.10-hotspot/include
Java wrappers: NO
Java tests: NO

Install to: C:/OpenCV/build/install

@Laex
Copy link
Owner

Laex commented Jan 10, 2025

These lines attract attention:

This is a report of getBuildInformation();
...
General configuration for OpenCV 4.1.0

If you are using OpenCV 4.x.x, this wrapper will not work. 2.4.13 has class support (e.g. VideoCapture), but it is very limited.
You need to switch to the wrapper for 4.x.x Delphi-OpenCV-Class, but it is still under development

@Valery-Pavlenko
Copy link
Author

Valery-Pavlenko commented Jan 11, 2025 via email

@Valery-Pavlenko
Copy link
Author

Valery-Pavlenko commented Jan 11, 2025 via email

@Laex
Copy link
Owner

Laex commented Jan 11, 2025

OpenCV 2.4.13 has the following limitations when working with GStreamer:

  1. Limited support for formats and codecs: It supports a limited set of codecs, and there may be issues with modern codecs (H.265/HEVC, VP9) and containers (MKV). Hardware acceleration support is limited or absent.
  2. Issues with GStreamer installation and configuration: Difficulties with dependencies, the need to build OpenCV with GStreamer support, and a lack of automatic plugin configuration.
  3. Limited functionality: Absence of some video processing features, a less flexible API, and limited support for streaming.
  4. Compatibility issues: Use of outdated libraries, compatibility problems with modern OSes and hardware, and issues with updates.
  5. Lack of community support: Limited support and bug fixes, difficulty in finding solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants