From owner-freebsd-multimedia@FreeBSD.ORG Wed Aug 5 22:50:07 2009 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68344106568D for ; Wed, 5 Aug 2009 22:50:07 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.24]) by mx1.freebsd.org (Postfix) with ESMTP id EF9F38FC0A for ; Wed, 5 Aug 2009 22:50:06 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 9so210426eyd.7 for ; Wed, 05 Aug 2009 15:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=pNAWmBINdH67oQSA/Ot6awGwezar6gYZroSU5vBYyro=; b=nFCfmJKWRHYP3K4H8FzfQcagca4A8tVm3D6iXMZ0mcsa8x/bZraQF57Ec5rUmpYGe/ Bg4IGZoxjKHBxhm6zIgqF4zOK6A4JHWa+snLVbSd/Gf2Ie6JL12DPq+OmY8JnYoYG1tU 18yalf9Sfh0dV8w31LxHsrvP0m0GbZhnrPr7w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=J7tr+BXtbacqIrSfyqnjnIdrTqI1UEOtY+CLqFRq9JsQSQnwX91uAIWI5A2q0tCwuI Vb4E6mciNm1b3jzQbfbzEBqnRh4Ye+YBiqXuD7/e4Yjsf6xN3+RfsKIEHDIC3YKr9EoF +kIjh5foB0BVTUnHeo6+nkctcaFs84wYHqBMA= MIME-Version: 1.0 Received: by 10.216.37.6 with SMTP id x6mr1847422wea.25.1249512605779; Wed, 05 Aug 2009 15:50:05 -0700 (PDT) In-Reply-To: <20090805235234.H19821@sola.nimnet.asn.au> References: <20090805235234.H19821@sola.nimnet.asn.au> Date: Wed, 5 Aug 2009 22:50:05 +0000 Message-ID: From: "b. f." To: Ian Smith Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-multimedia@freebsd.org Subject: Re: mp3 VBR histogram? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2009 22:50:07 -0000 On 8/5/09, Ian Smith wrote: > On Wed, 5 Aug 2009, b. f. wrote: ... > > > > I've dumped frame bitrates of mp3 files before from the command-line > > using audio/mp3_check and something like: > > > > mp3_check -avv sample.mp3 | awk '/BitRate/ { print $2 }' - > > > That works well for extracting the raw frame bitrates, might try > scripting up a simple histogram from that, the next rainy day. Oh, I thought you wanted the numbers. Well, awk is still your friend. You could use something like: mp3_check -avv sample.mp3 | awk -v minbr=32 -v maxbr=448 -v maxwidth=80 -v dispchar="*" '/BitRate/ { Num=int(($2-minbr)/(maxbr-minbr)*maxwidth); bar=""; for (i=0; i < Num; i++) bar=bar dispchar; print bar } ' instead (and probably there are more elegant ways to do this if you know awk well). b.