Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- exit_handler() {
- rm /tmp/rtl_fm
- pkill -KILL -P $$
- }
- trap "exit_handler" SIGINT SIGTERM SIGKILL
- RTL_FM=/opt/rtl-sdr/bin/rtl_fm
- FFMPEG=/opt/ffmpeg/bin/ffmpeg
- $RTL_FM -X -f $1M > /tmp/rtl_fm &
- while [ ! `stat -c %s /tmp/rtl_fm` -ge 64 ]
- do
- sleep 0.1
- done
- $FFMPEG -re -f s16le -ac 2 -ar 48000 -i pipe:0 \
- -vcodec none -acodec ac3 -ac 2 -ab 224k -ar 48000 \
- -metadata service_name="$2" -mpegts_service_type digital_radio \
- -f mpegts pipe:1 < /tmp/rtl_fm &
- wait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement