Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2008 12:08:58 -0500
From:      "Rick C. Petty" <rick-freebsd@kiwi-computer.com>
To:        Jim Stapleton <stapleton.41@gmail.com>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: pvrxxx recording
Message-ID:  <20080529170858.GA70632@keira.kiwi-computer.com>
In-Reply-To: <80f4f2b20805290402w84c3f4k3f302385396b6b1c@mail.gmail.com>
References:  <80f4f2b20805290402w84c3f4k3f302385396b6b1c@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080529170858.GA70632>