Skip to content

Instantly share code, notes, and snippets.

@yoonbae81
Created December 26, 2018 03:21
Show Gist options
  • Save yoonbae81/48b3e5451701e43b8d9f657d8778f7be to your computer and use it in GitHub Desktop.
Save yoonbae81/48b3e5451701e43b8d9f657d8778f7be to your computer and use it in GitHub Desktop.
EBS 녹음
#!/bin/bash
URL="rtmp://ebsandroid.ebs.co.kr:1935/fmradiofamilypc/familypc1m"
PROGRAM=$1
RECORD_MINS=$(($2 * 60))
DATE=`date +%Y%m%d`
FLV_FILE=`mktemp -u`
M4A_FILE=$DATE"_"$PROGRAM.m4a
rtmpdump -r $URL -B $RECORD_MINS -o $FLV_FILE
ffmpeg -i $FLV_FILE -vn -acodec copy $M4A_FILE
rm $FLV_FILE
mkdir -p /var/www/html/ebs/$PROGRAM
mv $M4A_FILE /var/www/html/ebs/$PROGRAM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment