Skip to content

Instantly share code, notes, and snippets.

@karronoli
Last active July 7, 2016 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karronoli/ab8aaafed151be368ca47de0c62c1311 to your computer and use it in GitHub Desktop.
Save karronoli/ab8aaafed151be368ca47de0c62c1311 to your computer and use it in GitHub Desktop.
rtmpdump + mpv on MSYS2
# 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