Advertisement
Guest User

Untitled

a guest
Apr 9th, 2015
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.51 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. exit_handler() {
  4.         rm /tmp/rtl_fm
  5.         pkill -KILL -P $$
  6. }
  7.  
  8. trap "exit_handler" SIGINT SIGTERM SIGKILL
  9.  
  10. RTL_FM=/opt/rtl-sdr/bin/rtl_fm
  11. FFMPEG=/opt/ffmpeg/bin/ffmpeg
  12.  
  13. $RTL_FM -X -f $1M > /tmp/rtl_fm &
  14.  
  15. while [ ! `stat -c %s /tmp/rtl_fm` -ge 64 ]
  16. do
  17.         sleep 0.1
  18. done
  19.  
  20. $FFMPEG -re -f s16le -ac 2 -ar 48000 -i pipe:0 \
  21. -vcodec none -acodec ac3 -ac 2 -ab 224k -ar 48000 \
  22. -metadata service_name="$2" -mpegts_service_type digital_radio \
  23. -f mpegts pipe:1 < /tmp/rtl_fm &
  24.  
  25. wait
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement