# firewire (iidc) camera, libdc1394 and FreeBSD



## mudskipper (Jun 16, 2009)

Hi,

I am building an interferometer and need a camera for digital acquisition of wavefront images. I built the hardware and wrote analysis and visualisation code on my FreeBSD laptop, so the only thing missing now is a working camera.

Since I need >1Mpx images I have been looking at Firewire camera's. Although these are more expensive than USB counterparts, most of them follow the industrial IIDC standard, which looks like a good thing for interoperability and later upgrades.

Fortunately I saw that the libdc1394 port was added to the ports collection some weeks ago, which provides an API for using IIDC cameras with FreeBSD. However, the few parts of example code that can be found make use of libraw1394, which isn't ported to FreeBSD (though these examples seem to date from version 1.x of libdc1394). libraw1394 is also listed as a dependency for Linux usage of libdc1394.

On the other hand, after installing libdc1394 no references to libraw1394 can be found in its sources. FreeBSD ports doesn't list it as a dependency either.

Can somebody shed light on whether this port can be used in its current state? And does its inclusion in ports perhaps signify that libraw1394 support is on its way?

Thanks.


----------



## SirDice (Jun 17, 2009)

I have no idea about the port but you could take a peek at the source for fwcontrol(8). Fwcontrol is able to read a DV or MPEG TS stream from a firewire source.


----------



## mudskipper (Jun 21, 2009)

Thanks SirDice, I hadn't noticed the MPEG capabilities of fwcontrol yet (thought it was only DV). But unfortunately that didn't work:


```
#fwcontrol -u 1 -R opname.dv
fwcontrol: detect_recv_fn: ioctl FW_SSTBUF: Bad file descriptor
```

The same happens after changing the sysctl settings or using fwcontrol -M mpeg, as per the man page.

In fact, IIDC is a different protocol than DV. DV is for camcorders which send compressed video over the firewire bus. IIDC is for raw video, generally from machine vision cameras and some webcams (e.g. iSight on MacBook). There are hundreds of nice, expensive, industrial cameras supporting this standard.

On the net I found reports of people trying to make iidc work on FBSD, and also some discussion on the porting of libraw1394. But all these posts are from several years ago, and it is unclear where all this led to. It is the inclusion of libdc1394 in ports, recently, that made me think it should work. But how?


----------



## ivand58 (Jun 28, 2009)

mudskipper said:
			
		

> ... But unfortunately that didn't work:
> 
> 
> ```
> ...


I've the same problem with freeBSD7.1 and 7.2, but fwcontrol  works with freeBSD7.0 (I still don't know why)


----------



## mudskipper (Feb 12, 2010)

Well, after 8 months I have looked into this again to see if anything has changed since the release of 8.0. I still get the error


```
fwcontrol: detect_recv_fn: ioctl FW_SSTBUF: Bad file descriptor
```

But this post suggests to use the -u switch of fwcontrol(). This seems to work:


```
#fwcontrol -u 0 -M mpeg -R file.mpg
(EAGAIN) - push 'Play'?
(EAGAIN) - push 'Play'?
^C
#
```

(same for -M dv). The file is created, so I am sure nothing is wrong with fwcontrol(). What doesn't work however, is to record IIDC (uncompressed) video with it (as I expected, but it was worth the try). The filesize remains 0 bytes, and it keeps asking to push play until I kill it with Ctrl-C.

Some months ago I also mailed the maintainer of multimedia/libdc1394 to ask if this port implies an upcoming support for IIDC camera's, but unfortunately it was only included because it was needed for the latest version of multimedia/ffmpeg. So without libraw1394 I conclude that storing IIDC stills/video will not be supported on FreeBSD for the time being. But any news on this is much appreciated!


----------



## enhering (Feb 27, 2018)

Hi. Could you find a solution? Same problem here. I have a Sony XCD-SX90CR camera that supports IIDC protocol, but cannot make it work on FreeBSD 11.1.


----------



## enhering (Feb 27, 2018)

Found this:

multimedia / spook   
Embedded RTP/RTSP/HTTP video streamer

Spook is a Linux server application to capture live video and audio
and stream it over an IP network. Currently, Spook supports capturing
from a Firewire IIDC camera or Video4Linux(2) source and streaming
MPEG4 with RTSP or JPEG stills with HTTP.

WWW: http://www.litech.org/spook/


----------

