V4L capture support could use some improvements (Patch #336)


Added by Albert Lee almost 15 years ago. Updated over 12 years ago.


Status:Open Start date:
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:highgui-video
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

The V4L capture provider was quite buggy and did not work on OpenSolaris. I've tried to fix the most obvious problems I could see:
  • Made V4L1 optional
  • Fixed V4L2 cvInitImageHeader w/h parameters
  • Fixed V4L2 mmap buffer use to remove memcpy workaround
  • Fixed V4L2 buffer selection when converting
  • Added support for OpenSolaris V4L2
  • Added support for reading without polling
  • Added support for V4L2_CAP_READWRITE

Patch at https://pkgbuild.svn.sourceforge.net/svnroot/pkgbuild/spec-files-extra/trunk/patches/opencv-04-v4l2.diff


cap_v4l.cpp.trisk.patch - Trisk patch with improvements on v4l capture on opensolaris (cap_v4l.cpp) (22.3 kB) Filipe Almeida, 2010-06-02 10:43 am


Associated revisions

Revision dc11acf0
Added by Andrey Kamaev about 12 years ago

Merge pull request #336 from ivan-korolev:fix_relative_error_formula

History

Updated by Albert Lee almost 15 years ago

filipe, could you review these changes?

  • Status deleted (Open)

Updated by Filipe Almeida almost 15 years ago

Hi,

I'll review this patch and install opensolaris (homefully this week) to check these and my changes.

I do agree this is quite unstable code and I'm currently planning to rewrite the whole library; (want to check with Vadim if it's ok).

I'll apply your patch and check if it's ok on the linux boxes I have here.
Will post changes to SVN as soon as I finish the tests.

Updated by Filipe Almeida almost 15 years ago

Trisk,

Sorry for the delay on this.
Do these changes compile in OpenSolaris? (applying the patch in revision 3057)
Could you send me the version and installed packages details of your OpenSolaris setup?

Updated by Albert Lee almost 15 years ago

Yes, this builds and runs fine in OpenSolaris. However, it depends on important changes necessary for OpenCV itself to be portable, and for compatibility with Studio C++, see bugs #329, #333, #334, and #335. An additional patch is also necessary for Sun Studio if you use the Intel Integrated Performance Primitives).

These patches were made for the SFEopencv package recipe. If you build that (see http://sourceforge.net/apps/mediawiki/pkgbuild/index.php?title=Pkgbuild_on_OpenSolaris ), it should work out of the box.

I'm using OpenSolaris build 134 and Sun Studio 12u1 provided by pkg://opensolaris.org/developer/,5.11-0.111:20100306T002245Z. The headers should even work in builds prior to 77 (where sys/videodev2.h was missing an #include).

Updated by Filipe Almeida almost 15 years ago

Trisk,

Will run tests on Linux boxes (at least SuSE + Ubuntu) with your patch on the latest trunk version.

Will let you know as soon as I finish them (24~24h)

Updated by Filipe Almeida almost 15 years ago

Hi Trisk,

Could you please try applying the patch I uploaded on the latest SVN version and checkout if everything goes ok on your OpenSolaris box?

https://code.ros.org/trac/opencv/attachment/ticket/336/cap_v4l.cpp.trisk.patch

On line 2346, under linux, I get an invalid argument with some webcams (v4l1 devices?) - didn't pursue, just a nuisance; works fine.

When I resize (changing width/height after getting a number of frames), I can no longer work with the device - that problem is corrected in cap_libv4l.cpp (it's a workaround, not a solution).

Other than these, all your corrections/improvements seem to work perfectly under Ubuntu 10.04 LTS and openSUSE 11.2 (forcing usage of cap_v4l.cpp to hook with v4l).

I would still like to do further tests (under a lot of professional and academic workload).

Again, I plan to rewrite this the cap_libv4l.cpp library, hopefully starting July 12th 2010; It'll take opensolaris into account.

I plan for it to be able to deal with all of our current issues, make code more efficient and readable, gain stability/robustness and allow changes of most properties in runtime, at least width, height, frame rate and any properties that return "busy device"(EBUSY) while streaming.

Please let me know how your tests go.

Updated by Alexander Shishkov about 13 years ago

  • Description changed from The V4L capture provider was quite buggy and did not work on [[OpenSolaris]].... to The V4L capture provider was quite buggy and did not work on OpenSolaris. I&#... More

Updated by Alexander Shishkov almost 13 years ago

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

Updated by Alexander Shishkov almost 13 years ago

  • Target version deleted ()

Updated by Andrey Kamaev over 12 years ago

  • Assignee deleted (Filipe Almeida)
  • Category changed from highgui-images to highgui-video

Also available in: Atom PDF