1. 26 5月, 2023 1 次提交
  2. 17 5月, 2023 1 次提交
  3. 16 5月, 2023 1 次提交
    • M
      Merge pull request #23606 from mshabunin:fix-ffmpeg-packet-limit · 001a2c51
      Maksim Shabunin 提交于
      videoio/FFmpeg: increased packet read attempt limit, allow configuring it
      
      resolves #9455
      related #3225
      
      * Use different counters for wrong packets recieved by demuxer and errors from decoder
      * Allow modifying these counters via environment variables `OPENCV_FFMPEG_READ_ATTEMPTS`/`OPENCV_FFMPEG_DECODE_ATTEMPTS`
      * Added logging when reading breaks at one of error limits
      
      Notes:
      * I've been able to reproduce original issue with a video file with 14 total streams (video + audio + subtitles), at some point in the video only packets from the last stream are being sent by the demuxer, thus exceeding our limit. For my specific video total number of packets from wrong stream was about 2700. I've chosen 4096 as default value.
      * Default limit of decoding attempts is quite low, because I'm not sure in which cases it can be exceeded (network stream?). I tried to read 8k video from the disk, but it did not cause break at decode point.
      001a2c51
  4. 25 4月, 2023 1 次提交
  5. 22 12月, 2022 1 次提交
  6. 14 12月, 2022 1 次提交
  7. 07 12月, 2022 1 次提交
  8. 12 11月, 2022 1 次提交
    • A
      Merge pull request #22706 from kallaballa:libavdevice_for_ffmpeg_v4l2 · da4ac6b7
      Amir Hassan 提交于
      Introduce libavdevice to make v4l2 available to the ffmpeg backend
      
      * introduce libavdevice to make v4l2 available to the ffmpeg backend
      
      * downgrade the min required libavdevice version to 53.2.0
      
      * make libavdevice optional
      
      * create OCV_OPTION OPENCV_FFMPEG_ENABLE_LIBAVDEVICE and add definition through ocv_add_external_target
      
      * move OCV_OPTION 'OPENCV_FFMPEG_ENABLE_LIBAVDEVICE' to detect_ffmpeg.cmake
      da4ac6b7
  9. 27 10月, 2022 1 次提交
  10. 25 10月, 2022 1 次提交
  11. 12 9月, 2022 1 次提交
    • C
      Merge pull request #22248 from cudawarped:ffmpeg_rtsp_low_fps · 46d988e2
      cudawarped 提交于
      * Allow the number of threads FFMpeg uses to be selected during VideoCapture::open().
      Reset interupt timer in grab if
      err = avformat_find_stream_info(ic, NULL);
      is interupted but open is successful.
      
      * Correct the returned number of threads and amend test cases.
      
      * Update container test case.
      
      * Reverse changes added to existing videoio_container test case and include test combining thread change and raw read in the newly added videoio_read test case.
      46d988e2
  12. 02 8月, 2022 1 次提交
  13. 26 6月, 2022 1 次提交
  14. 25 6月, 2022 1 次提交
  15. 23 6月, 2022 1 次提交
  16. 13 6月, 2022 1 次提交
  17. 05 4月, 2022 2 次提交
  18. 30 3月, 2022 1 次提交
  19. 13 3月, 2022 1 次提交
  20. 11 2月, 2022 1 次提交
  21. 20 12月, 2021 1 次提交
  22. 28 11月, 2021 1 次提交
  23. 24 11月, 2021 1 次提交
    • C
      Merge pull request #20978 from cudawarped:videocapture_read_raw_enchancement · 97c6ec6d
      cudawarped 提交于
      Add capacity to Videocapture to return the extraData from FFmpeg when required
      
      * Update rawMode to append any extra data recieved during the initial negotiation of an RTSP stream or during the parsing of an MPEG4 file header.
      For h264[5] RTSP streams this ensures the parameter sets if available are always returned on the first call to grab()/read() and has two purposes:
      1) To ensure the parameter sets are available even if they are not transmitted in band.  This is common for axis ip camera's.
      2) To allow callers of VideoCapture::grab()[read()] to write to split the raw stream over multiple files by appending the parameter sets to the begining of any new files.
      For (1) there is no alternative, for (2) if the parameter sets were provided in band it would be possible to parse the raw bit stream and search for the parameter sets however that would be a lot of work when that information is already provided by FFMPEG.
      For MPEG4 files this information is only suplied in the header and is required for decoding.
      
      Two properties are also required to enable the raw encoded bitstream to be written to multiple files, these are;
      1) an indicator as to whether the last frame was a key frame or not - each new file needs to start at a key frame to avoid storing unusable frame diffs,
      2) the length in bytes of the paramater sets contained in the last frame - required to split the paramater sets from the frame without having to parse the stream.  Any call to VideoCapture::get(CAP_PROP_LF_PARAM_SET_LEN) returning a number greater than zero indicates the presense of a parameter set at the begining of the raw bitstream.
      
      * Adjust test data to account for extraData
      
      * Address warning.
      
      * Change added property names and remove paramater set start code check.
      
      * Output extra data on calls to retrieve instead of appending to the first packet.
      
      * Reverted old test case and added new one to evaluate new functionality.
      
      * Add missing definition.
      
      * Remove flag from legacy api.
      Add property to determine if returning extra data is supported.
      Always allow extra data to be returned on calls to cap.retrieve()
      Update test case.
      
      * Update condition which indicates CAP_PROP_CODEC_EXTRADATA_INDEX is not supported in test case.
      
      * Include compatibility for windows dll if not updated.
      Enforce existing return status convention.
      
      * Fix return error and missing test constraints.
      97c6ec6d
  24. 12 11月, 2021 1 次提交
    • F
      modules/videoio/src/cap_ffmpeg_impl.hpp: fix build with gcc 4.8 · 4c92a286
      Fabrice Fontaine 提交于
      Fix the following build failure with gcc 4.8:
      
      In file included from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg_impl.hpp:100:0,
                       from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg.cpp:50:
      /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg_hw.hpp: In constructor 'HWAccelIterator::HWAccelIterator(cv::VideoAccelerationType, bool, AVDictionary*)':
      /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg_hw.hpp:939:23: error: use of deleted function 'std::basic_istringstream<char>& std::basic_istringstream<char>::operator=(const std::basic_istringstream<char>&)'
                   s_stream_ = std::istringstream(accel_list);
                             ^
      In file included from /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-none-linux-gnueabi/include/c++/4.8.3/complex:45:0,
                       from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/core/include/opencv2/core/cvstd.inl.hpp:47,
                       from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/core/include/opencv2/core.hpp:3306,
                       from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/include/opencv2/videoio.hpp:46,
                       from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/precomp.hpp:57,
                       from /home/buildroot/autobuild/instance-3/output-1/build/opencv4-4.5.4/modules/videoio/src/cap_ffmpeg.cpp:42:
      /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-none-linux-gnueabi/include/c++/4.8.3/sstream:272:11: note: 'std::basic_istringstream<char>& std::basic_istringstream<char>::operator=(const std::basic_istringstream<char>&)' is implicitly deleted because the default definition would be ill-formed:
           class basic_istringstream : public basic_istream<_CharT, _Traits>
                 ^
      /home/buildroot/autobuild/instance-3/output-1/host/opt/ext-toolchain/arm-none-linux-gnueabi/include/c++/4.8.3/sstream:272:11: error: use of deleted function 'std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)'
      
      Fixes:
       - http://autobuild.buildroot.org/results/60f8846b435dafda0ced412d59ffe15bdff0810dSigned-off-by: NFabrice Fontaine <fontaine.fabrice@gmail.com>
      4c92a286
  25. 19 10月, 2021 1 次提交
  26. 10 9月, 2021 1 次提交
    • F
      Merge pull request #20591 from fortemSteve:ffmpeg_get_stream_open_time · c7e08889
      fortemSteve 提交于
      Add CAP_PROP_STREAM_OPEN_TIME
      
      * Added CAP_PROP_STREAM_OPEN_TIME to videoio module - can be used to query the time at which the stream was opened, in seconds since Jan 1 1970 (midnight, UTC). Useful for RTSP and other live video where absolute timestamps are needed. Only applicable to ffmpeg backends
      
      * use nanoseconds instead of seconds to mark the stream open time, and change the cap prop name to CAP_PROP_STREAM_OPEN_TIME_NSEC
      
      * use microseconds for CAP_PROP_STREAM_OPEN_TIME (nanoseconds rolls over too soon, and milliseconds/seconds requires a division)
      
      * fix whitespace issue
      c7e08889
  27. 14 8月, 2021 1 次提交
  28. 13 8月, 2021 1 次提交
  29. 15 5月, 2021 1 次提交
    • M
      Merge pull request #19755 from mikhail-nikolskiy:ffmpeg-umat · a604d44d
      Mikhail Nikolskii 提交于
      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: NAlexander Alekhin <alexander.a.alekhin@gmail.com>
      a604d44d
  30. 03 3月, 2021 2 次提交
  31. 02 3月, 2021 1 次提交
  32. 01 3月, 2021 1 次提交
    • M
      Merge pull request #19460 from mikhail-nikolskiy:videoio-hw · 7bcb51ed
      Mikhail Nikolskii 提交于
      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: NAlexander Alekhin <alexander.a.alekhin@gmail.com>
      7bcb51ed
  33. 28 1月, 2021 1 次提交
  34. 04 9月, 2020 1 次提交
  35. 25 8月, 2020 3 次提交
    • V
      fix: libavcodec version check for AVDISCARD_NONINTRA · f7e524cb
      Vadim Levin 提交于
       - AVDISCARD_NONINTRA flag is supported only for FFMPEG libraries pack
      f7e524cb
    • V
      e503ac50
    • V
      Merge pull request #18146 from VadimLevin:dev/vlevin/ffmpeg-remove-obsolte-versions-support · 458bd165
      Vadim Levin 提交于
      Remove obsolete FFMPEG versions support
      
      * refactor: removed obsolete FFMPEG version support
      
       - Oldest available version via official FFMPEG repository mirror has tag v.0.5
       LIBAVFORMAT version for this tag is 52.31.0
      
      * refactor: prefer std::min function to MIN macro
      
      * refactor: use appropriate macro instead of manual version calculation
      
      * refactor: remove macros for versions prior 0.5.15 release
      
      * refactor: remove libavcodec macros for versions < 54.35.1 (default to Ubuntu 14.04)
      
      * refactor: remove libavformat macro for versions < 54.20.4 (default ubuntu 14.04)
      
      * refactor: remove libavutil macro for versions < 52.3.0 (default ubuntu 14.04)
      
      * refactor: remove missed macros for libavcodec and libavformat
      
      * refactor: remove unused _opencv_ffmpeg_free function
      
      * build: add FFMPEG libraries versions checks
      
       - Add verbose message about what FFMPEG libraries are missing.
       - Add minimal versions check set to libav 9.20 release (default ubuntu 14.04) and FFMPEG 1.1.16 release.
         If the check is failed CMake produces user-friendly message instead of build error.
      
      * fix: libavcodec version guard for AVDISCARD_NONINTRA
      
      * fix: libav check of libavcodec version guard for AVDISCARD_NONINTRA
      
      * fix: version check for AV_CODEC_FLAG_GLOBAL_HEADER
      
      * fix: missing FFMPEG libraries output
      458bd165
  36. 17 8月, 2020 1 次提交