On Mon, 2007-06-11 at 12:08 -0400, Cyrus A wrote: [...] > > Ok, here it is. It has took a bit longer than expected due to > > ever-standing real life work issues and due to needed refactoring that > > this task has pulled in. Anyway. > > filter_astat in CVS HEAD (should) can now detect if an audio track is > > silence only. > > Just use > > transcode -i file -a X -J astat > > > > Euhrystic implemented is a bit harsh, maybe it still needs some > > extensions/tuning. Can't do it now, but It's planned before 1.1.0 > > released. Feedback very-welcome. > > > > filter_detectsilence can do a stuff like that as well, but is > > trickier. In practice, filter_detectsilence really detects the silence > > *intervals* between audio chunks (useful to separate songs or track > > parts, for example). Of course, if a silence interval is very long, > > one can assume that the whole audio track is silence only, but isn't > > so straightforward. > > > I tried 'transcode -i soundtest2.mp3 -a X -J astat' on one of my files > and got an error: > > [EMAIL PROTECTED] transcode]# transcode -i soundtest2.mp3 -a X -J astat > transcode v1.0.2 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg > [transcode] critical: invalid parameter for option -a
There is a couple of errors in there. First, transcode 1.0.x (including 1.0.2, 1.0.3 and any future release) just doesn't have the feature we're talking about: you need a snapshot of future 1.1.0. Second, there is an error in -a option usage. -a expects as argument the index of the audio track to be processed, starting the count from 0 (zero). So, -a 0 (or no -a at all since 0 is the default index) should work on your case. PS: don't use transcode as root :) > Again, I'm a total stranger to transcode. Can you tell me what configure > options I should be using (if any) to make this work? Except for using a 1.1.0 snapshot (just remember to fetch sources from HEAD branch, NOT from 1.0.x branch), you don't need anything special. > Also, in a later post, you mentioned using filter_detectsilence instead > of astat. Which should I use? If detectsilence, then how? Both astat and detectsilence filters scan the whole (given) audio track, but they do in a fairly different way. filter_astat: astat filter finds some basic audio statistics: minimum and maximum sample value. The purpose of doing this is to find the appropriate values to properly rescale the audio (so user no longer need to fire up the speakers at maximum power to actually hear something). We have a nice side effect: if minimum AND maximum sample values are between a given range, we can assume that the whole audio track contain only (roughly) silence. In current version of the filter, this treshold is hardcoded and set to 0 (zero). That is pretty strict and can be relexed in future release. So, quick summary: astat filter can tell the user about the minimum and maximum audio values in a track. It can detect (with some tuning) if THE WHOLE track is silence or not. filter_detectsilence: detectsilence scan the audio track for silence intervals, if any. The eurhystic adopted to find silence is like (but not identical) the one used in astat filter above, so it is possible that the two filters emit different results on same audio source. However, it's matter of tuning. What silence interval detection is good for? To give an example, is useful to find some cut points for split an audio track: splitting the audio when there is silence is of course better then split in the middle of a song. filter_detectsilence can just output the silence intervals (except for bugs of course :P) ot it can be emit a commandline to be used with tcmp3cut. Side effect of all this above: if we have a silence interval long enough (i.e.: 75% of the track, or even larger) we can deduce that the whole track is silence only. But that's a deduction that uses a side effect of this filter, so it can be (blatantly :) ) wrong. So, quick summary: detectsilence can tell the user about silence intervals in a track, if there is any of them. Detecting if the whole track is silence or not is NOT the job of this filter, even if it can accomplish something fairly similar. I hope that's a bit clearer now (it not, don't hesitate to ask more). If your (IIRC) task is to just detect if an audio track is ENTERELY made by silence or not, astat is better suited. I'll download your sample that you have linked in another mail and I'll do some further tuning in astat filter. Unfortunately, I'm still bretty busy those days (hey, I need some holydays!), so this can take some days. Bests, -- Francesco Romani (Ikitt)