From owner-freebsd-multimedia@FreeBSD.ORG Thu May 29 17:35:40 2008 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 735B1106566B for ; Thu, 29 May 2008 17:35:40 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id 030278FC18 for ; Thu, 29 May 2008 17:35:39 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 71800 invoked by uid 2001); 29 May 2008 17:08:58 -0000 Date: Thu, 29 May 2008 12:08:58 -0500 From: "Rick C. Petty" To: Jim Stapleton Message-ID: <20080529170858.GA70632@keira.kiwi-computer.com> References: <80f4f2b20805290402w84c3f4k3f302385396b6b1c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80f4f2b20805290402w84c3f4k3f302385396b6b1c@mail.gmail.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-multimedia@freebsd.org Subject: Re: pvrxxx recording X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: rick-freebsd@kiwi-computer.com List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2008 17:35:40 -0000 On Thu, May 29, 2008 at 07:02:48AM -0400, Jim Stapleton wrote: > OK, I got my pvrxxx problems fixed (I apparantly had my ffmpeg line wrong). > > I'm having trouble getting a decent recording though. The uncompressed > stream is too large for comfort. Uncompressed, it should be. > $ cat /dev/cxm0 | ffmpeg -i - -vcodec $v -acoded $a -f $f out.mpeg > $ ffmpeg -i /dev/cxm0 -vcodec $v -acoded $a -f $f out.mpeg So you're fine with a multi-step process? BTW, you might get better performance if your first command is: ffmpeg -i /dev/cxm0 -vcodec $v ... > Note: 'cat /dev/cxm0 > out.mpeg' works fine, and looks great - it's > just huge (3-4GB/hr). That's not that huge. > Does anyone know of a format that should work well? The computer is a > Optron 185 (dual core, 2.4Ghz), with 3GB memory, and a 7200RPM hard > drive. Your computer is too slow to do a live decode/encode of an MPEG2 stream. Since you don't mind a multi-step process, why don't you record at the standard bitrate and do a post-process step? That's what I do. I actually have my own cxm_record program which calls the setchannel command and then performs a cat(1) equivalent. After the recording is finished, I use multimedia/avidemux to select cut/edit points and a custom script to convert the avidemux project to a multimedia/dvbcut project. I've found dvbcut does a better job of cutting the MPEG2 streams and does a minimum recoding process (only at the edit points). From there I run a custom script to furthur compress the MPEG2 stream and turn it into a DVD VOB. This script may be of interest to you and your issue, so I'll describe it here. I demultiplex the audio & video streams separately using multimedxa/mpgtx: mpgdemux -b $TMP_PREFIX $OUTPUT_FROM_DVBCUT Then, in parallel, I convert & compress the audio and video streams. For the audio, I make a named pipe and decode using audio/lame: mkfifo $TMP_PREFIX.wav lame --decode $TMP_PREFIX.mp2 $TMP_PREFIX.wav then encode into AC3 using multimedia/ffmpeg: ffmpeg -i $TMP_PREFIX.wav -y -vn -ab 192000 -acodec ac3 -ar 48000 -ac 2 \ $TMP_PREFIX.ac3 For the video, I requantize the video by a factor of 3:2 using multimedia/transcode: tcrequant -f 1.5 < $TMP_PREFIX-0.m2v > $TMP_PREFIX-1.m2v After both are finished, I multiplex the streams together into a dvdauthor-ready VOB using multimedia/mjpegtools: mplex -v 0 -V -M -f 8 -o $OUTPUT.vob $TMP_PREFIX.ac3 $TMP_PREFIX-1.m2v The end result is a file that's just over half the size of the original without appreciable loss of quality. -- Rick C. Petty