JPery / MJPEGWriter

Lightweight HTTP server to stream your OpenCV processing in C++
MIT License
97 stars 40 forks source link

Can compile on both Windows and Linux #21

Open thomasarmel opened 3 years ago

thomasarmel commented 3 years ago

Hello, I've made some changes but the most important thing is you should be able to compile under windows too. I've used std::thread instead of Posix pthread(). I haven't made any change on the Authorization branch. Thanks for your job :)

thomasarmel commented 3 years ago

mjpeg.zip Compiled with Visual Studio Enterprise 2019 and CLion

JulesThuillier commented 3 years ago

Hello ! Thank you for porting this soft to Windows.. I am trying to use it in Windows 10, VS2019, C++14, but I am encoutering a issue as son as it starts. "unlocked of unowned mutex", in th efirst line of MJPEG::write(cv::Mat frame), when trying to lock mutex_writer. Any idea ? I am looking into fixing this issue, I'll post it here if I find the answer.

thomasarmel commented 3 years ago

Hello @JulesThuillier , Important precision: the code runs only in Release mode on my machine, because of OpenCV (but compiles well in both cases). What about running directly my program from the message above ? Actually I only "cleaned" the code, standardized it from C-like functions to C++ SL and added the correct #define for the cross-platform compilation. I compiled the code with C++ 11 and OpenCV 4, what about you ?

thomasarmel commented 3 years ago

One more precision: I suggest you to compile with a recent release of OpenCV or at least compile with libjpeg-turbo support.

JulesThuillier commented 3 years ago

Hello @thomasarmel, I actually found a fix yesterday, I'll propose a solution on your git as a PR you'll tell me what you think about it. I might do it only next week thought I just took some holidays 😅

thomasarmel commented 3 years ago

Ok thank you have a nice "coding we" ^^