1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-18 17:24:28 +08:00
Commit Graph

15 Commits

Author SHA1 Message Date
James Bowley
587207bd9b Initail commit adding nvdec scaling and cropping to cudacodec 2022-09-15 16:03:41 +03:00
cudawarped
d2760791a4 Fix cudacodec and cudastereo python bindings. 2022-06-02 13:35:44 +01:00
cudawarped
b2904b9441 Merge pull request #3247 from cudawarped:videoreader_add_rtsp_feature
Add RTSP features to cudacodec::VideoReader

* Add live video source enhancements, e.g. rtsp from ip camera's
Add error logs.

* Fix type.

* Change badly named flag.

* Alter live source flag everywhere to indicate what it does not what it is for, which should be left up to the documentation.

* Prevent frame que object from being reinitialized which could be unsafe if another thread and/or object is using it.
2022-06-02 09:32:29 +00:00
cudawarped
9c4738b527 Merge pull request #3248 from cudawarped:videoreader_decode_all_to_nv12
Force VideoReader to decode all YUV video formats to NV12

* Force decoding of all supported YUV inputs  to NV12 and log warning to indicate this is taking place.
Add YUV output.

* Update to include missing CUDA stream argument to raw frame copy.

* Fix copy paste oversight.
2022-05-27 11:36:55 +03:00
cudawarped
1490611d63 Merge pull request #3198 from cudawarped:cudacodec_add_frame_colour_format_request
cudacodec::VideoReader add colour format selection functionality

* Add capacity to select different colour formats for each decoded frame produced by cudacodec::VideoReader.
Updated accompanying test.

* Address warning
2022-03-24 12:32:11 +03:00
cudawarped
c3ac120b48 Add facility to request the minimum number of decode surfaces when creating cudacodec::VideoReader. 2022-03-22 15:20:08 +00:00
cudawarped
54d1ae0417 Expose VideoReader::format() to python bindings and update python test to check for this. 2022-03-14 13:21:47 +00:00
cudawarped
758c1a9b94 Merge pull request #3139 from cudawarped:pass_videocapture_params_to_videoreader
Pass cv::VideoCaptureProperties to VideoReader FFmpeg source

* Add missing codecs to cudacodec which uses Nvidia Video Codec SDK including checks to ensure codec used in input video file is supported on the current device.

* Allow VideoCaptureProperties to be passed to VideoCapture on initialization.
Include test for VideoReader but not for VideoCapture, assume pass through successful.
Use propertyId instead of c++ keyword property.
Remove unecessary error checks (parsers error is dependant on source) and output more informative exception.

* Prevent, fall back to CuvidVideoSource if VideoCapture params are passed and initialization fails and add test for this.

* Remove magic number from get methods, and make the types consistent with VideoCapture::get
Fix documentation.

* Add wrapper macro's and remove unecessary parameter from get().
2021-12-28 18:05:52 +00:00
cudawarped
1cecd2cea0 Merge pull request #3098 from cudawarped:rtsp_video_write
Add writing encoded video streams to disk when streaming from RTSP sources using cudacodec

* Add missing codecs to cudacodec which uses Nvidia Video Codec SDK including checks to ensure codec used in input video file is supported on the current device.

* Update cudacoded to
1) automatically write the raw encoded video stream to a video file and,
2) use less GPU memory by more closely mirroring the Nvidia samples.  Specifically querying the decoder for the number of decode surfaces (h265 commonly uses 4) instead of always using 20 and not using adaptive deinterlacing when the video sequence is progressive.  Additional updates to mirror the Nvidia sample include initializing the decoder so that HandleVideoSequence() gets called every time before the decoder is initialized, ensuring all the parameters for the decoder are provided by nvcudec.
Added facility to decode AV1, not tested as VideoCapture doesn't return a valid fourcc for this.
Add facility to decode MPEG4 video - requires modification to VideoCapture see pull request.

* Prevent adding parameter sets twice and add zero padding to output files to that they play in vlc.
Notes: VideoCapture - returns mpeg as the codec for mpeg4 files, so files written as .m4v from mpeg4 sources cannot currently be decoded.  This is also true for AV1 sources where cap.get(CAP_PROP_FOURCC) returns 0.
Added mpeg4 test file which can be decoded when VideoCapture adds the extra_data.

* Update to account for the extraData being passed from cap.retrieve instead of appended to the first packet.

* Update to be compatible with changes to VideoCapture

* Remove redundant test.

* Add check to ensure retrieve is successful.

* Remove writeToFile and allow VideoReader to return raw encoded data at the same time as decoded frames.

* Fix missing documentation.
2021-12-13 01:53:01 +03:00
cudawarped
6a18431421 Merge pull request #3001 from cudawarped:fix_cudacodec_wh
* Correct width/height returned by cudacodec::VideoReader::FormatInfo()

* Remove redundant calls to VideoCapture
2021-07-10 12:57:23 +00:00
cudawarped
5f99ff97b9 Update cudacodec to work with Nvidia Video Codec SDK 11.0 2020-12-07 10:01:02 +00:00
cudawarped
7cbe83f217 Merge pull request #2362 from cudawarped:fix_cudacodec_python
Fix cudacodec::VideoReader::nextFrame python bindings

* Signla to python bindings generator that nextFrame's OutputArray is a GpuMat.
Also remove duplicate test in cudacodec

* cudacodec: drop CV_GPU, wrap GpuMat only

* Make it explicit that frame in nextFrame is GpuMat and cannot be multiple types as implied by OutputArray
2019-12-04 18:58:06 +03:00
cudawarped
53b9880f8e Merge pull request #2180 from cudawarped:example_fix_for_cudacodec
OpenCV fix 14774 breaks cudacodec

* Example to describe comilation issue

* Added required changes, builds with -DWITH_FFMPEG=ON|OFF

* Working with standard ffmpeg cap.

* Changed cudacodec to use new retrieveRaw() function, to retrieve the raw encoded bitstream, from the videoio module  instead of its own implementation.

* Fix cv::cudacodec::VideoWriter

* Update to use VideoContainer

* Remove header used in testing

* Remove warning

* remove dependence on redundant ffmpeg codecs

* cudacodec: use .set(CAP_PROP_FORMAT, -1) to extract RAW streams

* whitespace

* addressed alalek's comment
2019-11-18 21:02:12 +03:00
James Bowley
66aba496f1 Add missing codecs to cudacodec which uses Nvidia Video Codec SDK including checks to ensure codec used in input video file is supported on the current device.
Re-enable cudacodec performance test.
2019-06-12 13:51:47 +01:00
Alexander Alekhin
82733fe56b cuda: move CUDA modules to opencv_contrib
OpenCV 4.0+
2018-09-19 18:57:43 +03:00