Last active
July 7, 2016 10:56
-
-
Save karronoli/ab8aaafed151be368ca47de0c62c1311 to your computer and use it in GitHub Desktop.
rtmpdump + mpv on MSYS2
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
# Play streaming by named pipe instead of pipe that can't be used. | |
_live_nhk () { | |
cd | |
if [ ! -p test.live ]; then rm -f test.live && mkfifo test.live; fi | |
/mingw64/bin/rtmpdump \ | |
--rtmp "$1" \ | |
--playpath "$2" \ | |
--swfVfy http://www3.nhk.or.jp/netradio/files/swf/rtmpe.swf \ | |
--app "live" \ | |
--live -o test.live& | |
if [ -n "$(jobs -p)" ]; then | |
# wait buffering | |
sleep 10 | |
while [ 1 ]; do | |
PLAY_START=`date +%s` | |
/mingw64/bin/mpv test.live | |
PLAY_END=`date +%s` | |
test $(($PLAY_END - $PLAY_START)) -lt 3 && break | |
echo Hit 'q' within 3 seconds to exit. | |
done | |
kill $(jobs -p %+) | |
fi | |
rm test.live | |
} | |
alias live-nhk1='_live_nhk rtmpe://netradio-r1-flash.nhk.jp NetRadio_R1_flash@63346' | |
alias live-nhk2='_live_nhk rtmpe://netradio-r2-flash.nhk.jp NetRadio_R2_flash@63342' | |
alias live-nhkfm='_live_nhk rtmpe://netradio-fm-flash.nhk.jp NetRadio_FM_flash@63343' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment