Ask Your Question

genzm's profile - activity

2015-11-26 11:40:45 -0600 answered a question VideoCapture open starts many threads

I found this line of code in the github repositories.

https://github.com/Itseez/opencv/blob...

Changing this line will determine how many threads get created when using ffmpeg. I changed this to two in my application. It is surprising that this is no parameter.

2015-11-26 11:38:36 -0600 commented question VideoCapture open starts many threads

Yes, I understand that it is to make the decoding process faster. But decoding one video creates many threads. I can imagine quite a few use cases where you do not want to use your entire computational power to decode the video. It just seemed a little bit strange to have this as a default behaviour.

2015-11-19 01:19:32 -0600 commented question VideoCapture open starts many threads

I'm sorry, ubuntu 14.04 and opencv 2.4.11

2015-11-18 12:25:23 -0600 received badge  Student (source)
2015-11-18 12:22:43 -0600 asked a question VideoCapture open starts many threads

Hy,

I've noticed that when opening a video file using the VideoCapture class (in C++), about eight new threads are created. As I need 7 video files simultaneously this results in about 50 threads running. I was wondering why this happens and what the threads do (because I can't find anything about this online).

Thanks

2015-11-09 02:02:55 -0600 commented question installing opencv

Hy, I allready tried that, and it makes the build succeed. However, I need to be able to read video files in formats such as x264 and as far as I tested it, this was no longer possible.

2015-11-08 09:04:13 -0600 asked a question installing opencv

Hy,

I need OpenCV for a project I'm working on, however so far I've not been able to successfully build it. I've been trying numorous build guides and haven't found any solution yet. The make process always fails with the errors listed in the code section below.

I found several posts online of people having the same issue. However I've tried all these and none of them seemed to work for me.

I originally was trying to build an older version of opencv 2.4.9 because some of the code I'm using is using the older opencv. However, even with the new version 3.0 it is not working for me. Does anyone have any suggestion what I might try?

I will also include the result of the cmake configuration.

Thanks.

/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:317:36: error: ‘avcodec_free_frame’ was not declared in this scope
     avcodec_free_frame(&picture);
                                ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::open(const char*)’:
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:632:43: error: ‘avcodec_alloc_frame’ was not declared in this scope
         picture = avcodec_alloc_frame();
                                       ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:635:41: error: ‘PIX_FMT_BGR24’ was not declared in this scope
                 avpicture_get_size( PIX_FMT_BGR24,
                                     ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In member function ‘bool CvCapture_FFMPEG::retrieveFrame(int, unsigned char**, int*, int*, int*, int*)’:
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:738:67: error: ‘PIX_FMT_RGB24’ was not declared in this scope
 avpicture_fill((AVPicture*)&rgb_picture, rgb_picture.data[0], PIX_FMT_RGB24,
                                                               ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:756:17: error: ‘PIX_FMT_BGR24’ was not declared in this scope
             PIX_FMT_BGR24,
             ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVFrame* icv_alloc_picture_FFMPEG(int, int, int, bool)’:
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1110:35: error: ‘avcodec_alloc_frame’ was not declared in this scope
 picture = avcodec_alloc_frame();
                               ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1113:33: error: ‘PixelFormat’ was not declared in this scope
 size = avpicture_get_size( (PixelFormat) pix_fmt, width, height);
                             ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1122:38: error: expected ‘)’ before ‘pix_fmt’
                    (PixelFormat) pix_fmt, width, height);
                                  ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: At global scope:
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1104:47: warning: unused parameter ‘pix_fmt’ [-Wunused-parameter]
 static AVFrame * icv_alloc_picture_FFMPEG(int pix_fmt, int width, int height, bool alloc)
                                           ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: In function ‘AVStream* icv_add_video_stream_FFMPEG(AVFormatContext*, AVCodecID, int, int, int, double, int)’:
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp:1230:19: error: ‘PixelFormat’ was not declared in this scope
 c->pix_fmt = (PixelFormat) pixel_format;
               ^
/home/matthias/Programs/opencv-3.0.0/modules/videoio/src/cap_ffmpeg_impl.hpp: At global scope:
/home/matthias/Programs/opencv-3.0.0 ...
(more)