Git Product home page Git Product logo

cvsandbox / cam2web Goto Github PK

View Code? Open in Web Editor NEW
181.0 20.0 71.0 2.05 MB

Streaming camera to web as MJPEG stream or individual JPEG snapshots. Providing embedded web UI for watching camera directly from a web browser.

Home Page: http://www.cvsandbox.com/projects/cam2web/

License: GNU General Public License v2.0

C++ 94.59% C 0.46% JavaScript 0.49% HTML 2.49% CSS 0.24% Makefile 1.72%
camera streaming-camera mjpeg-stream raspberry-pi

cam2web's Issues

Streaming function display fix old images instead of display video streaming

Hi, firstly, I want to thank you for making an amazing software.
Secondly, recently, I have face an issue that I still do not know how to fix it clearly.. Sometime I use streaming function to display the video, it displayed a fix image rather than showing video streaming (this could be an old image from earlier day or the last image which was captured. To be more specific, besides using streaming function, we also develop a supportive tool to capture photo through the camera).

My question here is: "Does cam2web's library save the lastest photo somewhere or this issues related to our camera which is Logitech C525"
Thank you, looking forward to hearing from you asap.

RPi & USB Cam

Are there any plans to support USB cameras on raspbian in the future?

Thank you for the usefull piece of software. ๐Ÿ‘๐Ÿฝ

Cheers

Windows terminal version?

maybe this is too much to ask, but is there something similar to the linux version.. but for windows.

Failed setting video format

Hello,

Hello, I wanted to run an application on Ubuntu, but I get an error every time "Failed setting video format" :
image

I tried to install on Ubuntu and Debian as well as two different image sources - a physical usb camera and a camera simulator. Same error all the time, please help.

I don't use any attributes when starting the application, just defaults.

add text overlay to image?

Is it possible to add text overlay & timestamp to image/video so that multiple similar streams can be distinguished?

build errors

i am trying to build app

on building "cam2web" I receive following errors

Severity Code Description Project File Line Suppression State
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 266
Error (active) E0020 identifier "__cpuid" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 171
Error (active) E0020 identifier "_mm_set_epi8" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 266
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 267
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 268
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 269
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 270
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 271
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 272
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 278
Error (active) E0020 identifier "_mm_loadu_si128" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 282
Error (active) E0020 identifier "__m128i" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 282
Error (active) E0029 expected an expression cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 282
Error (active) E0018 expected a ')' cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 282
Error (active) E0029 expected an expression cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 283
Error (active) E0029 expected an expression cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 284
Error (active) E0020 identifier "_mm_storeu_si128" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 286
Error (active) E0029 expected an expression cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 286
Error (active) E0018 expected a ')' cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 286
Error (active) E0029 expected an expression cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 290
Error (active) E0020 identifier "_mm_or_si128" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 291
Error (active) E0020 identifier "_mm_or_si128" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 292
Error (active) E0020 identifier "_mm_shuffle_epi8" is undefined cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 292
Error (active) E0029 expected an expression cam2web D:\TOOLS\cam2web-master\cam2web-master\src\core\cameras\DirectShow\XLocalVideoDevice.cpp 296
Error C3861 '__cpuid': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 171
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 266
Error C2146 syntax error: missing ';' before identifier 'swapIndeces_0' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 266
Error C2065 'swapIndeces_0': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 266
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 266
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 267
Error C2146 syntax error: missing ';' before identifier 'swapIndeces_1' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 267
Error C2065 'swapIndeces_1': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 267
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 267
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 268
Error C2146 syntax error: missing ';' before identifier 'swapIndeces_2' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 268
Error C2065 'swapIndeces_2': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 268
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 268
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 269
Error C2146 syntax error: missing ';' before identifier 'chunk0IndecesFrom1' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 269
Error C2065 'chunk0IndecesFrom1': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 269
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 269
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 270
Error C2146 syntax error: missing ';' before identifier 'chunk2IndecesFrom1' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 270
Error C2065 'chunk2IndecesFrom1': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 270
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 270
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 271
Error C2146 syntax error: missing ';' before identifier 'chunk1IndecesFrom0' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 271
Error C2065 'chunk1IndecesFrom0': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 271
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 271
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 272
Error C2146 syntax error: missing ';' before identifier 'chunk1IndecesFrom2' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 272
Error C2065 'chunk1IndecesFrom2': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 272
Error C3861 '_mm_set_epi8': identifier not found cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 272
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 278
Error C2146 syntax error: missing ';' before identifier 'chunk0' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 278
Error C2065 'chunk0': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 278
Error C2065 'chunk1': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 278
Error C2065 'chunk2': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 278
Error C2065 'chunk0': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 282
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 282
Error C2059 syntax error: ')' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 282
Error C2065 'chunk1': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 283
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 283
Error C2059 syntax error: ')' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 283
Error C2065 'chunk2': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 284
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 284
Error C2059 syntax error: ')' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 284
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 286
Error C2059 syntax error: ')' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 286
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 290
Error C2059 syntax error: ')' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 290
Error C2065 '__m128i': undeclared identifier cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 296
Error C2059 syntax error: ')' cam2web d:\tools\cam2web-master\cam2web-master\src\core\cameras\directshow\xlocalvideodevice.cpp 296
Warning C4456 declaration of 'lock' hides previous local declaration cam2web d:\tools\cam2web-master\cam2web-master\src\core\xwebserver.cpp 499

crashes on win7?

