Terratec Grabby and vcr

Posted at 2015-12-04.

I decided to try to grab some notes about video capture on Debian with a cheap Terratec Grabby.

Test the grabber

Plug in detects em2860 with a mixer and V4l2 interface:

kernel: usb 3-1.1: new high-speed USB device number 8 using ehci-pci
kernel: usb 3-1.1: New USB device found, idVendor=0ccd, idProduct=0096
kernel: usb 3-1.1: New USB device strings: Mfr=2, Product=1, SerialNumber=0
kernel: usb 3-1.1: Product: TerraTec Grabby
kernel: usb 3-1.1: Manufacturer: TerraTec Electronic GmbH
mtp-probe[20011]: checking bus 3, device 8: "/sys/devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.1"
mtp-probe[20011]: bus: 3, device: 8 was not an MTP device
kernel: media: Linux media interface: v0.10
kernel: Linux video capture interface: v2.00
kernel: em28xx: New device TerraTec Electronic GmbH TerraTec Grabby @ 480 Mbps (0ccd:0096, interface 0, class 0)
kernel: em28xx: Video interface 0 found: isoc
kernel: em28xx: chip ID is em2860
kernel: em2860 #0: EEPROM ID = 1a eb 67 95, EEPROM hash = 0x77daab95
kernel: em2860 #0: EEPROM info:
kernel: em2860 #0:         AC97 audio (5 sample rates)
kernel: em2860 #0:         500mA max power
kernel: em2860 #0:         Table at offset 0x06, strings=0x229e, 0x346a, 0x0000
kernel: em2860 #0: Identified as Terratec Grabby (card=67)
kernel: em2860 #0: analog set to isoc mode.
kernel: em28xx audio device (0ccd:0096): interface 1, class 1
kernel: em28xx audio device (0ccd:0096): interface 2, class 1
kernel: usbcore: registered new interface driver em28xx
kernel: em2860 #0: Registering V4L2 extension
kernel: usbcore: registered new interface driver snd-usb-audio
systemd-udevd[20023]: Process '/usr/sbin/alsactl -E HOME=/var/run/alsa restore 2' failed with exit code 99.
kernel: saa7115 9-0025: saa7113 found @ 0x4a (em2860 #0)
kernel: em2860 #0: Config register raw data: 0x50
kernel: em2860 #0: AC97 vendor ID = 0x83847652
kernel: em2860 #0: AC97 features = 0x6a90
kernel: em2860 #0: Sigmatel audio processor detected (stac 9752)
kernel: em2860 #0: V4L2 video device registered as video0
kernel: em2860 #0: V4L2 VBI device registered as vbi0
kernel: em2860 #0: V4L2 extension successfully initialized
kernel: em28xx: Registered (Em28xx v4l2 Extension) extension

Doesn't look like the button gets an event device. Let's try mpv.

$ mpv tv://
Playing: tv://
[tv] Selected driver: v4l2
[tv]  name: Video 4 Linux 2 input
[tv] Selected device: Terratec Grabby
[tv]  Capabilities:  video capture  VBI capture device  audio  read/write  streaming
[tv]  supported norms: 0 = NTSC; 1 = NTSC-M; 2 = NTSC-M-JP; 3 = NTSC-M-KR; 4 = NTSC-443; 5 = PAL; 6 = PAL-BG; 7 = PAL-H; 8 = PAL-I; 9 = PAL-DK; 10 = PAL-M; 11 = PAL-N; 12 = PAL-Nc; 13 = PAL-60; 14 = SECAM; 15 = SECAM-B; 16 = SECAM-G; 17 = SECAM-H; 18 = SECAM-DK; 19 = SECAM-L; 20 = SECAM-Lc;
[tv]  inputs: 0 = Composite1; 1 = S-Video;
[tv]  Current input: 0
[tv]  Current format: YUYV
[tv] ioctl set format failed: Invalid argument
[tv] ioctl set format failed: Invalid argument
[tv] ioctl set format failed: Invalid argument
[tv] Selected input hasn't got a tuner!
 (+) Video --vid=1 (rawvideo)
Using conversion filter.
VO: [opengl] 640x480 yuv422p
V: 00:00:14
[tv] VIDIOC_DQBUF failed: Invalid argument
[tv] VIDIOC_DQBUF failed: Invalid argument
[tv] VIDIOC_DQBUF failed: Invalid argument
[tv] VIDIOC_DQBUF failed: Invalid argument
[tv] VIDIOC_DQBUF failed: Invalid argument
[tv] VIDIOC_DQBUF failed: Invalid argument
[tv] 361 frames successfully processed, 0 frames dropped.

$ mpv pvr://
Playing: pvr://
[pvr] select channel list europe-east, entries 133
[pvr] Using device /dev/video0
[pvr] Detected Terratec Grabby
[pvr] device do not support MPEG input.
Failed to open pvr://.


Exiting... (Errors when loading file)

Looks like there's output from the tv (uncompressed stream) input. But here I run into a classic fault. The VCR doesn't turn the tape. If I help the pulling wheel along, it starts to run, but stalls a few times again. It might be that the drive belt has gone stiff. Nicely, the loading mechanism in this one (Sony SLV-SE737) is by worm gear and wheels, so the most common failure point doesn't exist. After a few tries, the tape seems to be running smoothly.

Connect to a VCR

Naturally, all my SCART adapters are probably for input since there's no image of any kind. This is usually the case anyway. Nineties problems.

SCART pin numbering is fairly simple because of the asymmetrical (and otherwise massively annoying) connector. Essentially 21 is the missing pin (shield) and the row it's on is all odd numbers from there down. Even numbers are on the other line in staggered order much like a D connector. Whichever side you look at, you know the high pins are on the non-square end and low pins are on the square end. Figuring out exactly what the signals are and which ones are connected where can be a handful. There aren't that many options if you're making your own cable or adapter, though. One thing to note is which end of the cable you're in and are you connecting inputs or outputs.

Interesting pins should be:

Or at the other end

Also, there are separate ground pins (which might or might not work as intended):

S-video has two pairs of pins. If you look at the pins as a row (fan), the edgemost pins are ground and the middle pins are Y and C. These form two pairs intended for coaxial cables. Better check some pictures and make sure you're viewing the right side connector to tell which side is which. Also, the numbering will be funny.

Sometimes you can see it called "SVHS" and this is entirely wrong. S-VHS, like VHS, is a video tape format ("Super VHS"). S-video is a "separated video" using two signals. The names should be easy to remember, especially when you know that VHS is a tape. The intent on how grounds and shields relate is not exactly clear.

Composite (entirely different from Component!) video, or CVBS for Color+Video+Blank+Sync, is usually a simple coaxial line typically with yellow RCA connector.

Realistically, there is probably no difference in playback image quality from composite or S-video as the tapes are so terrible. I do have a nice metal S-video connnector I was saving just for this kind of thing, but I can't remember where I put it. There is also a stereo out on the VCR, so I settled for a composite out adapter for now.

Capture video

I can capture video with a script using mpv, but it will never seem to add an audio track. It seems to completely ignore any audio options. I will look into some other program, notably gstreamer. It will be more useful in the long run anyway.

I made a little gstreamer grab script and it works, but the results are not really worthy. Is it the grabber or could there be some options to make it better? I don't know at this point.

Links