lwhi
YaBB Newbies
Offline
Posts: 17
Re: Capturing from a dvcam in linux
Reply #3 - May 6th , 2008, 11:58pm
As I mentioned before, I'm trying to use my digital camcorder as a webcam with processing(+GSvideo), in linux. I'm stuck, and not really sure how to progress, so I thought I'd spell out my experience so far - in case anyone has any ideas or wants info on achieving the same. There's a utility called dv4l(http://dv4l.berlios.de/) which can be used to create an interface between the dvcam and video4linux (v4l). dv4l can can be used in two different ways; 1. via a utility called 'dv4lstart' 2. via a utility called 'dv4l' + a module called 'vloopback' (http://www.lavrsen.dk/twiki/bin/view/Motion/VideoFourLinuxLoopbackDevice ) Method 1; --------- This should be the simplest route... run 'dv4lstart ./processing' The idea here is to use dv4lstart to create a v4l device at '/dev/video0'; and then load processing, allowing it to make use of the new device. In theory, the camera negotiations should be invisible to processing (and GSvideo) and all should work well... but, I get an error when I run the command.. # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGBUS (0x7) at pc=0xb78b0b0a, pid=15828, tid=3084363440 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_12-b04 mixed mode, sharing) # Problematic frame: # V [libjvm.so+0x313b0a] # # An error report file with more information is saved as hs_err_pid15828.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp .. so I've had to abandon this idea. I've successfully managed to load other programs (vlc and camorama) using dv4lstart... so the problem is something specific to processing and/or java. Method 2; --------- This route's a little more complicated. I've divided it into two attempts ATTEMPT 1; i) load vloopback by running 'sudo modprobe vloopback' This will create two devices at /dev/video0 and /dev/video1. The first is used for video input and the second is used for video output. ii) run 'dv4l' This command streams the video from the camcorder (which will then be accessible using v4l at '/dev/video1'). At this point I thought I was onto something, but I still had a problem ... I need the video to be accessible at '/dev/video0' NOT '/dev/video1'. After hours of hopelessness, I found that vloopback can take a parameter; ATTEMPT 2; i)run 'sudo modprobe vloopback dev_offset=1' This will create two devices at /dev/video1 and /dev/video2 (crucially, leaving '/dev/video0' unused). ii)run 'dv4l' This is just the same as before .. only now the v4l device will be '/dev/video2'. I assumed that I would then be able to finish off the bastard, with a symbolic link; iii)'sudo ln -s /dev/video2 /dev/video0 Now, I'm no linux expert at all, and all of what I know is cobbled together.. but I believed that this should have worked - and I'm confused to why it hasn't. If you've read to this point, thanks for baring with me. Any ideas would be amazing.