From owner-freebsd-questions@FreeBSD.ORG Mon Aug 28 19:08:04 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FAFD16A4DF for ; Mon, 28 Aug 2006 19:08:04 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3D1AB43D62 for ; Mon, 28 Aug 2006 19:07:54 +0000 (GMT) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.4/8.13.1) with ESMTP id k7SJ7qEl098021; Mon, 28 Aug 2006 12:07:53 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.4/8.13.1/Submit) id k7SJ7dfG098012; Mon, 28 Aug 2006 12:07:39 -0700 (PDT) (envelope-from kline) Date: Mon, 28 Aug 2006 12:07:38 -0700 From: Gary Kline To: Howard Jones Message-ID: <20060828190738.GA97262@thought.org> References: <20060827053654.GA60292@thought.org> <20060827060122.GA63679@ozzmosis.com> <20060827074946.GA60715@thought.org> <241DF2D9-F281-4AD5-90CE-BC23850360F2@hackmiester.com> <44F210BD.6040908@thingy.com> <20060828015621.GA79317@thought.org> <44F2E7FF.6030402@thingy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44F2E7FF.6030402@thingy.com> User-Agent: Mutt/1.4.2.2i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: Observing twenty years of service to the Unix community Cc: Gary Kline , andrew clarke , "hackmiester \(Hunter Fuller\)" , freebsd-questions@freebsd.org Subject: Re: taking many 198k mp3 files and converting them to 16k mp3 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 19:08:04 -0000 On Mon, Aug 28, 2006 at 01:56:31PM +0100, Howard Jones wrote: > Gary Kline wrote: > > Well, if/when you *do* try, please clue me in. --I'm too new to > > DVD's and tooo che--er, thrifty to buy a ten pack of blanks. I'm > > not sure that I have three hours of "favorites"; probably, but no > > more. Most of my favorite tunes are on tape--pre-recorded and > > hi-fidelity, but the problem is turnning analogue to digital. > > Thrift isn't really an issue nowadays - you can get 50 DVD-Rs for about > $10-15 online. Cheap enough to use a few to experiement, in my opinion. Wow! that really *is* a deal. About where the floppies were years back. I was guessing $2.50+ per blank. > > I did some experimenting last night, and got what seems to be a working > solution. I don't have a DVD burner where I am, so I haven't *actually* > burned one, but 2 software players (Apple's and Media Player Classic) > are both happy with the VIDEO_TS files. From my brief research, the > minimum bitrate for DVD audio is 32Khz, and there isn't a minimum for > the video, only a maximum. There is also a video-CD-like frame size of > 352x480 for NTSC so you can reduced the video size further. > > For my test audio file (2:12 song), I got: > 2.2MB Original MP3 file - 192Kbit/sec 44.1Khz sample-rate joint stereo > 3.3MB MP2 file - no changes apart from 44.1->48 resampling > 0.5MB MP2 file - resampled to 48Khz, forced to mono and 32Kbit/sec > output stream > > the 0.5MB file doesn't actually sound *that* bad for music - it's AM > radio quality. It would be fine for speech. > > A 64Kbps video file to go with it is about 2.6MB, so the final 'DVD > file' is either 6.7M ('music' quality) or 4M ('voice' quality). DVD > authoring adds around 800K, but I don't believe this is per-chapter. > > Assuming that it isn't, that's around 2400 minutes on a DVD-R (voice) or > 1500 minutes (music), and it should be playable on any DVD player, since > it should be a full-spec DVD still. Video is a just-say-no in my case; I've got around 26 hours of very high quality (192K) mp3 files (voice) that ought to be just fine at 32K/48KHz monaural. This for the stuff that's taking up hundreds of megs on-disk. As for collecting my favorite, I don't have anywhere near 25 hours (1500 minutes) of them, so maybe I'll wait until "mp4" or "AACplus" [[[ these are the same, right? ]]] is more widely available, then stuff my few hours onto a regular CD-R. > > Here's my notes on producing a disc. This is for an NTSC disc. For PAL, > you need to change 480 to 576 wherever it appears, add 'pal' instead of > 'ntsc' to the dvdauthor line, and "-f 25" instead of "-f 30" in the > transcode line. > > I'm no video expert, so I'm sure there are better ways to do this, but > this one worked for me! Well sir, you are lightyears beyond me!! During my hackery years I worked mostly in the supercomputer realm. Sound? video? on a *computer*??? Faugh! I'm finally learning what I was missing :-) thanks much for your help. same for everybody else who offered help, clues, and code! gary > > Howie > > ###################################################################################### > # Take the MP3 file, play it into toolame as 48Khz PCM data > # toolame reencodes as MP2 (for DVD) at 32khz (the minimum?) in mono > madplay -R48000 -b16 -o wave:- mytestfile.mp3 | toolame -s 48 -b 32 -a > -m m - mytestfile.mp2 > # (take out the -b 32 and -a -m m if you want music quality) > > # next, we'll produce a VERY low bitrate MPEG2 movie of the same length as > # the audio since we have to do *some* encoding here, we might as well make > # the static image be the title of the audio track. > > # this is ALL ONE pipeline > ppmmake blue 352 480 | \ > ppmlabel -x 50 -y 100 -text "This is the track name" | \ > ppmtoy4m -S 420mpeg2 -r -v2 | \ > transcode -x yuv4mpeg,mp3 -y mpeg2enc,null -o mytestfile -p > "mytestfile.mp3" \ > -Z 352x480 -F "8,-b 64" -i /dev/stdin -g 352x480 --import_asr 2 -f > 30 -m /dev/null > > # So that's: make a blank blue image of the correct size for NTSC video > at the smallest size > # add a caption over it > # take that PPM file use it to stream frames into the video transcoder. > # (We only have one frame, so just repeat it) > # transcode takes that frame and encodes it as DVD-compatible 64kbps MPEG-2 > # (normally for a DVD movie it would be more like 5000kpbs) > # we import an audio stream even though we aren't using it, so as to get > the > # right length. Otherwise we get a never-ending video stream :-) > > # So now, there's a .m2v video stream, and a .mp2 audio stream, and we > need to > # multiplex them. > mplex -f 8 -o mytestfile.mpg mytestfile.m2v mytestfile.mp2 > > # *** repeat the above for each of your audio files. *** > > # finally, we can make a simple DVD > dvdauthor -v ntsc+4:3+352x480 -a mp2+en+1ch+16bps -t -o testdvd > mytestfile.mpg > dvdauthor -T -o testdvd > > # if you used 'music' quality encoding in toolame, then use 2ch instead > of 1ch here > > # You should find a DVD structure (VIDEO_TS, AUDIO_TS) waiting in the > 'testdvd' directory. > # you can specify multiple .mpg files on the command line, and each one > will > # become a chapter on the DVD > > # FINALLY, to get a burnable ISO image: > mkisofs -dvd-video -o testdvd.iso testdvd > # and burn it to /dev/acd0: > growisofs -dvd-compat -Z /dev/acd0=testdvd.iso > > # Ports used: > # sysutils/dvd+rw-tools (growisofs) > # sysutils/cdrtools (mkisofs - installed as a dependency of dvd+rw-tools) > # mjpegtools (mplex, y4m stuff) > # netpbm (ppmfile, ppmlabel) > # toolame (MPEG Layer II encoding) > # madplay (MP3 decoding) > # dvdauthor (final authoring) > # transcode (install this last, so it gets the mpeg2encode from mjpegtools) -- Gary Kline kline@thought.org www.thought.org Public service Unix