From charlesreid1

Mini CCTV camera that is embedded in a screw.

Prerequisite software

$ apt-get -y install guvcview

Next install some prerequisite software for mjpg-streamer:

$ apt-get -y install cmake libjpeg62-turbo-dev
$ git clone https://github.com/jacksonliam/mjpg-streamer.git
$ cd mjpg-streamer/
$ cd mjpg-streamer-experimental
$ make
$ make install

Flags

Input Flags

When specifying the input .so, use the following flags:

The -d flag is used to specify the device - for example, /dev/video0.

The -n flag is useful for suppressing error messages about pan/tilt controls, which most cameras don't have anyway.

The -y flag is used to specify YUYV format, in case the camera does not support mjpeg format.

The -r flag specifies the resolution, or whatever.

The -f flag specifies the frame rate.


Errors

Failure attempt 1: No image at all

Tried this command, but no images showed up at all through the web interface - just a broken image icon:

$ ./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -p 8080 -w ./www"

No images at all, just a broken image icon (again):

$ ./mjpg_streamer -i "./input_uvc.so -n" -o "./output_http.so -p 8080 -w ./www"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: MJPEG
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

Broken image icon:

$ ./mjpg_streamer -i "./input_uvc.so -n -d /dev/video0" -o "./output_http.so -p 8080 -w ./www"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: MJPEG
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

Semi Working Attempt 2

$ ./mjpg_streamer -i "./input_uvc.so -n -d /dev/video0 -y" -o "./output_http.so -p 8080 -w ./www"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: YUV
 i: JPEG Quality......: 80
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

And the output in the web browser:

File:ScrewCamera1.jpg

Bingo - except, that's the built-in webcam. Should have paid closer attention to the /dev/ folder.

$ /bin/ls /dev/video*
/dev/video0  /dev/video1

Now trying video 1:

$ ./mjpg_streamer -i "./input_uvc.so -n -d /dev/video0 -y" -o "./output_http.so -p 8080 -w ./www"
MJPG Streamer Version: svn rev: 3:172
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: 5
 i: Format............: YUV
 i: JPEG Quality......: 80
 o: www-folder-path...: ./www/
 o: HTTP TCP port.....: 8080
 o: username:password.: disabled
 o: commands..........: enabled

And here we are:

File:ScrewCamera2.jpg