Skip to content

Instantly share code, notes, and snippets.

View trungpv1601's full-sized avatar
🤖
Diversifying; Practical; more code than talk.

trungpv trungpv1601

🤖
Diversifying; Practical; more code than talk.
View GitHub Profile
@makoto1984
makoto1984 / live-meta.sh
Last active January 15, 2021 15:57
streaming music with generated video to youtube via ffmpeg
#!/bin/sh
# This script is a companion of the script youtube-music-live.sh. Assuming the MUSIC_PATH is an icecast2 stream, The script will fetch the metadata tag StreamTitle every 5 seconds and update the file /tmp/artist, /tmp/title. Generally, the StreamTitle should be like "artist - title", though sometimes there is only title. You may also update the files manually and ignore this script. Be sure to run this script after youtube-music-live.sh.
# You have to define music url.
MUSIC_PATH=
while [ `pgrep -x ffmpeg` ]
do
meta=`ffprobe -v error -show_format "$MUSIC_PATH" | grep StreamTitle | cut -d= -f2`
case "$meta" in