Giter Club home page Giter Club logo

cpp-mjpeg-streamer's People

Contributors

kamalnadjieb avatar leonitousconforti avatar mecraggs avatar tibkel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cpp-mjpeg-streamer's Issues

Build failed in external directory

Steps:

developer@alex-WorkStation:~/build$ cmake ../cpp-mjpeg-streamer/
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using the single-header code from /home/developer/cpp-mjpeg-streamer/single_include/
-- Configuring done
-- Generating done
-- Build files have been written to: /home/developer/build
developer@alex-WorkStation:~/build$ make 
Scanning dependencies of target doctest_main
[ 14%] Building CXX object test/CMakeFiles/doctest_main.dir/src/unit.cpp.o
[ 14%] Built target doctest_main
Scanning dependencies of target test-streamer
[ 28%] Building CXX object test/CMakeFiles/test-streamer.dir/src/unit-streamer.cpp.o
[ 42%] Linking CXX executable test-streamer
[ 42%] Built target test-streamer
Scanning dependencies of target test-http-message
[ 57%] Building CXX object test/CMakeFiles/test-http-message.dir/src/unit-http-message.cpp.o
/home/developer/cpp-mjpeg-streamer/test/src/unit-http-message.cpp:3:10: fatal error: nadjieb/detail/http_message.hpp: No such file or directory
    3 | #include <nadjieb/detail/http_message.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [test/CMakeFiles/test-http-message.dir/build.make:63: test/CMakeFiles/test-http-message.dir/src/unit-http-message.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1043: test/CMakeFiles/test-http-message.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Unused return Values warnings

`/usr/local/include/nadjieb/mjpeg_streamer.hpp: In lambda function:
/usr/local/include/nadjieb/mjpeg_streamer.hpp:286:62: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
                     ::read(new_socket, &buff[0], buff.size());
                                                              ^

/usr/local/include/nadjieb/mjpeg_streamer.hpp:292:95: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
                         ::write(new_socket, shutdown_res_str.c_str(), shutdown_res_str.size());
                                                                                               ^

/usr/local/include/nadjieb/mjpeg_streamer.hpp:304:115: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
                         ::write(new_socket, method_not_allowed_res_str.c_str(), method_not_allowed_res_str.size());
                                                                                                                   ^

/usr/local/include/nadjieb/mjpeg_streamer.hpp:309:83: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
                     ::write(new_socket, init_res_str.c_str(), init_res_str.size());`

extract video stream from html to c++

Is there any way of extracting real-time HTML video to c++ environment, suppose I have webrtc media which I want to process frame by frame at high-resolution 30fps but the conversion of every frame to base64 using javascript is very computationally expensive and causes too much delay.

Frame Rate

@kamalnadjieb
Thanks for your wonderful repo.
I have a question regarding the frame rate.
Is it possible to set the frame rate for the HTTP streaming?

Unable to build without unit tests

Build with no unit tests does not work

developer@alex-WorkStation:~/build$ rm * -rf
developer@alex-WorkStation:~/build$ cmake -DBUILD_TESTING=OFF ../cpp-mjpeg-streamer/
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using the single-header code from /home/developer/cpp-mjpeg-streamer/single_include/
-- Configuring done
-- Generating done
-- Build files have been written to: /home/developer/build
developer@alex-WorkStation:~/build$ ls
CMakeCache.txt	CMakeFiles  cmake_install.cmake  Makefile  nadjieb_mjpeg_streamerConfig.cmake  nadjieb_mjpeg_streamerConfigVersion.cmake  nadjieb_mjpeg_streamer.pc  nadjieb_mjpeg_streamerTargets.cmake
developer@alex-WorkStation:~/build$ make
developer@alex-WorkStation:~/build$ 

Make has no effect

Stream freezes after some time

Hi, i push 100kb frames every 100ms, and after several hours i can't access stream.
Can you help to resolve it?
Best regards, Viktor.

Two stream in same port

Hello, Can I send stream from two cameras into same port (8081 for example), but with different paths (publish id) ?

localhost:8081/uid1
localhost:8081/uid2

Feature Request

Thanks for this library, I am successfully using it with a thermal camera !

I have two questions: In the example's main loop,

  • How can I know whether a remote client is connected
  • When no client is connected, how can I wait for a new incoming new client while waiting in a blocking state
    (like when calling poll() with a negative timeout)

The goal is to be able to shut down the camera until new clients connects, and wait quietly until then.

Video Flickering issue with usb 3.0 video capture card

I am having video flickering issue in new device(usb 2.0 video capture card) which is connected alternative for frame grabber(epiphan av.io.4k frame grabber). Also, we observed that the issue appears in linux(for virtual display) and with windows(streaming with webcam application) working fine.
Also we are using opencv2/opencv.hpp and cpp-mjpeg-streamer in linux for streaming.

Expected boundary '--' not found

I used opencv capture the frame. But the frame always break.

And opencv returned this to me.

Expected boundary '--' not found, instead found a line of 29 bytes

When I used browser watch the mjpeg. Frame will break sometimes.

Snapshot Feature

I would like to include an option to take a snapshot, instead of streaming.
It's possible ?

"revents != POLLWRNORM\n" (publisher.hpp/153 line)

After connecting more than the maximum number of connections from other users' browsers until access is no longer possible, and then reconnecting (F5) from the existing connected browser, a runtime error with the message "revents != POLLWRNORM\n" occurs.
image

The location is line 153 of publisher.hpp.
Is there an appropriate solution when excessive connection requests occur from different users?

Improve Publisher

Goals:

  • Publisher can stream smoothly without blank frame shown on client's browser on different device.

Serve index.html

Thank you for the nice library. It is helpful.

How can we serve an index.html from the program?

I tried this but did not work.

    MJPEGStreamer streamer;
    streamer.start(8080);
    streamer.publish("/", "<html><body><h1>Hello</h1></body><html>");

crash after a few hours

Hello,

Here is the error message:

0x0000007fb55d39bc in __libc_write (fd=, buf=0x7ee001aff0, nbytes=31909)
at ../sysdeps/unix/sysv/linux/write.c:27
27 ../sysdeps/unix/sysv/linux/write.c: No such file or directory.
(gdb) backtrace
#0 0x0000007fb55d39bc in __libc_write (fd=, buf=0x7ee001aff0, nbytes=31909)
at ../sysdeps/unix/sysv/linux/write.c:27
#1 0x000000555559eedc in nadjieb::MJPEGStreamer::worker()::{lambda()#1}::operator()() const (__closure=0x5585902988) at /usr/include/c++/8/bits/basic_string.h:2290
#2 0x0000007fa6d1848c in () at /usr/lib/aarch64-linux-gnu/libstdc++.so.6
#3 0x0000007fb55ca088 in start_thread (arg=0x7fffffc54f) at pthread_create.c:463
#4 0x0000007fa6ae0ffc in thread_start () at ../sysdeps/unix/sysv/linux/aarch64/clone.S:78

Thanks,

-Scott

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.