본문 바로가기
IT/linux

mplayer / slave mode, idle, standalone, pipe, command, cache

by 어느해겨울 2022. 9. 9.

MPLAYER

 

mplayer slave mode

 - pipe 를 통한 command 전달 mode로 동작

 ex) mplayer -slave

 

1. idle 동작

- mplayer background process로 동작하여 command 전달 시 그에 해당하는 동작 수행.

- idle 동작 시 pipe 를 반드시 지정해야 함.

ex) mplayer -slave -idle -input file=<pipe 파일>

 

2. standalone 동작

- mplayer 실행 시 실행 할 파일/URL 을 입력 받아 동작.

- pipe 지정 시 pipe 를 통한 command 전달 가능.

ex) mplayer -slave –input file=<pipe 파일> <대상 파일/URL>

 

3.  비교

- idle 동작 시 background 로 커맨드만 받아 동작하므로 안정적으로 동작, , 재생 파일의 끝을 알 수 없고, error case condition 을 확인하기가 어려움.

(stdout 메시지에 대한 handling 처리가 필요)

- standard alone 동작 시 재생 파일의 끝 또는 error case 에 대한 대응이 쉬움. , mplayer 의 잦은 재실행으로 메모리, 캐쉬 등 시스템 문제가 생길 요지가 있음.

 

4.  파이프 생성

- 리눅스 명령어 mkfifo 를 통해 pipe를 생성.

- 파이프 네임에 대한 생성만 처리.

ex) mkfifo <pipe 파일명>

 

5.  Command 전달

- echo redirect 를 이용하여 command 전달.

- slave command condition link :

http://code.metager.de/source/xref/mplayer/DOCS/tech/slave.txt

ex) echo "loadfile http://live.ytnradio.kr:8000" > mplayer.pipe

 

6.  시스템 캐쉬 초기화

- linux system 특성상 process 에서 동작되는 메모리를 cache 에 적재.

- streaming 재생 같은 장시간 재생 condition 에서는 cache full 문제 발생 가능.

- cron 또는 주기적 실행 script 동작 처리 가능.

- pagecache, dentries, inodes 모두 해제.

ex) echo 3 > /proc/sys/vm/drop_caches

 

 

'IT > linux' 카테고리의 다른 글

linux awk 예제  (0) 2023.03.21
man 명령어 주요 옵션 / option -f, -k, -K, -w  (0) 2022.09.20
Bogomips 개요, 측정 방법  (0) 2022.09.09
바이너리 동적 라이브러리 링크 확인, Dynamic linker  (1) 2022.09.07
gcc warning case 정리  (0) 2022.09.05

댓글