English-posts · Teknologi · Video

Unstable video capture with DC10+ on Ubuntu 10.10

28. november 2010 · Ingen Kommentarer

Some weeks ago I wrote about capturing video with an old Pinnacle DC10+ card on Ubuntu 10.10.

Since then I have had varying success capturing hours of video from both Hi8 and VHS sources. Often lavrec will exit in the middle of a recording with somewhat unknown error messages such as:


# dmesg:
DC10plus[0]: jpg_sync - timeout: codec isr=0x00

# lavrec:
Error syncing on a buffer: Timer expired

… and other nicies.

Often this happened between recordings on the tape, when stopping and starting a recording, where it often occur a lot of noise and jitter. It happened more often when recording from VHS tapes than from HI8 tapes.

I tried different values for the system configuration kernel.sched_time_avg with what looks like random improvements. The default is 1000 on a normal Ubuntu Desktop 10.10. I have tried both 100 and 250, and 250 is what I am currently using. Change it like this:


$ sudo sysctl kernel.sched_time_avg=250

I was previously using KDE while recording, but found out that several background processes like Akonadi Server was running and stealing resources. The window manager seemed slow. I guess I have an I/O issue somewhere, but I just don’t know where. Maybe the SCSI drive or maybe the graphics card which is an old ATI Radeon 8500.

I an now running Openbox with Konsole, as a command line (in an X server) is all I need to both record and watch the result with mplayer afterwards. I feel it goes a little bit smoother.

The most effect, as I figured out, was setting the quality option of lavrec a little lower. Recording with the quality set to 100 might result in unstable recording with lost frames if there is the slightest delay in the system, and eventually lavrec just exits with an error.

I tried setting the quality to 80, just to give it a try, and it was recording much more smoothly with less dropped frames. It looks like lavrec now handles jitter much better.

I am now trying out a quality of 90 which also seems good. A little lost frames now and then, but I guess that occurs mostly between recordings since I am able to record several minutes from a single scene without a single frame drop.

This is the command I use now:


$ aoss lavrec --mjpeg-buffers 512 --mjpeg-buffer-size 8192 -f q -d 1 -i p -q 90 -s -R l -U "dc10-%02d.mov"

So, my best tip to avoid lost frames and lavrec crashes is to lower the quality a little.