Commit Graph

51 Commits

Author SHA1 Message Date
Mikhail Nikolskii
a604d44d06
Merge pull request #19755 from mikhail-nikolskiy:ffmpeg-umat
cv::UMat output/input in VideoCapture/VideoWriter (data stays in GPU memory)

* FFMPEG with UMat input/output

* OpenCL_D3D* context

* fix Linux build

* cosmetic changes

* fix build if USE_AV_HW_CODECS=0

* simplify how child context pointer stored in parent context

* QSV interop with OpenCL on Windows

* detect_msdk.cmake via pkg-config

* fix av_buffer_ref() usage

* revert windows-decode-mfx whitelisting; remove debug msg

* address review comments

* rename property to HW_ACCELERATION_USE_OPENCL

* fix issue with "cl_khr_d3d11_sharing" extension not reported by OpenCL GPU+CPU platform

* core(ocl): add OpenCL stubs for configurations without OpenCL

* videoio(ffmpeg): update #if guards

* Put OpenCL related code under HAVE_OPENCL; simplify reuse of media context from OpenCL context

* videoio(test): skip unsupported tests

- plugins don't support OpenCL/UMat yet
- change handling of *_USE_OPENCL flag

* videoio(ffmpeg): OpenCL dependency

* videoio(ffmpeg): MediaSDK/oneVPL dependency

* cleanup, logging

* cmake: fix handling of 3rdparty interface targets

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-05-14 16:48:50 +00:00
Quella Zhang (Beyondsoft Corporation)
5105a937d1 Add namespace specifier for format() 2021-04-21 14:08:52 +08:00
Mikhail Nikolskii
7bcb51eded
Merge pull request #19460 from mikhail-nikolskiy:videoio-hw
videoio: HW decode/encode in FFMPEG backend; new properties with support in FFMPEG/GST/MSMF

* HW acceleration in FFMPEG backend

* fixes on Windows, remove D3D9

* HW acceleration in FFMPEG backend

* fixes on Windows, remove D3D9

* improve va test

* Copyright

* check LIBAVUTIL_BUILD >= AV_VERSION_INT(55, 78, 100) // FFMPEG 3.4+

* CAP_MSMF test on .mp4

* .mp4 in test

* improve va test

* Copyright

* check LIBAVUTIL_BUILD >= AV_VERSION_INT(55, 78, 100) // FFMPEG 3.4+

* CAP_MSMF test on .mp4

* .mp4 in test

* .avi for GStreamer test

* revert changes around seek()

* cv_writer_open_with_params

* params.warnUnusedParameters

* VideoCaptureParameters in GStreamer

* open_with_params

* params->getUnused

* Reduce PSNR threshold 33->32 (other tests use 30)

* require FFMPEG 4.0+; PSNR 30 as in other tests

* GStreamer AVI-demux plugin not installed in Ubuntu test environment?

* fix build on very old ffmpeg

* fix build on very old ffmpeg

* fix build issues

* fix build issues (static_cast)

* FFMPEG built on Windows without H264 encoder?

* fix for write_nothing test on VAAPI

* fix warnings

* fix cv_writer_get_prop in plugins

* use avcodec_get_hw_frames_parameters; more robust fallback to SW codecs

* internal function hw_check_device() for device check/logging

* two separate tests for HW read and write

* image size 640x480 in encode test

* WITH_VA=ON (only .h headers used in OpenCV, no linkage dependency)

* exception on VP9 SW encoder?

* rebase master; refine info message

* videoio: fix FFmpeg standalone plugin build

* videoio(ffmpeg): eliminate MSVC build warnings

* address review comments

* videoio(hw): update videocapture_acceleration.read test

- remove parallel decoding by SW code path
- check PSNR against the original generated image

* videoio: minor fixes

* videoio(test): disable unsupported MSMF cases (SW and HW)

* videoio(test): update PSNR thresholds for HW acceleration read

* videoio(test): update debug messages

* "hw_acceleration" whitelisting parameter

* little optimization in test

* D3D11VA supports decoders, doesn't support encoders

* videoio(test): adjust PSNR threshold in write_read_position tests

* videoio(ffmpeg): fix rejecting on acceleration device name mismatch

* videoio(ffmpeg): fix compilation USE_AV_HW_CODECS=0, add more debug logging

* videoio: rework VideoAccelerationType behavior

- enum is not a bitset
- default value is backend specific
- only '_NONE' and '_ANY' may fallback on software processing
- specific H/W acceleration doesn't fallback on software processing. It fails if there is no support for specified H/W acceleration.

