Talk:DVB search

From MythTV Official Wiki
Jump to: navigation, search

Since I could not get mplayer to respond to using mplayer -vo jpeg:quality=95 -frames 2 -nosund dvb://[channel name]

I figured I'd provide you an alternate using azap as the actual tuner, and mplayer capturing a jpeg. hope this help somone. Also made it use your .new output file.

#!/bin/sh
for ch in `cat channels.conf.new |awk -F ":" {'print $1'}`
do
  DATE=`date`
  NEWFILE="$ch.jpg"
  echo "$DATE | $ch start scan.." >> scan.log
  echo "Selecting channel $ch"
azap -a 0 -f 0 -d 0 -c channels.conf.new $ch -r &
echo "wait to stabalize"
for y in 1 2 3 4 5
do
 sleep 1
 echo "Stabalizing $y"
done
mplayer -vo jpeg:quality=95 -frames 2 -ao nosound /dev/dvb/adapter0/dvr0 &
for y in 1 2 3 4 5
do
 sleep 1
 echo "Stabalizing $y"
done
RETURN=`ps aux |grep mplayer |grep -v grep |awk {'print $2'}|wc -l`
  if [[ $RETURN -eq "1" ]]
  then
    kill `ps aux |grep mplayer |grep -v grep |awk {'print $2'}`
  echo "Killed mplayer"
  fi
sleep 2
RETURN=`ps aux |grep azap |grep -v grep |awk {'print $2'}|wc -l`
 while [[ $RETURN -eq "1" ]]
  do
  echo "Azap still alive"
  kill `ps aux |grep azap |grep -v grep |awk {'print $2'}`
  sleep 3
  RETURN=`ps aux |grep azap |grep -v grep |awk {'print $2'}|wc -l`
 done
   DATE=`date`
  echo "$DATE | $ch end scan.."
  if [ -r 00000001.jpg  ]
  then
    echo "$DATE Found channel $ch"
    echo "$DATE |Found channel $ch" >> scan.log
    mv 00000001.jpg "found/$NEWFILE"
  else
    echo "$DATE |Nothing on    $ch" >> scan.log
  fi
 echo "Stabalizing for 5"
sleep 5
 echo "ready to start a new channel"
done

When working with azap repeatedly, I ran into problems with vmalloc (that I still dont understand completely), did you see similar issues? --Ll 16:23, 4 April 2006 (UTC)

fixnames script

Rather than the fixnames script, the same can be done in one line from the shell.

cat -n ~/dvbscanout | sed "s/^\s*//;s/\s.*]//"

replace ~/dvbscanout with wherever you put the output of dvbscan. cat -n will number the lines, sed cleans up the extra whitespace and the old number.