On Tue, 2009-12-01 at 12:17 -0800, Tony Ross wrote:
> >> What might be causing these features? Have I got a bad card?
> >
> > Not likely.
> >
> > Most likely your VCR is putting out crappy horizontal sync and/or
> > vertical sync.  Tweaking various registers in the CX2584x chip may have
> > positive results for you- but it's not easy for the general user.
> 
> Is there any documentation about the various CX2584x registers and the
> effect that changing their values might accomplish? Although I'm new to ivtv
> and video manipulations in general, I'm willing to try.

The CX25840/1/2/3 data sheet is on

        http://dl.ivtvdriver.org

somewhere.  It's not hard to find.  If you find a copy of the old
Rockwell-Collins BT878 or BT879 datasheet on the 'Net, it also gives
more insight into how *portions* of the CX2584x chips work.  (It's easy
to tell parts of the documentation were copied, and the BT878 sheet was
more instructive on some concepts.)

You'll want to build the latest v4l-dvb drivers:

        http://linuxtv.org/hg/v4l-dvb

Grab the tar archive and:

$ tar -xvzf tip.tar.gz
$ cd v4l-dvb-blahblahblah
$ make
$ make apps (it'll bomb; don't worry v4l2-dbg gets made)
$ su root
# (back up /lib/modules/`uname -r` now if you care about them)
# make install
# make unload
# make unload
# modprobe ivtv

That builds the ivtv and cx25840 drivers with advanced debugging turned
on and installs the modules.  That allows root to use v4l-dbg to
manipulate registers:

# v4l2-apps/util/v4l2-dbg --help

# v4l2-apps/util/v4l2-dbg -d /dev/video0 -S
host0: cx23416    revision 0x00000000
i2c 0x1b: wm8775     revision 0x00000000
i2c 0x44: cx25843    revision 0x00008433

# v4l2-apps/util/v4l2-dbg -d /dev/video0 -c 0x44 
--list-registers=min=0x100,max=0x1ff
ioctl: VIDIOC_DBG_G_REGISTER

          00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000100: 33 84 02 76 80 dd 04 07 0f 04 0a 10 fe e2 2b 00 
00000110: e5 d6 98 00 00 8c 07 00 02 00 00 00 00 00 00 00 
00000120: 00 00 01 10 87 b6 b0 50 f8 93 11 a0 ff 5f 20 11 
00000130: 00 00 00 00 02 18 0a 00 00 00 00 00 00 00 36 00 
[...]

# v4l2-apps/util/v4l2-dbg -d /dev/video0 -c 0x44 -g 0x100
ioctl: VIDIOC_DBG_G_REGISTER
Register 0x00000100 = 33h (51d  00110011b)


You can use -s to set registers too.

Be careful some registers have "auto-configuration side effects.  If you
change them, they change other registers (Fun!).  



> I've used 2 different VCR machines from different manufacturers with the
> same results, and so am inclined to think the "syncs" are acceptable. I'm
> using the PVR-500 to capture VHS tapes for transcription onto DVDs. From the
> VCR I have S-Video and audio to the PVR-500, and am using a composite cable
> from the VCR to a regular television set. This allows me to compare the
> mpeg2 stream with the ordinary tv in real-time, with only a slight delay on
> the computer.

Some VCR's don't output all 9 sync pulses at vsync, but a few less.  
The CX25843 likely isn't set up for this by default.  I do believe there
is a VCR flag in one of the registers.



> The tv doesn't have the "features" that are observed in the mpeg2 that
> results from the Hauppauge card. In addition, some sections of the VHS tapes
> are entirely visible on the tv while the mpeg2 stream from /dev/video0 is
> remarkably distorted in both imagery and color, with wildly oscillating
> diagonal black bands making the resultant mpeg2 file most undesirable.

Hmmm.  Herring bone patterns on a video signal are usually from FM
interferers.  Color distortion is caused by problems locking on to the
color burst.  

You should probably try the +12 dB gain setting on the analog inputs of
the CX25843.  You'll have to find the one that corresponds to the
composite in - look in ivtv-cards.c.  The +12 dB gain setting may  be in
one of those registers that forces the autoconfig, which may make manual
manipulation infeasible.  :(  (If that is the case, hack the CX25840
driver instead.)



> Looking at the tv shows the VHS tapes to be in great shape considering their
> age.

Your TV is probably doing a lot of signal conditioning.

>  Looking at the mpeg2 files captured from the card leaves much to be
> desired, as the image quality in the mpeg2 files is very badly affected,
> sometimes adequate but often distorted in ways that the same tv image
> doesn't show.

The image quality probably belies the actual quality of the signal
recorded on the tape.  It's probably good you're trying to move them to
DVD.


> Here is some information:
> $ v4l2-ctl -ISD
> Driver info:
>         Driver name   : ivtv
>         Card type     : WinTV PVR 500 (unit #1)
>         Bus info      : PCI:0000:04:08.0
>         Driver version: 66561
>         Capabilities  : 0x01070051
>                 Video Capture
>                 VBI Capture
>                 Sliced VBI Capture
>                 Tuner
>                 Audio
>                 Radio
>                 Read/Write
> Video input : 1 (S-Video 1)
> Video standard = 0x00001000
>         NTSC-M
> 
> I'm wondering if there is some "over-sampling" or some such thing in the
> mpeg2 output from the card, which introduces noise into the image that isn't
> seen in the tv display, e.g. the "stream 0 codec frame rate differs from
> container frame rate: 59.94 (60000/1001) -> 29.97 (30000/1001)" and the
> warnings and errors in the following output:
> 
> $cat /dev/video0 > test.mpg # ... <Ctrl-C>
> $ ffmpeg -i test.mpg -target ntsc-dvd -y test_new.mpg
> ...
> Seems stream 0 codec frame rate differs from container frame rate: 59.94
> (60000/1001) -> 29.97 (30000/1001)
> Input #0, mpeg, from 'test.mpg':
>   Duration: 00:00:14.92, start: 0.189200, bitrate: 6263 kb/s
>     Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR
> 4:3], 8000 kb/s, 29.97 tbr, 90k tbn, 59.94 tbc
>     Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 224 kb/s
> Output #0, dvd, to 'test_new.mpg':
>     Stream #0.0: Video: mpeg2video, yuv420p, 720x480 [PAR 8:9 DAR 4:3],
> q=2-31, 6000 kb/s, 90k tbn, 29.97 tbc
>     Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 448 kb/s
> Stream mapping:
>   Stream #0.0 -> #0.0
>   Stream #0.1 -> #0.1
> Press [q] to stop encoding
> [mpeg2video @ 0x95a17c0]ac-tex damaged at 10 25=14.40 bitrate=6214.5kbits/s
> [mpeg2video @ 0x95a17c0]Warning MVs not available
> [mpeg2video @ 0x95a17c0]concealing 225 DC, 225 AC, 225 MV errors
>
> frame=  626 fps= 10 q=17.9 Lsize=   16694kB time=14.59 bitrate=9372.1kbits/s
> video:15563kB audio:798kB global headers:0kB muxing overhead 2.037058%
> ----------------------------
> 
> I'm really having a serious problem with the mpeg2 output of the Hauppauge
> card and would be grateful for any help in solving the issue within a Linux
> environment.

My personal opinion: if the content on the tapes is valuable to you, get
a professional archiving service to make your DVD archives.  It may be
the case that the PVR's capture distortions belie that your tapes are in
marginal condition.

BTW, Have you tried this VCR signal with this capture card in a Windows
machine?

Regards,
Andy


_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users

Reply via email to