Skip to content

Camhi app을 시용하는 IP Camera에서 FTP로 넘어오는 265 비디오 파일을 재생호환성이 좋은 mkv파일로 변환하고, 날짜폴더로 이동하는 파이썬 스크립트

Notifications You must be signed in to change notification settings

ohnggni/camhi-video-convert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

이 파일은 Aliexpress에서 판매하는 IP Camera의 CamHi앱에서 ftp로 Alram recording을 실시하는 경우 파일이 확장자265로 저장되어 재생호환성이 떨어지므로 이를 보완하기 위해 mp4로 변환하는 스크립트이다.

0. FTP 서버설치 및 설정

sudo apt update
sudo apt install vsftpd -y
sudo nano /etc/vsftpd.conf
anonymous_enable=NO              # 익명 접속 금지
local_enable=YES                 # 로컬 사용자 접속 허용
write_enable=YES                 # 파일 업로드 허용
local_umask=022                  # 파일 권한 설정
allow_writeable_chroot=YES       # chroot 환경에서 쓰기 허용
pasv_enable=YES                  # Passive 모드 활성화
pasv_min_port=40000              # Passive 포트 범위
pasv_max_port=50000
sudo systemctl restart vsftpd

1. 서비스 파일을 생성한다.

nano /etc/systemd/system/convert_script.service
[Unit]
Description=265 to MP4 Conversion Script
After=network.target

[Service]
ExecStart=/usr/bin/python3 /path/to/convert_265_to_mp4.py
WorkingDirectory=/home/ohnggni
Restart=always
User=ohnggni

[Install]
WantedBy=multi-user.target

2. 서비스 활성화 및 실행

sudo systemctl daemon-reload
sudo systemctl enable convert_script.service
sudo systemctl start convert_script.service

3. 상태 확인

sudo systemctl status convert_script.service

4. 서비스 재시작 (필요시, 파일 수정 이후 등)

sudo systemctl daemon-reload
sudo systemctl restart convert_script.service

About

Camhi app을 시용하는 IP Camera에서 FTP로 넘어오는 265 비디오 파일을 재생호환성이 좋은 mkv파일로 변환하고, 날짜폴더로 이동하는 파이썬 스크립트

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages