EBS 교육방송 녹음용 plist

Computing 2015.06.15 20:42

orchistro.ShawnMacHome:~/Library/LaunchAgents$ cat shawn.chinese.plist

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>Label</key>

<string>EBSRadio_Chinese</string>

<key>ProgramArguments</key>

<array>

<string>/Users/orchistro/work/ebs/record.sh</string>

<string>Chinese</string>

<string>20</string>

</array>

<key>StartCalendarInterval</key>

<array>

<dict>

<key>Hour</key>

<integer>5</integer>

<key>Minute</key>

<integer>30</integer>

<key>Weekday</key>

<integer>1</integer>

</dict>

<dict>

<key>Hour</key>

<integer>5</integer>

<key>Minute</key>

<integer>30</integer>

<key>Weekday</key>

<integer>2</integer>

</dict>

<dict>

<key>Hour</key>

<integer>5</integer>

<key>Minute</key>

<integer>30</integer>

<key>Weekday</key>

<integer>3</integer>

</dict>

<dict>

<key>Hour</key>

<integer>5</integer>

<key>Minute</key>

<integer>30</integer>

<key>Weekday</key>

<integer>4</integer>

</dict>

<dict>

<key>Hour</key>

<integer>5</integer>

<key>Minute</key>

<integer>30</integer>

<key>Weekday</key>

<integer>5</integer>

</dict>

<dict>

<key>Hour</key>

<integer>5</integer>

<key>Minute</key>

<integer>30</integer>

<key>Weekday</key>

<integer>6</integer>

</dict>

</array>

</dict>

</plist>

orchistro.ShawnMacHome:~/Library/LaunchAgents$ launchctl load shawn.chinese.plist

orchistro.ShawnMacHome:~/Library/LaunchAgents$ launchctl unload shawn.chinese.plist


Trackback 0 : Comment 0

Write a comment


Changing the default keyboard layout for login screen of Maverick once and for all

Computing 2015.04.27 10:38

http://vkritis.blogspot.be/2014/01/change-default-keyboard-of-osx-login.html


sudo cp ~/Library/Preferences/com.apple.HIToolbox.plist /Library/Preferences/

Trackback 0 : Comment 0

Write a comment


Capturing rtmp to m4a on OSX

Computing 2014.12.11 17:17

After trying several ways to achieve the mission: libav, rtmpdump, etc. I finally landed on a method that utilizes vlc. Bravo vlc!!!


1. Install VLC

http://www.videolan.org/vlc/


2. Run following command:

/Applications/VLC.app/Contents/MacOS/VLC -I dummy rtmp://ebsandroid.ebs.co.kr/fmradiofamilypc/familypc1m vlc://quit --no-sout-video --sout-audio --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=1.wav}" 2> /dev/null


3. Convert resulting wav file to m4a file:

/usr/bin/afconvert -f mp4f -d aac -q 127 1.wav 1.m4a


Why not let vlc directly save output in mp3 format?

Because, the sound quality is not quite good. It left me with no choice but to record using wav format and then convert it to aac format.



#!/bin/bash


ABSPATH_SELF=$(cd $(dirname $0); pwd -P)


if [ $# -ne 2 ];

then

    echo "Usage: $0 filename duration(unit:min)"

    exit 1

fi


FILENAMEROOT=$1

DURATION=$(($2 * 60))


DATE=$(date +"%Y-%m-%d")

WEEKDAY=$(date +"%A")


if [ "${WEEKDAY}" == "Monday" -o "${WEEKDAY}" == "Tuesday" -o "${WEEKDAY}" == "Wednesday" ];

then

    LEVEL="초급"

else

    LEVEL="중급"

fi


FILENAME1="${ABSPATH_SELF}/${FILENAMEROOT}-${DATE}.m4a"

FILENAME2="${ABSPATH_SELF}/${FILENAMEROOT}-${DATE}(${WEEKDAY}-${LEVEL}).m4a"

FILENAME3="${ABSPATH_SELF}/${FILENAMEROOT}-${DATE}(${WEEKDAY_KOR}).m4a"


EBS_RADIO_URL="rtmp://ebsandroid.ebs.co.kr/fmradiofamilypc/familypc1m"


TMP_WAVFILE="${FILENAME1}.wav"


/Applications/VLC.app/Contents/MacOS/VLC -I dummy ${EBS_RADIO_URL} vlc://quit --no-sout-video --sout-audio --no-sout-rtp-sap --no-sout-standard-sap --ttl=1 --sout-keep --sout "#transcode{acodec=s16l,channels=2}:std{access=file,mux=wav,dst=${TMP_WAVFILE}}" 2> /dev/null &


VLC_PID=$!


sleep ${DURATION}


kill -TERM ${VLC_PID}


sleep 10


/usr/bin/afconvert -f mp4f -d aac -q 127 ${TMP_WAVFILE} ${FILENAME1}


if [ "${FILENAMEROOT}" == "Chinese" -o "${FILENAMEROOT}" == "Japanese" ];

then

    mv ${FILENAME1} ${FILENAME2}

else

    mv ${FILENAME1} ${FILENAME3}

fi


rm -f ${TMP_WAVFILE}



EBS streaming rtmp address list


rtmp://ebsandroid.nefficient.com/groundwavefamilypc/familypc1m"; // 지상파HD

rtmp://ebsandroid.nefficient.com/ebsufamilypc/familypc1m"; //EBSu HD

rtmp://ebsandroid.nefficient.com/fmradiofamilypc/familypc1m"; //FM 라디오 SD

rtmp://ebsandroid.nefficient.com/plus1familypc/familypc1m"; //Plus1 SD

rtmp://ebsandroid.nefficient.com/plus2familypc/familypc1m"; //Plus2 SD

rtmp://ebsandroid.nefficient.com/plus3familypc/familypc1m"; //Plus3 SD



Trackback 0 : Comment 0

Write a comment


Stellarium

잡동사니 2014.11.26 02:46

천체도 프로그램.

플라네타리움.

http://www.stellarium.org


Trackback 0 : Comment 0

Write a comment


사파리가 종료시 열려 있던 탭을 다시 여는 것을 방지하기

Computing 2014.11.19 10:21

defaults write com.apple.Safari NSQuitAlwaysKeepsWindows -bool false

Trackback 0 : Comment 0

Write a comment

티스토리 툴바