Hi. I used your cam2web. . Exe, the web page that reads video, crashes on individual Windows 7 machines, but not on windows 10

9 times out of 10, it will say "0 fps" and wont stream.

This is an issue I have just been ignoring for the longest time, but now I am addressing it. This happens with the OBS virtual camera and at any resolution. I have tried 512x256@20fps and 1920x1080@30fps and both have the same issue.

ADDITIONAL BUG: clicking on where the FPS is displayed while it is running crashes the entire program (lol)

*for the video below, the program closing is me clicking in the FPS area

GIF 3-15-2022 3-23-34 PM

How to develop in real website ?

Hi Sir, I want to publish video stream to real web, not localhost:8000
Please help me understand and do it.
Thanks sir very much !!!

across the domain?

Hello, can your Mongoose access the URL, post the request data across the domain?

Memory leak during video acquisition loop

Trying to manually start a video stream results in a memory leak, which crashes cam2web.

  • Cam2Web compiled with v142 PlatformToolset and Win10 as TargetPlatform
  • Relase x64 build
  • Executed on a Win10 Machine
  • Stacktrace retrieved via ApplicationVerifier cam2web.exe.xml.txt

URL with credentials

Hi Andrew,

Thanks for making an awesome and useful utility like this.

After adding User Access Control, I would like to know what URL format to use that allows me to pass in the username and password directly without having to enter them in the popup.
I've tried these variations without any luck:

http://myuser:mypassword@ip:port/camera/mjpeg
and
http://ip:port/camera/mjpeg&u=myuser&p=mypassword

Any idea if this is possible or not?

Following Linux build instructions creates unrunnable files

I am trying to build cam2web on the AntiX Linux OS so I can use it alongside OctoPrint on some older hardware.

I followed the instructions in here. I installed libjpeg-dev and built cam2web using the commands provided without any issues.

However, when I navigate to the executables in build/gcc/release/bin and type cam2web -? I get the error "bash: cam2web: command not found" when the expected behavior is that I should see some kind of help message.

Complete Linux beginner here, so I don't even have the slightest clue on how to troubleshoot this. The search results I get from Google fly miles over my head. It might have something to do with the make command making a shared library instead of a real executable??? Any help would be appreciated.

Auto stream on startup

Hi, Is there a way to auto start the stream on app startup?

I put the app in the Windows startup folder and i can see that is automatically launched . However it was not able to start streaming automatically. Is there any flag or argument that i can pass along to auto start the stream?

Digest authorization for second instance of web server

Hello Andrew,
first of all I have to say thank you for your great project.
Now i use it for two month with the /adminport option and it works perfect.

But I've spent many hours with a problem without being able to solve it.
I can send GET and POST with my control but without the digest authorization.

Please, can you add a function to deactivate it?

Thanks in advance for your help!

Best regards,
Christian

Error "Failed preparing device to run"

I get this error when trying to start the stream on Windows 10, from a debug and release build from head, using VS 2019:
image

The video stream doesn't output anything (the web UI just shows a blank image).

Second instance of web server

Hello Andrew,
i use your cam2web for many days and it works fine. Thank you for this very great project.

But one feature i miss and this is my question:
Can you add a second instance of web server (on another TCP port), which is aimed only for management/administrative tasks only (starting/stopping streaming for now)?

I use the Windows version on a mobile device and when i always start the program, the battery is faster empty.

I hope you can add this feature?

Thanks in advance

Best regards,
Christian

Add camera rotation as an option

Add a rotation option for the Raspberry Pi camera, accept values of 0, 90, 180, 270 (default 0) to allow for different orientations of the camera.

why response.must be set .response.SetTimer( FrameInterval )?

        // provide first image of the MJPEG stream
        response.Printf( "HTTP/1.1 200 OK\r\n"
                         "Cache-Control: no-store, must-revalidate\r\nPragma: no-cache\r\nExpires: 0\r\n"
                         "Connection: close\r\n"
                         "Content-Type: multipart/x-mixed-replace; boundary=--myboundary\r\n"
                         "\r\n" );

        response.Printf( "--myboundary\r\n"
                         "Content-Type: image/jpeg\r\n"
                         "Content-Length: %u\r\n"
                         "\r\n",  Owner->JpegSize );

        response.Send( Owner->JpegBuffer, Owner->JpegSize );

        // get final request handling time
        handlingTime += static_cast<uint32_t>( duration_cast<std::chrono::milliseconds>( steady_clock::now( ) - startTime ).count( ) );

        // set time to provide next images
        response.SetTimer( FrameInterval );

why must set response.SetTimer( FrameInterval) ? Does SetTimer means disconnect the current connection and set the next connection time?

add startup options

Would it be possible to add a menu option to make it so that the application starts on windows start and immediately starts viewing the cam,?

Add a beta / unsupported / testing - recent build to releases

Hello,

Is it possible for you to upload/add a more recent build to the releases?
I'm sure a lot of people wouldn't mind if it was tagged as beta/unsupported/here be dragons etc.
There are just so many fixes that loads of people will love you for :-)

How do you feel about this?

Thanks

patch to pass vs-2019 community

when using vs 2019 community, I must add the following line into src/core/cameras/DirectShow/XLocalVideoDevice.cpp

#include <intrin.h>

Audio streaming?

Feature request

The cam2web.exe is a great tool to stream from my capture card in real-time!

However, a feature that I really miss is the ability to stream the audio channel as well, kind of like what the similar IP Webcam for Android tool does.

Will it be possible to stream the sound as well?

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.