User Tools

Site Tools


clients:cvlc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
clients:cvlc [2018/05/28 18:16] – [Service] Sean Rhoneclients:cvlc [2022/05/19 21:25] (current) Sean Rhone
Line 1: Line 1:
 +====== Information ======
  
 +  * Headless VLC setup using cvlc
 +  * Plays internet radio
 +  * [[#remote_actions|Remote Actions]] shortcut
 +
 +====== Prerequisites ======
 +
 +  * [[Distros:Raspbian]]
 +
 +====== Dependencies ======
 +
 +****
 +
 +  sudo apt install 'vlc-nox'
 +
 +====== Volume ======
 +
 +****
 +
 +  alsamixer
 +
 +====== Service ======
 +
 +  * If [[servers:pi-hole|Pi-hole]] is not being ran on the same Pi, remove ''pihole-FTL.service'' from ''After'' ((this is done to make sure cvlc starts after the DNS is up))
 +  * See [[information:internet_radio|Internet Radio Stations]] for more stations
 +
 +  sudo -e '/etc/systemd/system/vlc-dedi.service' && sudo systemctl daemon-reload && sudo systemctl enable 'vlc-dedi' && sudo systemctl start 'vlc-dedi' && sudo systemctl status 'vlc-dedi' -l
 +
 +<code>
 +[Unit]
 +Description=VLC Headless Internet Radio Player
 +After=network-online.target pihole-FTL.service
 +Wants=network-online.target
 +
 +[Service]
 +Type=simple
 +User=pi
 +Group=pi
 +Restart=always
 +RestartSec=5
 +
 +#~~~~~~~~~~
 +# Big B Radio #KPOP
 +#ExecStart=/usr/bin/cvlc 'http://64.71.79.181:8042'
 +#~~~~~~~~~~
 +# Blue Heron Radio
 +#ExecStart=/usr/bin/cvlc 'http://sc6.shoutcaststreaming.us:8016'
 +#~~~~~~~~~~
 +# Gensokyo Radio
 +#ExecStart=/usr/bin/cvlc 'http://stream.gensokyoradio.net:8000/stream'
 +#~~~~~~~~~~
 +# TRAP.FM
 +ExecStart=/usr/bin/cvlc 'http://stream.trap.fm:6002'
 +#~~~~~~~~~~
 +# Dubbase.FM
 +#ExecStart=/usr/bin/cvlc 'http://stream.dubbase.fm:7002'
 +#~~~~~~~~~~
 +# DrumandBass.FM
 +#ExecStart=/usr/bin/cvlc 'http://stream.drumandbass.fm:9002'
 +#~~~~~~~~~~  
 +
 +ProtectSystem=true
 +PrivateTmp=true
 +ProtectKernelTunables=true
 +ProtectKernelModules=true
 +ProtectControlGroups=true
 +RestrictNamespaces=true
 +MemoryDenyWriteExecute=true
 +RestrictRealtime=true
 +NoNewPrivileges=true
 +PrivateUsers=true
 +LockPersonality=true
 +
 +[Install]
 +WantedBy=multi-user.target</code>
 +
 +====== Remote Actions ======
 +
 +===== Station Change =====
 +
 +****
 +
 +  ssh 'pi'@'192.168.1.158' -t "sudo -e '/etc/systemd/system/vlc-dedi.service' && sudo systemctl daemon-reload && sudo systemctl restart 'vlc-dedi'"
 +
 +===== Stop =====
 +
 +****
 +
 +  ssh 'pi'@'192.168.1.158' -t "sudo systemctl disable 'vlc-dedi' --now"
 +
 +===== Start =====
 +
 +****
 +
 +  ssh 'pi'@'192.168.1.158' -t "sudo systemctl enable 'vlc-dedi' --now"
 +
 +====== Chromecast Notes ======
 +
 +  * :!: Both Windows Firewall and firewalld from openSUSE TW actively block this; TODO: Figure out firewall rules
 +  * Create speaker Group (not pair) and add all speakers to it
 +  * Install PyChromecast
 +  * Use it to scan for the speaker group URL and port
 +  * https://forum.videolan.org/viewtopic.php?t=143114#p497156
 +
 +  pip3 install PyChromecast
 +
 +  python
 +
 +  import pychromecast
 +
 +  chromecasts = pychromecast.get_chromecasts()
 +
 +  chromecasts
 +
 +  vlc.exe "http://198.50.158.92:10212/stream"  --sout "#chromecast" --sout-chromecast-ip=192.168.1.231 --demux-filter=demux_chromecast --sout-chromecast-port=32077