Created
April 1, 2012 08:27
-
-
Save rhiguchi/2273395 to your computer and use it in GitHub Desktop.
NHKネットラジオをVLCで録音するスクリプト ref: http://qiita.com/items/549b42c8b361807d96a2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
recording.sh 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 6 * * 1-5 /Users/flo_jack/NHK_Radio/recording.sh 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
DEST_FILE_NAME_BASE=`date +%Y%m%d-%H%M` | |
## 録音時間 | |
if [ $# = 0 ] | |
then | |
RECORDING_MINUTES=15 | |
else | |
RECORDING_MINUTES=$1 | |
fi | |
DEST_DIR="/Users/flo_jack/NHK_Radio" | |
DEST_FILE="$DEST_DIR/$DEST_FILE_NAME_BASE.mp3" | |
# ストリームには10〜20秒のタイムラグがあるため、30秒余分に保存 | |
RECORDING_TIME=$(($RECORDING_MINUTES * 60 + 30)) | |
# らじる★らじるのラジオ第2放送ストリーム | |
STREAM_SOURCE="mms://a57.l12993246056.c129932.g.lm.akamaistream.net/D/57/129932/v0001/reflector:46056" | |
# ラジオ第1ストリーム | |
#STREAM_SOURCE="mms://a33.l12993146032.c129931.g.lm.akamaistream.net/D/33/129931/v0001/reflector:46032" | |
# NHK-FMストリーム | |
#STREAM_SOURCE="mms://a52.l12993346051.c129933.g.lm.akamaistream.net/D/52/129933/v0001/reflector:46051" | |
if [ ! -e "$DEST_DIR" ] | |
then | |
mkdir "$DEST_DIR" | |
fi | |
/usr/local/bin/vlc -I rc $STREAM_SOURCE :sout="#transcode{acodec=mp3}:std{access=file,mux=raw,dst=$DEST_FILE}" --run-time $RECORDING_TIME vlc://quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment