주 메뉴 열기

wwiki β

바뀜

Tvheadend

3,859 바이트 추가됨, 2022년 2월 9일 (수) 22:26
편집 요약 없음
https://tvheadend.org/
Hauppauge WinTV-dualHD기준이다.dualHD
== Raspbian ==bullseyeNbullseye
raspberry pi 3B
설치 도중 관리자 계정을 설정하는데, 설치 완료 후에 웹 인터페이스에 로그인 할 때 사용한다.
서비스로 실행된다. 서비스명은 tvheadend.service이다. $ systemctl status tvheadend.service서비스 파일을 보면 /etc/default/tvheadend 설정을 사용한다. 이 파일에 사용자등을 확인할 수 있다.<syntaxhighlight lang="ini"># TVH_USER# if set to "" will run as rootTVH_USER="hts"</syntaxhighlight>hts 사용자로 실행되며, /home/hts를 홈으로 사용한다. 홈 디렉토리의 .hts/tvheadend에 관련 파일들이 있다.  사용자는 녹화와 관련하여 권한과 관련이 있다. [[NFS]], [[samba]]를 사용하여 공유폴더에 녹화한다면 추가설정이 필요할 수 있다. = 설정 == Configuration ===
http://localhost:9981
===== Channels =====
"Map services"를 눌러 매핑한다.  ===== EPG Grabber ===== ====== Internal Grabber Settings ======[[Cron]]문법이다.  서비스 시작할 때 internal grabbers를 실행할 수 있다. ===== EPG Grabber Modules =====/usr/bin/tv_* 로 시작하는 파일을 서비스가 시작할 때 불러와 리스트업한다. <br />다음과 같이 간단하게 작성하고 리스트에서 description이 같은 "Internal:XMLTV:'''My korean grabber'''"를 선택하고 Enabled를 체크한다.  채널명과 일치하지 않는 경우에는 자동매칭되지 않으므로 Channels탭에서 직접 지정해 준다. <syntaxhighlight lang="bash">#!/bin/sh if [ "x$1" = "x" ]; then curl https://plex.kr/xmltv.xml exit 0fi case "$1" in --description) echo "My korean grabber" ;; --version) echo "1.0" ;; --capabilities) echo "baseline" ;;esac</syntaxhighlight> ==== Stream ==== ===== Stream Profiles =====default는 pass이다. MPEG-TS pass-thru, 녹화하면 ts확장자를 가진다. ===== Codec Profiles =====Stream Profile에서 사용할 [[코덱]] 프로파일을 관리한다. rpi3 에서 h264_omx는 deprecated. h264_v4l2m2m가 표준이 되었다. tvheadend 4.3버전에서 지원되지 않은 것으로 보인다. libx264로 cpu로 트랜스코딩이 가능하지만 사용량이 많아 녹화 스케줄과 겹친다면 문제가 생길 것으로 보인다.  ffmepg로 변환이 가능하다. bitrate는 설정하지 않으면 5M인 것으로 보인다. 원본 ts가 10M인 경우에는 화질저하가 생기므로 직접 지정 할 수 있다. $ [[FFmpeg|ffmpeg]] -i input.ts -c:v h264_v4l2m2m -b:v 10M -num_capture_buffers 64 -c:a copy out.mp4num_capture_buffers를 지정하지 않으면 "All capture buffers returned to userspace. Increase num_capture_buffers to prevent device deadlock or dropped packets/frames."에러가 발생한다. ==== Recording ==== ===== Digital Video Recorder Profiles ===== ====== Filesystem Settings ======Storage path에 쓰기 권한이 있어야 한다. 기본 실행은 hts 유저로 실행된다. Directory permissions, File permissions는 기본값을 유지하는 것이 보안상 좋다. Character set: 한국어라면 UTF-8이 무난하다.  Format string/Pathname specification: $t/$t.%F$-e$n.$x %F(날짜)앞에 구분하는 . 정도를 넣을 수 있다. ====== Filename/Tagging Settings ======Replace whitespace in title with '-': 체크하면 지저분해 보일 수 있다. Use Windows-compatible filenames: 윈도우에 파일을 복사하려는 경우등이 생길 수 있으므로 체크하는 것이 좋다. ====== Miscellaneous Settings ======Post-processor command: 녹화 후 추가 명령을 실행할 수 있다. (ex: /home/pi/tvheadend/post-processor.sh "%f" ) 하드웨어 인코딩을 지원하지 않는 라즈베리파이에서 유용하다. 인코딩 후 삭제하는 등 여러가지 명령어를 처리해야 하는 경우에는 스크립트 파일로 분리하는 것이 관리하기 용이하다.  ==== Debugging ==== ===== Configuration =====Debug to syslog를 체크하면 Post-processor command 스크립트 수정에 용이하다. == API ==https://github.com/dave-p/TVH-API-docs[[분류:멀티미디어]]
편집
2,431