* videoio(test): fix for current FFmpeg wrapper

Co-authored-by: Alexander Alekhin <alexander.a.alekhin@gmail.com>
2021-03-01 15:51:04 +00:00
Alexander Alekhin
ba7b0f4c54 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-12-15 11:23:46 +00:00
Alexander Alekhin
a45928045a
Merge pull request #16150 from alalek:cmake_avoid_deprecated_link_private
* cmake: avoid deprecated LINK_PRIVATE/LINK_PUBLIC

see CMP0023 (CMake 2.8.12+)

* cmake: fix 3rdparty list

- don't include OpenCV modules
2019-12-13 17:52:40 +03:00
Alexander Alekhin
bea2c75452 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-09-05 14:29:22 +03:00
Suleyman TURKMEN
f73395122c Update Samples 2019-09-05 01:10:51 +03:00
Alexander Alekhin
e21262deba Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-05-16 04:40:39 +00:00
Alexander Alekhin
18151e79bb cmake(samples): use LINK_PRIVATE in target_link_libraries 2019-05-15 18:38:00 +03:00
Alexander Alekhin
22dbcf98c5 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-17 14:17:35 +00:00
Alexander Alekhin
9ea8c775f8 samples: use findFile() in T-API samples 2018-11-16 18:08:22 +00:00
Vadim Pisarevsky
96bf26611e Merge pull request #13084 from vpisarev:shuffle_optflow_algos
* moved DIS optical flow from opencv_contrib to opencv, moved TVL1 from opencv to opencv_contrib

* fixed compile warning

* TVL1 optical flow example moved to opencv_contrib
2018-11-09 17:52:06 +03:00
Alexander Alekhin
edacd91a27 Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-10-15 20:15:42 +00:00
tompollok
0b77600718 change area() emptiness checks to empty() 2018-10-13 21:35:10 +02:00
Suleyman TURKMEN
59bf2a34fa Update videoio 2018-10-10 21:58:04 +03:00
Suleyman TURKMEN
c61bc3a0cb Update documentation and samples 2018-08-17 14:21:29 +03:00
Alexander Alekhin
9b0bafb82c samples: fix callback function type 2018-06-06 18:29:05 +03:00
Maksim Shabunin
1ae02c0cc4 Minor refactoring in several C++ samples:
- bgfg_segm
- peopledetect
- opencv_version
- dnn/colorization
- tapi/opencl_custom_kernel
- tapi/dense_optical_flow (renamed tvl1_optical_flow)
2018-03-06 14:23:20 +03:00
Maksim Shabunin
2200e13c71 cmake: refactored scripts with samples building:
- allow installing samples sources on all platforms
  even if BUILD_EXAMPLES is disabled,  fixed minor
  issues in sources installation process
- use 'example_<group>_<name>' scheme for target and binary file naming
- use single function for sample executable creation
2018-02-12 18:42:36 +03:00
luz.paz
dbb57cd0ae Misc. ./samples typos
Found via `codespell -q 3 --skip="./3rdparty" -I ../opencv-whitelist.txt`
2018-02-08 05:52:08 -05:00
Vitaly Tuzov
51cb56ef2c Implementation of bit-exact resize. Internal calls to linear resize updated to use bit-exact version. (#9468) 2017-12-13 15:00:38 +03:00
Alexander Alekhin
1625ffa2cf ocl: opencl_custom_kernel.cpp example 2017-12-07 16:50:07 +03:00
berak
ada753a54c fix c++17 namsespace issues 2017-10-11 09:50:22 +02:00
Jon Eyolfson
27cf941284 Remove unused method declarations in hog.cpp
The class `App` appears to have two unused methods: `message` and `checkRectSimilarity`. The is no definition or use of either of these methods. This appears to be dead code.
2017-07-28 10:19:35 -04:00
berak
7ce6895a2c Update tvl1_optical_flow.cpp
repair broken cmdline param for cpu/gpu mode
2017-04-17 09:10:10 +02:00
StevenPuttemans
6d34d6b47e update samples: waitKey() usage
Original commit is a5f19f7dd6
2016-12-15 15:39:47 +03:00
StevenPuttemans
5728f796f6 updating python tutorials + providing necessary data 2016-10-26 13:14:20 +02:00
Alexander Alekhin
3e77731f7e Merge pull request #6824 from dozyc:tapi_hog_sample 2016-07-13 15:18:14 +00:00
Alexander Alekhin
69bd6dad1f Merge pull request #6029 from sturkmen72:patch-7 2016-06-29 11:55:09 +00:00
Suleyman TURKMEN
11ca1c95f8 update cpp samples and tutorials 2016-06-26 20:55:00 +03:00
DozyC
6c4aae98f7 tapi examples - Removing defaults from all command line switches accessed with has() 2016-05-19 23:27:05 -07:00
DozyC
3db19c046b Fix command line argument handling, fixes #6525 2016-05-10 17:20:59 -07:00
Julien Nabet
a29c814bd8 cppcheck: fix some reports
All of these: (performance) Prefer prefix ++/-- operators for non-primitive types.
[modules/calib3d/src/fundam.cpp:1049] -> [modules/calib3d/src/fundam.cpp:1049]: (style) Same expression on both sides of '&&'.
2016-04-29 15:41:39 +02:00
ValeryTyumen
297808e6b9 Feature #3957 2015-12-17 18:19:39 +03:00
Suleyman TURKMEN
fd4761ba31 Update face detection samples 2015-10-20 19:09:21 +03:00
Maksim Shabunin
7ee79b73f6 AndroidMgr: fixed package build 2015-06-03 19:01:48 +03:00
Maksim Shabunin
35b2139929 Basic HAL module 2015-04-07 18:16:22 +03:00
Vadim Pisarevsky
c91b0e7ac4 Merge pull request #3217 from avdmitry:samples_cpp_data 2014-11-05 14:57:46 +00:00
Chuanbo Weng
2b52bb092a Update hog.cpp
Update according to vbystricky's comments
2014-10-20 18:14:38 +08:00
Chuanbo Weng
7452eef6e9 Correctly enable OpenCL mode in tapi's hog example.
For current OpenCV-CL architecture, if the data buffer
allocated in UMat are cpu buffer(not ocl buffer) under
cpu mode, and then pass this UMat to an OpenCL kernel
as an argument, the OpenCL path will fail and fallback
to cpu mode. Take HOGDescriptor::oclSvmDetector as an example:
    ocl::setUseOpenCL(false);
    //data allocated in hog.oclSvmDetector will be cpu buffer
    hog.setSVMDetector(HOGDescriptor::getDaimlerPeopleDetector());
    ocl::setUseOpenCL(true);
    //We enabled OpenCL, but hog.oclSvmDetector are cpu buffer,
    //so it will fail in the function ocl_classify_hists
    //when reach to this line
    //idx = k.set(idx, ocl::KernelArg::PtrReadOnly(detector));
    hog.detectMultiScale(img, found, hit_threshold, win_stride,
            Size(0, 0), scale, gr_threshold);

Similar problems heppen on img_aux and img. So we should re-define
or re-set these UMat when do mode switch (CPU -> OpenCL) in order
to make their data be allocated by ocl and then OpenCL path will
succeed.

Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
2014-10-20 11:50:46 +08:00
Dmitriy Anisimov
1007c06d44 initial commit 2014-09-23 07:45:51 +04:00
Vadim Pisarevsky
31df47b6ea moved nonfree and a part of features2d to opencv_contrib/xfeatures2d 2014-08-11 23:26:39 +04:00
Vadim Pisarevsky
d0137b6d2d moved part of video to contrib/{outflow, bgsegm}; moved matlab to contrib 2014-08-10 23:24:16 +04:00
Alexander Alekhin
55188fe991 world fix 2014-08-05 20:12:35 +04:00
vbystricky
d58f736935 Split highgui module to videoio and highgui 2014-07-14 23:16:47 +04:00
vbystricky
4286f60387 Extract imgcodecs module from highgui 2014-07-07 16:28:08 +04:00
Roman Donchenko
2bbda9d225 Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts:
	modules/cudaimgproc/test/test_color.cpp
	modules/dynamicuda/include/opencv2/dynamicuda/dynamicuda.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/src/imgproc.cpp
	modules/gpu/test/test_core.cpp
	modules/gpu/test/test_imgproc.cpp
	modules/java/generator/src/cpp/VideoCapture.cpp
	samples/gpu/performance/CMakeLists.txt
	samples/tapi/CMakeLists.txt
2014-02-03 13:23:59 +04:00
Konstantin Matskevich
07778e1760 fixes 2014-01-24 13:37:19 +04:00
Konstantin Matskevich
450ea3131f samples 2014-01-24 12:59:19 +04:00
Ilya Lavrenov
c4c913ff13 converted CPU-based example to T-API (Mat 2 UMat, etc) 2013-12-30 03:19:17 +04:00