David Liontooth wrote:
On Thu, 31 May 2007, Francesco Romani wrote:

On Wed, 2007-05-30 at 21:10 -0700, David Liontooth wrote:
Hi Cyrus and Francesco,

I've solved the same problem by using tcextract and cutmp3; I'd be happy to send the scripts.
And I'll happy to see them :)

It would be great if transcode could handle it!
This shouldn't be too much work, it's matter to refactor/empower a bit
filter_astat and/or filter_detectsilence.
The real problem is that... real life work chases me restlessly :\

Hey, run for your life :)
The following is very home-made stuff, but it works reliably (needs the
latest cutmp3 -- check it out if you need ideas for how to detect
silence):

 http://owens.cogweb.net/soundmerge.sh

As a rough measure, but fast, I also extract the mp3 file and compress it to ogg using sox (pre 13.0), and then compare the sizes -- might be of interest to Cyrus:

# Check for flags and assign variables

if [ -e "$1/$2.avi" ] && [[ "$3" = [12345] ]]
  then DIR="$1" ; FIL="$2" ; DEV="$3"
  else echo -e "\nSee /usr/local/bin/audio-check-file for syntax.\n"
fi

# Define the audio working directory
AUDIR="/tvspare/tmp" ; if [ ! -d $AUDIR ] ; then mkdir -p -m 775 $AUDIR ; fi

# Extract the audio portion of the captured file and convert it to ogg
if [ ! -s "$AUDIR/$FIL.mp3" ] ; then tcextract -i $DIR/$FIL.avi -x mp3 -a 3 > $AUDIR/$FIL.mp3 ; fi if [ ! -s "$AUDIR/$FIL.ogg" ] ; then sox $AUDIR/$FIL.mp3 -r 500 -p -c 1 $AUDIR/$FIL.ogg ; fi

# Generate a ratio
MP3SIZE=$(ls -l $AUDIR/$FIL.mp3 | cut -d' ' -f5)
OGGSIZE=$(ls -l $AUDIR/$FIL.ogg | cut -d' ' -f5)

SCORE=$(( $MP3SIZE/$OGGSIZE ))

# Check the ratio for dropped audio (smaller files get higher scores)
if [ $SCORE -gt 53 -a $MP3SIZE -gt 45000000 -o $SCORE -gt 54 ]
then DROPPED="$(( ($MP3SIZE/958406)-($OGGSIZE/18550) ))" ; PERCENT="$(( ($DROPPED*100)/($MP3SIZE/958406) ))" echo -e "\nDROPPED SOUND FOR $DROPPED MINUTES ($PERCENT%, RAW SCORE $SCORE) in $FIL.avi\n"
 else echo -e "\nSound checks out fine ($SCORE) in $FIL.avi\n"
fi





Thanks, I'll take a look at it this weekend and test 'er out. I'll report back soon.

Cyrus

Reply via email to