Cannot change video size in a thread (Bug #1241)


Added by Pavel Gurevich over 13 years ago. Updated over 9 years ago.


Status:Open Start date:
Priority:Normal Due date:
Assignee:Pavel Gurevich % Done:

0%

Category:highgui-camera
Target version:-
Affected version:branch '2.4' (2.4-dev) Operating System:Any
Difficulty: HW Platform:Any
Pull request:

Description

Changing resolution using

videoCapture -> set( CV_CAP_PROP_FRAME_WIDTH, width )

works fine in the main thread but has no effect inside a thread.


Associated revisions

Revision dc06d47f
Added by Roman Donchenko over 11 years ago

Merge pull request #1241 from SpecLad:redundant-precomps

Revision 122d0f86
Added by Roman Donchenko over 11 years ago

Deleted the now-empty ocl perf_precomp.cpp.

See pull request #1241 for why.

History

Updated by Vadim Pisarevsky over 13 years ago

which OS do you use and what does CMake report in the summary section about video capturing?

Updated by Alexander Shishkov almost 13 years ago

  • Priority changed from High to Normal
  • Target version deleted ()

Updated by Andrey Kamaev almost 13 years ago

  • Category changed from imgproc, video to highgui-images

Updated by Alexander Shishkov almost 13 years ago

  • Priority changed from Normal to Low

Updated by Alexander Shishkov almost 13 years ago

  • Assignee deleted (Vadim Pisarevsky)

Updated by Pavel Gurevich almost 13 years ago

I managed to made this work. The problem is that by default (as of 2.3.1) in the file cap_dshow.cpp which has a copy of videoinput library, the following define is commented out:

//if you need VI to use multi threaded com
#define VI_COM_MULTI_THREADED

Setting it will fix the issue. This is obviously a compile-time decision, and there is no build-time option for this. So, the question is if the current default is a good one.

Updated by Alexander Shishkov almost 13 years ago

  • Tracker changed from Bug to Patch
  • Priority changed from Low to Normal

Updated by Alexander Reshetnikov almost 13 years ago

  • Assignee set to Vadim Pisarevsky

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Pavel Gurevich over 12 years ago

As of 2.4.2, even the previous work-around stopped working. I saw much changes in the file cap_dshow.cpp, but meanwhile I cannot isolate the cause problem.

Meanwhile, I've noticed that the whole code section that initialized/deinitialized COM is commented out.

However, when I play with the values of tryWidth and tryHeight I do get the desired capture resolutions.

Currently seems like a degradation from the previous version (and the previous version of the file cannot be just dropped in because of the compilation problems).

Updated by Andrey Kamaev over 12 years ago

  • Category changed from highgui-images to highgui-camera

Updated by Kirill Kornyakov about 12 years ago

Pavel, could you please attach a repro code sample?

  • Affected version set to 2.4.2
  • Assignee changed from Vadim Pisarevsky to Pavel Gurevich

Updated by Maksim Shabunin over 9 years ago

  • HW Platform set to Any
  • Operating System set to Any
  • Affected version changed from 2.4.2 to branch '2.4' (2.4-dev)

Updated by Maksim Shabunin over 9 years ago

  • Tracker changed from Patch to Bug

Updated by Maksim Shabunin over 9 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4290

Also available in: Atom PDF