Saturday, June 19, 2021

Squeezelite with docker

Besides those dedicated Raspberry Pis running piCorePlayer, sometimes I wanted to simulate a Squeezebox device on my work PC to play music. The easiest way is to run Squeezelite with docker.

A minor patch to the docker run script so that I can pass in upsampling parameters to it as my USB DAC can handle up to 768kHz.

Then just start the container with something like this, where D50s is my DAC:

docker run --rm --env SQUEEZELITE_AUDIO_DEVICE=hw:CARD=D50s --env SQUEEZELITE_SPECIFY_SERVER=yes --env SQUEEZELITE_SERVER_PORT=192.168.100.6:3483 --env SQUEEZELITE_NAME=openSUSE_PC --env SQUEEZELITE_OPTS='-r 705600,768000 -R vE::4:28:99:100:50' --device /dev/snd --name squeezelite --net host -d giof71/squeezelite

Monday, June 7, 2021

Ripping audio tracks from a DVD

Quick notes on ripping audio tracks from a DVD (Unplugged by The Corrs) using command line:


# rip dvd by track (total 17)
for i in {1..17}; do
  mplayer dvd:// -chapter $i-$i -dumpstream -dumpfile $i.vob;
done

# find out which audio stream has the 2-channel pcm and copy it into a flac file
for i in {1..17}; do
  tmp=`ffprobe -v error -show_format -show_streams $i.vob | grep -B 1 pcm_dvd | head -n 1 | cut -d '=' -f 2-`
  ai="$(($tmp-1))"
  ffmpeg -i $i.vob -map 0:a:$ai -vn -f flac $i.flac;
done

# rename flac files by track... TBD


# set metadata
for i in *.flac; do
  ALBUM='Unplugged'
  ARTIST='The Corrs'
  tracknumber=`echo $i | cut -d ' ' -f 1 | sed 's/^0*//'`
  title=`echo $i | cut -d ' ' -f 2- | cut -f 1 -d '.'`
  metaflac --set-tag="ALBUM=$ALBUM" --set-tag="ARTIST=$ARTIST" --set-tag="tracknumber=$tracknumber" --set-tag="title=$title" --remove-tag=encoder "$i"
done