opencv/modules/videoio
cudawarped 38bc519e4a
Merge pull request #24363 from cudawarped:videoio_ffmpeg_add_stream_encapsulation
videoio: Add raw encoded video stream muxing to cv::VideoWriter with CAP_FFMPEG #24363

Allow raw encoded video streams (e.g. h264[5]) to be encapsulated by `cv::VideoWriter` to video containers (e.g. mp4/mkv).

Operates in a similar way to https://github.com/opencv/opencv/pull/15290 where encapsulation is enabled by setting the `VideoWriterProperties::VIDEOWRITER_PROP_RAW_VIDEO` flag when constructing `cv::VideoWriter` e.g.
```
VideoWriter container(fileNameOut, api, fourcc, fps, { width, height }, { VideoWriterProperties::VIDEOWRITER_PROP_RAW_VIDEO, 1 });
```
and each raw encoded frame is passed as single row of a `CV_8U` `cv::Mat`.

The main reason for this PR is to allow `cudacodec::VideoWriter` to output its encoded streams to a suitable container, see https://github.com/opencv/opencv_contrib/pull/3569.

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
2023-10-25 13:21:01 +03:00
..
cmake cmake: fix V4L config verification conflict with OBSENSOR 2023-03-19 10:58:47 +03:00
doc Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2021-11-20 05:13:50 +00:00
include/opencv2 Merge pull request #24363 from cudawarped:videoio_ffmpeg_add_stream_encapsulation 2023-10-25 13:21:01 +03:00
misc Merge pull request #22939 from stopmosk:21826-python-bindings-for-videocapturewaitany 2022-12-14 22:15:02 +03:00
perf Merge pull request #15100 from Volskig:cam_multiplexing_function_v 2019-11-15 19:42:12 +03:00
src Merge pull request #24363 from cudawarped:videoio_ffmpeg_add_stream_encapsulation 2023-10-25 13:21:01 +03:00
test Merge pull request #24363 from cudawarped:videoio_ffmpeg_add_stream_encapsulation 2023-10-25 13:21:01 +03:00
CMakeLists.txt dnn(tflite): add 3rdparty flatbuffers with pre-generated schema 2023-02-21 16:06:19 +00:00