Raspberry Pi 5 64bit

 

Download

mediamtx_v1.10.0_linux_arm64v8.tar.gz

 

Mediamtx.yaml

paths:
   cam1:
     runOnInit: bash -c 'rpicam-vid -t 0 --camera 0 --nopreview --codec yuv420 --width 640 --height 360 --inline --listen -o - | ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 640x360 -i /dev/stdin -c:v libx264 -preset ultrafast -tune zerolatency -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH'
     runOnInitRestart: yes

 

 

http://[라즈베리파이IP]:8889/cam1

 

참고

https://github.com/Nerdy-Things/raspberry-pi-5-live-stream/

 

GitHub - Nerdy-Things/raspberry-pi-5-live-stream

Contribute to Nerdy-Things/raspberry-pi-5-live-stream development by creating an account on GitHub.

github.com

 

 

 

[서비스 등록]

neptune@raspberrypi:~/dev/mediamtx $ ll
total 58524
-rw-r--r-- 1 neptune neptune     1062 Dec  3 18:14 LICENSE
-rwxr-xr-x 1 neptune neptune 40911393 Dec  3 18:16 mediamtx
-rw-r--r-- 1 neptune neptune 18973721 Dec  3 18:17 mediamtx_v1.10.0_linux_arm64v8.tar.gz
-rw-r--r-- 1 neptune neptune    28721 Dec 30 13:11 mediamtx.yml
neptune@raspberrypi:~/dev/mediamtx $ sudo mkdir /opt/mediamtx
neptune@raspberrypi:~/dev/mediamtx $ sudo cp mediamtx mediamtx.yml /opt/mediamtx/
neptune@raspberrypi:~/dev/mediamtx $ sudo nano /etc/systemd/system
system/      system.conf
neptune@raspberrypi:~/dev/mediamtx $ sudo nano /etc/systemd/system
system/      system.conf
neptune@raspberrypi:~/dev/mediamtx $ sudo nano /etc/systemd/system/mediamtx.service

 

mediamtx.service

[Unit]
Wants=network.target

[Service]
ExecStart=/opt/mediamtx/mediamtx /opt/mediamtx/mediamtx.yml

[Install]
WantedBy=multi-user.target

 

neptune@raspberrypi:~/dev/mediamtx $ sudo nano /etc/systemd/system/sshd.service
neptune@raspberrypi:~/dev/mediamtx $ sudo nano /etc/systemd/system/mediamtx.service
neptune@raspberrypi:~/dev/mediamtx $ sudo systemctl daemon-reload
neptune@raspberrypi:~/dev/mediamtx $
neptune@raspberrypi:~/dev/mediamtx $
neptune@raspberrypi:~/dev/mediamtx $ sudo systemctl enable --now mediamtx
Created symlink /etc/systemd/system/multi-user.target.wants/mediamtx.service → /etc/systemd/system/mediamtx.service.
neptune@raspberrypi:~/dev/mediamtx $ sudo systemctl status mediamtx
● mediamtx.service
     Loaded: loaded (/etc/systemd/system/mediamtx.service; enabled; preset: enabled)
     Active: active (running) since Thu 2025-01-02 11:02:14 KST; 6s ago
   Main PID: 6680 (mediamtx)
      Tasks: 33 (limit: 4756)
        CPU: 1.423s
     CGroup: /system.slice/mediamtx.service
             ├─6680 /opt/mediamtx/mediamtx /opt/mediamtx/mediamtx.yml
             ├─6687 bash -c "rpicam-vid -t 0 --camera 0 --nopreview --codec yuv420 --width 640 --height 360 --inline --listen -o - | ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 640x360 -i /dev/stdin -c:v libx264 -preset ultrafast -tune zerolatency -f rtsp rtsp://localhost:8554/cam1"
             ├─6691 rpicam-vid -t 0 --camera 0 --nopreview --codec yuv420 --width 640 --height 360 --inline --listen -o -
             └─6692 ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 640x360 -i /dev/stdin -c:v libx264 -preset ultrafast -tune zerolatency -f rtsp rtsp://localhost:8554/cam1

Jan 02 11:02:15 raspberrypi mediamtx[6680]: 2025/01/02 11:02:15 INF [RTSP] [session 872d583c] created by [::1]:35446
Jan 02 11:02:15 raspberrypi mediamtx[6680]: 2025/01/02 11:02:15 INF [RTSP] [session 872d583c] is publishing to path 'cam1', 1 track (H264)
Jan 02 11:02:15 raspberrypi mediamtx[6692]: Output #0, rtsp, to 'rtsp://localhost:8554/cam1':
Jan 02 11:02:15 raspberrypi mediamtx[6692]:   Metadata:
Jan 02 11:02:15 raspberrypi mediamtx[6692]:     encoder         : Lavf59.27.100
Jan 02 11:02:15 raspberrypi mediamtx[6692]:   Stream #0:0: Video: h264, yuv420p(progressive), 640x360, q=2-31, 25 fps, 90k tbn
Jan 02 11:02:15 raspberrypi mediamtx[6692]:     Metadata:
Jan 02 11:02:15 raspberrypi mediamtx[6692]:       encoder         : Lavc59.37.100 libx264
Jan 02 11:02:15 raspberrypi mediamtx[6692]:     Side data:
Jan 02 11:02:15 raspberrypi mediamtx[6692]:       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A

+ Recent posts