From owner-freebsd-questions@FreeBSD.ORG Mon Aug 28 12:57:31 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 2CB9316A4DF for ; Mon, 28 Aug 2006 12:57:31 +0000 (UTC) (envelope-from howie@thingy.com) Received: from post1.network-i.net (antigua.network-i.net [212.21.121.181]) by mx1.FreeBSD.org (Postfix) with SMTP id B6FFA43D69 for ; Mon, 28 Aug 2006 12:57:15 +0000 (GMT) (envelope-from howie@thingy.com) Received: (qmail 87155 invoked from network); 28 Aug 2006 12:57:14 -0000 Received: from unknown (HELO ?10.1.1.134?) (212.21.99.52) by post1.network-i.net with SMTP; 28 Aug 2006 12:57:14 -0000 Message-ID: <44F2E7FF.6030402@thingy.com> Date: Mon, 28 Aug 2006 13:56:31 +0100 From: Howard Jones User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: Gary Kline 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> In-Reply-To: <20060828015621.GA79317@thought.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: 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 12:57:31 -0000 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. 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. 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! 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)