티스토리 뷰
728x90
출처
- How to build and run MJPG-Streamer on the Raspberry Pi
- 라즈베리파이 파이카메라 활용강좌 : 웹 스트리밍(Mjpg-Stream)
- fishkingsin/mjpg_streamer.sh
- meinside/rpi-mjpg-streamer: Instructions and helper scripts for running mjpg-streamer on Raspberry Pi
MJPG streamer 컴파일 관련 라이브러리 설치
pi@orangepiplus2e:~$ sudo apt update
pi@orangepiplus2e:~$ sudo apt upgrade
pi@orangepiplus2e:~$ sudo apt-get install cmake libjpeg62-turbo-dev imagemagick libv4l-dev libgphoto2-dev
MJPG streamer 소스 다운로드, 컴파일, 설치
pi@orangepiplus2e:~$ git clone https://github.com/jacksonliam/mjpg-streamer.git
pi@orangepiplus2e:~$ cd mjpg-streamer/mjpg-streamer-experimental/
pi@orangepiplus2e:~/mjpg-streamer/mjpg-streamer-experimental$ make
pi@orangepiplus2e:~/mjpg-streamer/mjpg-streamer-experimental$ sudo make install
LD_LIBRARY_PATH 경로 추가
pi@orangepiplus2e:~/mjpg-streamer/mjpg-streamer-experimental$ echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/lib/mjpg-streamer" | sudo tee -a /etc/profile
MJPG Streamer 수동 실행
출처 : MJPG Streamer configuration
pi@orangepiplus2e:~/mjpg-streamer/mjpg-streamer-experimental$ mjpg_streamer -i "input_uvc.so -d /dev/video1 -n -f 25 -r 1280x720" --output "output_http.so -w /usr/local/share/mjpg-streamer/www --port 4998"
MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
i: Using V4L2 device.: /dev/video1
i: Desired Resolution: 1280 x 720
i: Frames Per Second.: 25
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
i: The specified resolution is unavailable, using: width 640 height 480 instead
o: www-folder-path......: /usr/local/share/mjpg-streamer/www/
o: HTTP TCP port........: 4998
o: HTTP Listen Address..: (null)
o: username:password....: disabled
o: commands.............: enabled
mjpg_streamer 실행스크립트
run-mjpg-streamer.sh 생성
pi@orangepiplus2e:~$ sudo vi /usr/local/bin/run-mjpg-streamer.sh
run-mjpg-streamer.sh
#!/bin/sh # # Script for docker # # created by : meinside@gmail.com # last update: 2019.04.24. # ################ # customize these: # mjpg_streamer excutable's location MJPG_STREAMER_BIN="mjpg_streamer" # mjpg_streamer plugins' location MJPG_STREAMER_PLUGINS_DIR="/usr/local/lib/mjpg-streamer" # streaming port MJPG_STREAMER_PORT=4998 # htmls and related files' location MJPG_STREAMER_WWW="/usr/local/share/mjpg-streamer/www" # video device DEVICE_IN="/dev/video1" # video settings RESOLUTION=1920x1080 FPS=10 # authentication USERNAME="" PASSWORD="" if [ ! -z $USERNAME ] && [ ! -z $PASSWORD ]; then AUTH="-c $USERNAME:$PASSWORD" else AUTH="" fi # LED blink LED="off" # on/off/blink/auto (may not work on rpi camera modules) # plugins PLUGIN_IN="$MJPG_STREAMER_PLUGINS_DIR/input_uvc.so -d $DEVICE_IN -r $RESOLUTION -f $FPS -l $LED" PLUGIN_OUT="$MJPG_STREAMER_PLUGINS_DIR/output_http.so -p $MJPG_STREAMER_PORT -w $MJPG_STREAMER_WWW $AUTH" ################ # run mjpg_streamer $MJPG_STREAMER_BIN -i "$PLUGIN_IN" -o "$PLUGIN_OUT" ################
mjpg_streamer 실행스크립트 모드 변경
pi@orangepiplus2e:~$ sudo chmod u+x /usr/local/bin/run-mjpg-streamer.sh
서비스등록
mjpg-streamer.service 생성
pi@orangepiplus2e:~$ sudo vi /lib/systemd/system/mjpg-streamer.service
mjpg-streamer.service
[Unit] Description=Streams video with Raspberry Pi Camera After=syslog.target After=network.target [Service] Type=simple User=root Group=root ExecStart=/usr/local/bin/run-mjpg-streamer.sh Restart=always RestartSec=5 Environment= [Install] WantedBy=multi-user.target
등록
pi@orangepiplus2e:~$ sudo chmod u+x /lib/systemd/system/mjpg-streamer.service
pi@orangepiplus2e:~$ sudo systemctl enable mjpg-streamer.service
Created symlink /etc/systemd/system/multi-user.target.wants/mjpg-streamer.service → /lib/systemd/system/mjpg-streamer.service.
서비스 실행 및 실행 확인
pi@orangepiplus2e:~$ sudo systemctl start mjpg-streamer.service
pi@orangepiplus2e:~$ sudo systemctl status mjpg-streamer.service
● mjpg-streamer.service - Streams video with Raspberry Pi Camera
Loaded: loaded (/lib/systemd/system/mjpg-streamer.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2022-03-12 11:22:57 KST; 22s ago
Main PID: 5653 (run-mjpg-stream)
Tasks: 4 (limit: 4501)
Memory: 568.0K
CPU: 91ms
CGroup: /system.slice/mjpg-streamer.service
├─5653 /bin/sh /usr/local/bin/run-mjpg-streamer.sh
└─5654 mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video1 -r 1920x1080 -f 10 -l off -o /usr/local/lib/mjpg-streamer/>
3월 12 11:23:03 orangepiplus2e run-mjpg-streamer.sh[5654]: o: HTTP Listen Address..: (null)
3월 12 11:23:03 orangepiplus2e run-mjpg-streamer.sh[5654]: o: username:password....: disabled
3월 12 11:23:03 orangepiplus2e run-mjpg-streamer.sh[5654]: o: commands.............: enabled
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: www-folder-path......: /usr/local/share/mjpg-streamer/www/
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: HTTP TCP port........: 4998
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: HTTP Listen Address..: (null)
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: username:password....: disabled
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: commands.............: enabled
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: starting input plugin /usr/local/lib/mjpg-streamer/input_uvc.so
3월 12 11:23:03 orangepiplus2e mjpg_streamer[5654]: MJPG-streamer [5654]: starting output plugin: /usr/local/lib/mjpg-streamer/output_http.so (ID: 00)
댓글
300x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Java
- 레이싱모델 익스트림 포토 페스티벌
- ubuntu
- 일본여행
- Xcode
- Delphi Tip
- 서울오토살롱
- Spring
- 지스타2007
- sas2009
- 동경
- KOBA
- 튜닝쇼 2008
- ffmpeg
- JavaScript
- SAS
- flex
- koba2010
- oracle
- ble
- 송주경
- Delphi
- Linux
- BPI-M4
- Mac
- 전예희
- Spring MVC
- android
- NDK
- MySQL
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함