Skip to content

Instantly share code, notes, and snippets.

@Sg4Dylan Sg4Dylan/bbc_broadcast.sh
Last active Dec 4, 2017

Embed
What would you like to do?
树莓派 FM 转播 BBC / Broadcast BBC radio via RaspberryPi / 树莓派转播网络直播音频(以 Bilibili 直播为例)
#!/bin/bash
# Raspberry broadcast fm shell
# - A believing heart is your magic -
# Dependency:
# FFmpeg: pacman -S ffmpeg
# PiFmRds: https://github.com/ChristopheJacquet/PiFmRds
# BBC Radio
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1xtra_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5live_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p"
# livelink="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_asianet_mf_p"
livelink="http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-einws"
# broadcast frequency
broadcast_freq="77.0"
# PiFMrds
pfr_pi='66CC'
prf_ps='BBC Radio'
ffmpeg -i ${livelink} -vn -acodec pcm_s16le -ar 44100 -ac 2 -f wav pipe:1 | pi_fm_rds -freq ${broadcast_freq} -pi ${pfr_pi} -ps ${prf_ps} -rt 'broadcast BBC world service' -audio -
#!/bin/bash
# Raspberry broadcast fm shell
# - A believing heart is your magic -
# Dependency:
# streamlink: pip install streamlink
# FFmpeg: pacman -S ffmpeg
# PiFmRds: https://github.com/ChristopheJacquet/PiFmRds
# live url (in streamlink format)
livelink="live.bilibili.com/3"
# broadcast frequency
broadcast_freq="77.0"
# PiFMrds
pfr_pi='66CC'
prf_ps='BilibiliLive'
# command
streamlink -O ${livelink} best | ffmpeg -i pipe:0 -vn -acodec pcm_s16le -ar 44100 -ac 2 -f wav pipe:1 | pi_fm_rds -freq ${broadcast_freq} -pi ${pfr_pi} -ps ${prf_ps} -rt 'broadcast bilibili live room #3' -audio -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.