liuliu / ccv

C-based/Cached/Core Computer Vision Library, A Modern Computer Vision Library
http://libccv.org
Other
7.07k stars 1.71k forks source link

How read /dev/video0 with ffmpeg in c++? #231

Open LaurentDelaon opened 2 years ago

LaurentDelaon commented 2 years ago

Hi

using ccv with TLD, I want to read pictures from /dev/video0 with an usb cam.

I will to using ffmpeg like this : ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 output.avi I have try to follow your example on get starting like :

#include <ccv.h>
int main(int argc, char** argv)
        ccv_dense_matrix_t* image = 0;
       ccv_read(argv[1], &image, CCV_IO_RGB_COLOR | CCV_IO_ANY_FILE);

But seem not clear to me... May I have other possibilities to do that more easily? How can I do this? thank's for help. Laurent.