pvrxxx recording

usleepless at gmail.com usleepless at gmail.com
Thu May 29 20:07:01 UTC 2008


Rick, Jim, List,

On Thu, May 29, 2008 at 7:08 PM, Rick C. Petty
<rick-freebsd at kiwi-computer.com> wrote:
> 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, thanks for outlining your procedure. I had no idea that people
were postprocessing their recordings.

I recently adjusted the bitrate for my profile from ~10Mbit to ~5MBit.
I hardly notice a difference except for fast moving sports such as
tennis and motorsports.

Unfortunatly you need to edit the source of the driver and rebuild it.
The relevant parameters are at the top of cxm.c. You need to edit the
"dvd_full_d1_(pal|ntsc)_profile":

/* 9.52 Mb/s peak limit to keep bbdmux followed by mplex -f 8 happy */
#ifdef _original_
        { 0, 9000000, 9520000 }, /* 1 hour on 4.7 GB media */
#else
    { 0, 4000000, 4520000 }, /* 4 hours on 8.54 GB media */
#endif

regards,

usleep


More information about the freebsd-multimedia mailing list