Saturday, February 7, 2009

Fixing xvidcap crashes on Ubuntu

Using xvidcap from the Ubuntu repository doesn't seem to work too well, at least for me. The version in the package tree is 1.1.6. That version would never achieve the frame rates I wanted but even worse it crashes all the time. It was crashing within 5 secs some times. Hardly enough time to make any type of video. I think I have it working on my machine now and I thought I would share what I did.
I did search the repository for updates, but for 8.04 1.1.6 is the latest. I found the 1.1.6 is the latest for 8.10 too. I was looking for an excuse to upgrade, but this won't be it.
I also found that others were having this problem on Ubuntu and that in theory there was a fix in 1.1.7. When I went to sourceforge I found 1.1.7 was there and .debs existed. I didn't mess those and just got the source. At the end I created my own .deb. I got the source because its a video based app and I just wanted to do it. If you try the new .deb and it works, let me know.
I'm going to assume that you have build-essentials and checkinstall as you would to compile any programs on Ubuntu. That's all on Ubuntu's site.
I download and unpacked the source. tar -xzvf xvidcap-1.1.7.tar.gz and cd to the new directory.
Then I ran configure like normal with these flags.
./configure CFLAGS="-march=native -O2 -pipe" MAKEOPTS="-j5" -prefix=/usr
You need gcc 4.2 or higher which is on Ubuntu 8.04 to use the -march=native. Basically it will pick the best opts for your architecture, which wasn't that hard, but this is easier. I went with 02 hoping for better performance. My guess is that it would have already been compiled with this by default but I'm not sure. I have a quad so I used -j5 or cpus + 1.
When it was done I still did a make -j5. It compiled so fast I thought it didn't work.
When I tested it in src it didn't work. I wasn't happy, but it looked like a path problem looking for a shared lib, so I did the install anyway.
I ran sudo make install and all went well. I tested the program and it was working well. Better than I expected using mp4 DIVX at 24 fps and getting them all. My test was capturing a youtube video playing on my screen.

When that was done I still ran

sudo checkinstall -D make install

which reinstalled and made the .deb package. xvidcap 1.1.7-1 is now showing in my Snaptic package manager so I can uninstall it if I want later.

I think you can run checkinstall before the sudo make install and then run dpkg -i package.deb but I have never done it that way. maybe some day. Anyway xvidcap 1.1.7 is running on my Ubuntu 8.04 very well as far as I can see.

BTW - I was not using sound capture.
Good luck and let me know if you have success or failures with this.

No comments:

Post a Comment