・コンパイルに必要なライブラリをインストールします

[root@alma]# dnf -y install libjpeg*
[root@alma]# dnf -y install --enablerepo=epel yasm

・依存関係 libmicrohttpd-devel のインストール

[root@alma]# dnf -y install libjpeg-turbo libjpeg-turbo-devel gettext libmicrohttpd-devel

・Motion をダウンロードします

[root@alma]# wget https://github.com/Motion-Project/motion/archive/refs/tags/release-4.7.0.zip

・ダウンロードファイルを解凍します

[root@alma]# unzip release-4.7.0.zip

・解凍したダウンロードファイルに移動します

[root@alma]# cd motion-release-4.7.0/

・autoreconf でインストールします

[root@alma]# autoreconf -fiv && ./configure && make && make install

・ホームに戻ります

root か su(スーパーユーザー)によって違います

[root@alma]# cd

・motion の設定ファイル作成します

設定ファイルの雛型がありますのでそれをコピーします

[root@alma]# cp /usr/local/etc/motion/motion-dist.conf /usr/local/etc/motion/motion.conf

・motion の設定をします

[root@alma]# vi /usr/local/etc/motion/motion.conf

≪途中省略≫

############################################################
# System control configuration parameters
############################################################

# Start in daemon (background) mode and release terminal.
daemon off
※ 変更(デーモンで起動)
daemon on

≪途中省略≫

############################################################
# Image Processing configuration parameters
############################################################

# Image width in pixels.
width 640※ 画像の横サイズを変更したい場合は任意に変更

# Image height in pixels.
height 480※ 画像の横サイズを変更したい場合は任意に変更

# Maximum number of frames to be captured per second.
framerate 15
※ 1秒間にカメラからキャプチャされる最大フレーム数
framerate 100

# Text to be overlayed in the lower left corner of images
text_left CAMERA1
※ 配信画面左下に表示される文字列
text_left Papa-Net CAMERA

# Text to be overlayed in the lower right corner of images.
text_right %Y-%m-%d\n%T-%q

############################################################
# Motion detection configuration parameters
############################################################

# Always save pictures and movies even if there was no motion.
emulate_motion off

# Threshold for number of changed pixels that triggers motion.
threshold 1500※ 必要に応じ変更 最大値にすると認知しなくなのるので監視カメラとして使用しない場合は最大値(2147483647)にする

# Noise threshold for the motion detection.
; noise_level 32

# Despeckle the image using (E/e)rode or (D/d)ilate or (l)abel.
despeckle_filter EedDl

# Number of images that must contain motion to trigger an event.
minimum_motion_frames 1

# Gap in seconds of no motion detected that triggers the end of an event.
event_gap 60

# The number of pre-captured (buffered) pictures from before motion.
pre_capture 3

# Number of frames to capture after motion is no longer detected.
post_capture 0

≪途中省略≫

############################################################
# Movie output configuration parameters
############################################################

# Create movies of motion events.
movie_output on

# Maximum length of movie in seconds.
movie_max_time 60

# The encoding quality of the movie. (0=use bitrate. 1=worst quality, 100=best)
movie_quality 45
※ 映像クオリティーを最大 ただし、カメラの解像度によって調整
movie_quality 100

# Container/Codec to used for the movie. See motion_guide.html
movie_codec mkv

# File name(without extension) for movies relative to target directory
movie_filename %t-%v-%Y%m%d%H%M%S

############################################################
# Webcontrol configuration parameters
############################################################

# Port number used for the webcontrol.
webcontrol_port 8080※ ポートを変更したい場合は書き換える

# Restrict webcontrol connections to the localhost.
webcontrol_localhost on

# Type of configuration options to allow via the webcontrol.
webcontrol_parms 0

############################################################
# Live stream configuration parameters
############################################################

# The port number for the live stream.
stream_port 8081※ ポートを変更したい場合は書き換える

# Restrict stream connections to the localhost.
stream_localhost on
※ 変更 ローカルホスト以外もライブ映像を配信
stream_localhost off

≪以下省略≫