Up インストール 作成: 2021-01-27
更新: 2021-02-22


  1. 最新パッケージリストを取得
      $ sudo apt update
      $ sudo apt upgrade -y

  2. MJPG-streamer をプルダウン (Clone Repo)
      $ mkdir ~/src
      $ cd ~/src
      $ git clone https://github.com/jacksonliam/mjpg-streamer.git

      mjpg-streamer/README.md

  3. MJPG-streamer が必要とするパッケージをインストール
      $ sudo apt install cmake libjpeg8-dev -y
    つぎは,必要かどうか不明
      $ sudo apt install libv4l-dev build-essential imagemagick -y

  4. ~/src のいまの内容
      $ ls
       mjpg-streamer
      mjpg-streamer は,つぎのディレクトリ階層になっている:
        mjpg-streamer/mjpg-streamer-experimental/www

  5. ビルド
    $ cd mjpg-streamer/mjpg-streamer-experimental
    $ make
    $ sudo make install



    make install での install の内容:
    -- Install configuration: "Release" -- Installing: /usr/local/bin/mjpg_streamer -- Set runtime path of "/usr/local/bin/mjpg_streamer" to "/usr/local/lib/mjpg-streamer" -- Up-to-date: /usr/local/share/mjpg-streamer/www -- Installing: /usr/local/share/mjpg-streamer/www/rotateicons.png -- Installing: /usr/local/share/mjpg-streamer/www/favicon.png -- Installing: /usr/local/share/mjpg-streamer/www/static_simple.html -- Installing: /usr/local/share/mjpg-streamer/www/example.jpg -- Installing: /usr/local/share/mjpg-streamer/www/sidebarbg.gif -- Installing: /usr/local/share/mjpg-streamer/www/JQuerySpinBtn.css -- Installing: /usr/local/share/mjpg-streamer/www/java.html -- Installing: /usr/local/share/mjpg-streamer/www/bodybg.gif -- Installing: /usr/local/share/mjpg-streamer/www/jquery.ui.tabs.min.js -- Installing: /usr/local/share/mjpg-streamer/www/videolan.html -- Installing: /usr/local/share/mjpg-streamer/www/jquery.js -- Installing: /usr/local/share/mjpg-streamer/www/stream_simple.html -- Installing: /usr/local/share/mjpg-streamer/www/LICENSE.txt -- Installing: /usr/local/share/mjpg-streamer/www/javascript.html -- Installing: /usr/local/share/mjpg-streamer/www/JQuerySpinBtn.js -- Installing: /usr/local/share/mjpg-streamer/www/style.css -- Installing: /usr/local/share/mjpg-streamer/www/spinbtn_updn.gif -- Installing: /usr/local/share/mjpg-streamer/www/jquery.rotate.js -- Installing: /usr/local/share/mjpg-streamer/www/functions.js -- Installing: /usr/local/share/mjpg-streamer/www/stream.html -- Installing: /usr/local/share/mjpg-streamer/www/javascript_simple.html -- Installing: /usr/local/share/mjpg-streamer/www/java_control.html -- Installing: /usr/local/share/mjpg-streamer/www/java_simple.html -- Installing: /usr/local/share/mjpg-streamer/www/jquery.ui.custom.css -- Installing: /usr/local/share/mjpg-streamer/www/javascript_motiondetection.html -- Installing: /usr/local/share/mjpg-streamer/www/jquery.ui.core.min.js -- Installing: /usr/local/share/mjpg-streamer/www/index.html -- Installing: /usr/local/share/mjpg-streamer/www/jquery.ui.widget.min.js -- Installing: /usr/local/share/mjpg-streamer/www/static.html -- Installing: /usr/local/share/mjpg-streamer/www/fix.css -- Installing: /usr/local/share/mjpg-streamer/www/cambozola.jar -- Installing: /usr/local/share/mjpg-streamer/www/favicon.ico -- Installing: /usr/local/share/mjpg-streamer/www/control.htm -- Installing: /usr/local/lib/mjpg-streamer/input_file.so -- Installing: /usr/local/lib/mjpg-streamer/input_http.so -- Installing: /usr/local/lib/mjpg-streamer/input_uvc.so -- Installing: /usr/local/lib/mjpg-streamer/output_file.so -- Installing: /usr/local/lib/mjpg-streamer/output_http.so -- Installing: /usr/local/lib/mjpg-streamer/output_rtsp.so -- Installing: /usr/local/lib/mjpg-streamer/output_udp.so
    $ ls /usr/local/share/mjpg-streamer www
    $ ls /usr/local/share/mjpg-streamer/www bodybg.gif javascript.html jquery.ui.widget.min.js cambozola.jar javascript_motiondetection.html LICENSE.txt control.htm javascript_simple.html rotateicons.png example.jpg java_simple.html sidebarbg.gif favicon.ico jquery.js spinbtn_updn.gif favicon.png jquery.rotate.js static.html fix.css JQuerySpinBtn.css static_simple.html functions.js JQuerySpinBtn.js stream.html index.html jquery.ui.core.min.js stream_simple.html java_control.html jquery.ui.custom.css style.css java.html jquery.ui.tabs.min.js videolan.html
    $ ls /usr/local/lib/mjpg-streamer input_file.so input_uvc.so output_http.so output_udp.so input_http.so output_file.so output_rtsp.so
    $ ls ~/mjpg-streamer mjpg-streamer-experimental README.md
    $ ls ~/mjpg-streamer/mjpg-streamer-experimental _build input_http.so mjpg_streamer.c output_udp.so TODO cmake input_uvc.so mjpg_streamer.h plugins utils.c CMakeLists.txt LICENSE mjpg_streamer@.service postinstall.sh utils.h Dockerfile makedeb.sh output_file.so README.md www docker-start.sh Makefile output_http.so scripts input_file.so mjpg_streamer output_rtsp.so start.sh ( /usr/local/lib/mjpg-streamer の中のファイルは,すべてここにある )


    $ ls ~/mjpg-streamer/mjpg-streamer-experimental/www bodybg.gif javascript.html jquery.ui.widget.min.js cambozola.jar javascript_motiondetection.html LICENSE.txt control.htm javascript_simple.html rotateicons.png example.jpg java_simple.html sidebarbg.gif favicon.ico jquery.js spinbtn_updn.gif favicon.png jquery.rotate.js static.html fix.css JQuerySpinBtn.css static_simple.html functions.js JQuerySpinBtn.js stream.html index.html jquery.ui.core.min.js stream_simple.html java_control.html jquery.ui.custom.css style.css java.html jquery.ui.tabs.min.js videolan.html ( /usr/local/share/mjpg-streamer/www の内容と同じ )


    備考
    つぎは,失敗した方法
  • MJPG-streamer が必要とするパッケージをインストール
      $ sudo apt-get install subversion libjpeg-dev imagemagick

  • MJPE-streamer のソースファイルを取得
      $ svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer mjpg-streamer

  • ビルド
      $ cd mjpg-streamer
      $ make gcc -D'SVN_REV="3:172"' -O2 -DLINUX -D_GNU_SOURCE -Wall -c -o mjpg_streamer.o mjpg_streamer.c gcc -D'SVN_REV="3:172"' -O2 -DLINUX -D_GNU_SOURCE -Wall -c -o utils.o utils.c In file included from /usr/include/arm-linux-gnueabihf/sys/stat.h:446, from utils.c:33: /usr/include/arm-linux-gnueabihf/bits/statx.h:25:8: error: redefinition of ‘struct statx_timestamp’ struct statx_timestamp ^~~~~~~~~~~~~~~ In file included from utils.c:32: /usr/include/linux/stat.h:56:8: note: originally defined here struct statx_timestamp { ^~~~~~~~~~~~~~~ In file included from /usr/include/arm-linux-gnueabihf/sys/stat.h:446, from utils.c:33: /usr/include/arm-linux-gnueabihf/bits/statx.h:36:8: error: redefinition of ‘struct statx’ struct statx ^~~~~ In file included from utils.c:32: /usr/include/linux/stat.h:99:8: note: originally defined here struct statx { ^~~~~ make: *** [<builtin>: utils.o] Error 1