mjpg-streamer在Ubuntu下编译,运行

时间:2022-09-12 05:22:11

1.将USB摄像头插上,查看是否找到设备,输入:

wp@ubuntu:/home/$    ls   /dev/video*

/dev/video0

2.安装必要的软件集:

sudo apt-get install subversion  libv4l-dev  libjpeg62-dev  imagemagick

3.下载mipg-streamer软件,编译并安装:

git clone https://github.com/shrkey/mjpg-streamer
cd mjpg-streamer/mjpg-streamer
make clean all
sudo make install

ps:重新编译前,需要执行
make clean(相对make)
make uninstall(相对make install)

4.开启视频服务器

wp@ubuntu:/home/mjpg-streamer/mjpg-streamer$ ./start.sh 

MJPG Streamer Version: svn rev: Unversioned directory

 i: Using V4L2 device.: /dev/video0

 i: Desired Resolution: 640 x 480

 i: Frames Per Second.: 5

 i: Format............: MJPEG

Adding control for Pan (relative)

UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device

Adding control for Tilt (relative)

UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device

Adding control for Pan Reset

UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device

Adding control for Tilt Reset

UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device

Adding control for Pan/tilt Reset

UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device

Adding control for Focus (absolute)

UVCIOC_CTRL_ADD - Error: Inappropriate ioctl for device

mapping control for Pan (relative)

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Tilt (relative)

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Pan Reset

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Tilt Reset

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Pan/tilt Reset

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Focus (absolute)

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for LED1 Mode

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for LED1 Frequency

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Disable video processing

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

mapping control for Raw bits per pixel

UVCIOC_CTRL_MAP - Error: Inappropriate ioctl for device

 o: www-folder-path...: ./www/

 o: HTTP TCP port.....: 8080

 o: username:password.: disabled

 o: commands..........: enabled

( 注意:在ubuntu 里面运行 ,这里面的错误可以不用理会 )

或者在profile文件中,添加如下代码,将其添加到环境变量中。

sudo nano /etc/proflie
export LD_LIBRARY_PATH=/usr/local/lib


5 测试:

http://192.168.1.200:8080/

mjpg-streamer在Ubuntu下编译,运行